userlibandfileserver/fileserver/sfat32/fat_config.inl
changeset 15 4122176ea935
child 254 1560c419b176
equal deleted inserted replaced
0:a41df078684a 15:4122176ea935
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // f32\sfat\fat_config.inl
       
    15 // FAT fsy configurator
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalTechnology
       
    22 */
       
    23 
       
    24 #ifndef FAT_CONFIGURATOR_INL
       
    25 #define FAT_CONFIGURATOR_INL
       
    26 
       
    27 //-----------------------------------------------------------------------------
       
    28 /**
       
    29     Meaning of this parameter:
       
    30     if not 0, ScanDrive will not run on finalised FAT volume, i.e. that has "CleanShutdown" flag set in FAT[1] by
       
    31     proper finalisation.
       
    32     See CFatMountCB::ScanDrive().
       
    33 */
       
    34 TBool TFatConfig::ScanDrvSkipFinalisedVolume() const
       
    35     {
       
    36     ASSERT(iInitialised);
       
    37     return iScanDrvSkipFinalisedVolume;
       
    38     }
       
    39 
       
    40 //-----------------------------------------------------------------------------
       
    41 /**
       
    42     Meaning of this parameter:
       
    43     if not 0, enables asynchronous mounting of the FAT32 volumes.
       
    44     In particular background FAT32 scan for free clusters. See CAtaFatTable::CountFreeClustersL().
       
    45 */
       
    46 TBool TFatConfig::FAT32_AsynchMount() const
       
    47     {
       
    48     ASSERT(iInitialised);
       
    49     return iFAT32_AsynchMount;
       
    50     }
       
    51 
       
    52 //-----------------------------------------------------------------------------
       
    53 /**
       
    54     Meaning of this parameter:
       
    55     if not 0, enables using FSInfo sector data during FAT32 volumes mounting to determine number of free clusters etc.
       
    56 */
       
    57 TBool TFatConfig::FAT32_UseFSInfoOnMount() const
       
    58     {
       
    59     ASSERT(iInitialised);
       
    60     return iFAT32_UseFSInfoOnMount;
       
    61     }
       
    62 
       
    63 //-----------------------------------------------------------------------------
       
    64 /**
       
    65     Meaning of this parameter:
       
    66     if not 0, enables using FAT32 bit supercache that makes free FAT entries lookup faster
       
    67 */
       
    68 TBool TFatConfig::FAT32_UseBitSupercache() const
       
    69     {
       
    70     ASSERT(iInitialised);
       
    71     return iFAT32_UseBitSupercache;
       
    72     }
       
    73 
       
    74 //-----------------------------------------------------------------------------
       
    75 /**
       
    76     Meaning of this parameter:
       
    77     Overall FAT directory cache size in bytes
       
    78 */
       
    79 TUint32 TFatConfig::DirCacheSize() const
       
    80     {
       
    81     ASSERT(iInitialised);
       
    82     return iDirCacheSizeKB * K1KiloByte;
       
    83     }
       
    84 
       
    85 //-----------------------------------------------------------------------------
       
    86 
       
    87 /**
       
    88     Meaning of this parameter:
       
    89     Log2 of the maximal size of the dir. cache page in bytes. (Minimal size will be  current cluster size)
       
    90 */
       
    91 TUint32 TFatConfig::DirCacheMaxPageSizeLog2() const
       
    92     {
       
    93     ASSERT(iInitialised);
       
    94     return iDirCacheMaxPageSizeLog2;
       
    95     }
       
    96 
       
    97 /**
       
    98     Get FAT16 fixed cache parameters
       
    99     @param  aRdGrLog2 Log2(read granularity)
       
   100     @param  aWrGrLog2 Log2(write granularity)
       
   101 */
       
   102 void TFatConfig::Fat16FixedCacheParams(TUint32& aRdGrLog2, TUint32& aWrGrLog2) const
       
   103     {
       
   104     ASSERT(iInitialised);
       
   105     aRdGrLog2 = iFat16FixedCacheReadGrLog2; 
       
   106     aWrGrLog2 = iFat16FixedCacheWriteGrLog2;
       
   107     }
       
   108 /**
       
   109     Get FAT32 LRU cache parameters
       
   110     @param  aRdGrLog2 Log2(read granularity)
       
   111     @param  aWrGrLog2 Log2(write granularity)
       
   112     @param  aCacheSize maximal cache size, bytes
       
   113 */
       
   114 void TFatConfig::Fat32LruCacheParams(TUint32& aRdGrLog2, TUint32& aWrGrLog2, TUint32& aCacheSize) const
       
   115     {
       
   116     ASSERT(iInitialised);
       
   117     aRdGrLog2 = iFat32LRUCacheReadGrLog2;
       
   118     aWrGrLog2 = iFat32LRUCacheWriteGrLog2;
       
   119     aCacheSize = iFat32LRUCacheSizeKB * K1KiloByte;
       
   120     }
       
   121 
       
   122 
       
   123 /**
       
   124     Meaning of this parameter:
       
   125     if not 0, "clean shutdown mask" bit in FAT16[1] will be used during volume finalisation.
       
   126     Otherwise, FAT16[1] will not be affected during finalisation
       
   127 */
       
   128 TBool TFatConfig::FAT16_UseCleanShutDownBit() const
       
   129     {
       
   130     ASSERT(iInitialised);
       
   131     return iFAT16_UseCleanShutDownBit;
       
   132     }
       
   133 
       
   134 
       
   135 
       
   136 //-----------------------------------------------------------------------------
       
   137 /**
       
   138     Get leaf dir cache size
       
   139 	@return leaf dir cache size
       
   140 */
       
   141 TUint32 TFatConfig::LeafDirCacheSize() const
       
   142     {
       
   143     ASSERT(iInitialised);
       
   144     return iLeafDirCacheSize;
       
   145     }
       
   146 
       
   147 /**
       
   148 	get the minimum cache size setting for dynamic dir cache
       
   149 	@return minimum cache size in bytes				
       
   150 */
       
   151 TUint32 TFatConfig::DynamicDirCacheSizeMin() const
       
   152 	{
       
   153     ASSERT(iInitialised);
       
   154     ASSERT(iDynamicDirCacheSizeMinKB < (KMaxTUint32 >> K1KiloByteLog2));		//check data overflow
       
   155     return iDynamicDirCacheSizeMinKB << K1KiloByteLog2;
       
   156 	}
       
   157 
       
   158 /**
       
   159 	get the maximum cache size setting for dynamic dir cache
       
   160 	@return maximum cache size in bytes				
       
   161 */
       
   162 TUint32 TFatConfig::DynamicDirCacheSizeMax() const
       
   163 	{
       
   164     ASSERT(iInitialised);
       
   165     ASSERT(iDynamicDirCacheSizeMaxKB < (KMaxTUint32 >> K1KiloByteLog2));		//check data overflow
       
   166     return iDynamicDirCacheSizeMaxKB << K1KiloByteLog2;
       
   167 	}
       
   168 
       
   169 /**
       
   170     retrieve the size of the maximal size of the dynamic dir cache page in log2. 
       
   171     (Minimal size will be  current cluster size)
       
   172     @return maximum page size in bytes in log2
       
   173 */
       
   174 TUint32 TFatConfig::DynamicDirCacheMaxPageSizeLog2() const
       
   175     {
       
   176     ASSERT(iInitialised);
       
   177     return iDynamicDirCacheMaxPageSizeLog2;
       
   178     }
       
   179 
       
   180 
       
   181 #endif //FAT_CONFIGURATOR_INL
       
   182 
       
   183 
       
   184 
       
   185 
       
   186 
       
   187