userlibandfileserver/fileserver/sfat/fat_config.inl
changeset 9 96e5fb8b040d
equal deleted inserted replaced
-1:000000000000 9:96e5fb8b040d
       
     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 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    25 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    26 //!!
       
    27 //!! WARNING!! DO NOT edit this file !! '\sfat' component is obsolete and is not being used. '\sfat32'replaces it
       
    28 //!!
       
    29 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    30 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       
    31 
       
    32 
       
    33 #ifndef FAT_CONFIGURATOR_INL
       
    34 #define FAT_CONFIGURATOR_INL
       
    35 
       
    36 //-----------------------------------------------------------------------------
       
    37 /**
       
    38     Meaning of this parameter:
       
    39     if not 0, ScanDrive will not run on finalised FAT volume, i.e. that has "CleanShutdown" flag set in FAT[1] by
       
    40     proper finalisation.
       
    41     See CFatMountCB::ScanDrive().
       
    42 */
       
    43 TBool TFatConfig::ScanDrvSkipFinalisedVolume() const
       
    44     {
       
    45     ASSERT(iInitialised);
       
    46     return iScanDrvSkipFinalisedVolume;
       
    47     }
       
    48 
       
    49 //-----------------------------------------------------------------------------
       
    50 /**
       
    51     Meaning of this parameter:
       
    52     if not 0, enables asynchronous mounting of the FAT32 volumes.
       
    53     In particular background FAT32 scan for free clusters. See CAtaFatTable::CountFreeClustersL().
       
    54 */
       
    55 TBool TFatConfig::FAT32_AsynchMount() const
       
    56     {
       
    57     ASSERT(iInitialised);
       
    58     return iFAT32_AsynchMount;
       
    59     }
       
    60 
       
    61 //-----------------------------------------------------------------------------
       
    62 /**
       
    63     Meaning of this parameter:
       
    64     if not 0, enables using FSInfo sector data during FAT32 volumes mounting to determine number of free clusters etc.
       
    65 */
       
    66 TBool TFatConfig::FAT32_UseFSInfoOnMount() const
       
    67     {
       
    68     ASSERT(iInitialised);
       
    69     return iFAT32_UseFSInfoOnMount;
       
    70     }
       
    71 
       
    72 //-----------------------------------------------------------------------------
       
    73 /**
       
    74     Meaning of this parameter:
       
    75     if not 0, enables using FAT32 bit supercache that makes free FAT entries lookup faster
       
    76 */
       
    77 TBool TFatConfig::FAT32_UseBitSupercache() const
       
    78     {
       
    79     ASSERT(iInitialised);
       
    80     return iFAT32_UseBitSupercache;
       
    81     }
       
    82 
       
    83 //-----------------------------------------------------------------------------
       
    84 /**
       
    85     Meaning of this parameter:
       
    86     Overall FAT directory cache size in bytes
       
    87 */
       
    88 TUint32 TFatConfig::DirCacheSize() const
       
    89     {
       
    90     ASSERT(iInitialised);
       
    91     return iDirCacheSizeKB * K1KiloByte;
       
    92     }
       
    93 
       
    94 //-----------------------------------------------------------------------------
       
    95 
       
    96 /**
       
    97     Meaning of this parameter:
       
    98     Log2 of the maximal size of the dir. cache page in bytes. (Minimal size will be  current cluster size)
       
    99 */
       
   100 TUint32 TFatConfig::DirCacheMaxPageSizeLog2() const
       
   101     {
       
   102     ASSERT(iInitialised);
       
   103     return iDirCacheMaxPageSizeLog2;
       
   104     }
       
   105 
       
   106 /**
       
   107     Get FAT16 fixed cache parameters
       
   108     @param  aRdGrLog2 Log2(read granularity)
       
   109     @param  aWrGrLog2 Log2(write granularity)
       
   110 */
       
   111 void TFatConfig::Fat16FixedCacheParams(TUint32& aRdGrLog2, TUint32& aWrGrLog2) const
       
   112     {
       
   113     ASSERT(iInitialised);
       
   114     aRdGrLog2 = iFat16FixedCacheReadGrLog2; 
       
   115     aWrGrLog2 = iFat16FixedCacheWriteGrLog2;
       
   116     }
       
   117 /**
       
   118     Get FAT32 LRU cache parameters
       
   119     @param  aRdGrLog2 Log2(read granularity)
       
   120     @param  aWrGrLog2 Log2(write granularity)
       
   121     @param  aCacheSize maximal cache size, bytes
       
   122 */
       
   123 void TFatConfig::Fat32LruCacheParams(TUint32& aRdGrLog2, TUint32& aWrGrLog2, TUint32& aCacheSize) const
       
   124     {
       
   125     ASSERT(iInitialised);
       
   126     aRdGrLog2 = iFat32LRUCacheReadGrLog2;
       
   127     aWrGrLog2 = iFat32LRUCacheWriteGrLog2;
       
   128     aCacheSize = iFat32LRUCacheSizeKB * K1KiloByte;
       
   129     }
       
   130 
       
   131 
       
   132 /**
       
   133     Meaning of this parameter:
       
   134     if not 0, "clean shutdown mask" bit in FAT16[1] will be used during volume finalisation.
       
   135     Otherwise, FAT16[1] will not be affected during finalisation
       
   136 */
       
   137 TBool TFatConfig::FAT16_UseCleanShutDownBit() const
       
   138     {
       
   139     ASSERT(iInitialised);
       
   140     return iFAT16_UseCleanShutDownBit;
       
   141     }
       
   142 
       
   143 
       
   144 
       
   145 //-----------------------------------------------------------------------------
       
   146 /**
       
   147     Get leaf dir cache size
       
   148     @return leaf dir cache size
       
   149 */
       
   150 TUint32 TFatConfig::LeafDirCacheSize() const
       
   151     {
       
   152     ASSERT(iInitialised);
       
   153     return iLeafDirCacheSize;
       
   154     }
       
   155 
       
   156 /**
       
   157     get the minimum cache size setting for dynamic dir cache
       
   158     @return minimum cache size in bytes             
       
   159 */
       
   160 TUint32 TFatConfig::DynamicDirCacheSizeMin() const
       
   161     {
       
   162     ASSERT(iInitialised);
       
   163     ASSERT(iDynamicDirCacheSizeMinKB < (KMaxTUint32 >> K1KiloByteLog2));        //check data overflow
       
   164     return iDynamicDirCacheSizeMinKB << K1KiloByteLog2;
       
   165     }
       
   166 
       
   167 /**
       
   168     get the maximum cache size setting for dynamic dir cache
       
   169     @return maximum cache size in bytes             
       
   170 */
       
   171 TUint32 TFatConfig::DynamicDirCacheSizeMax() const
       
   172     {
       
   173     ASSERT(iInitialised);
       
   174     ASSERT(iDynamicDirCacheSizeMaxKB < (KMaxTUint32 >> K1KiloByteLog2));        //check data overflow
       
   175     return iDynamicDirCacheSizeMaxKB << K1KiloByteLog2;
       
   176     }
       
   177 
       
   178 /**
       
   179     retrieve the size of the maximal size of the dynamic dir cache page in log2. 
       
   180     (Minimal size will be  current cluster size)
       
   181     @return maximum page size in bytes in log2
       
   182 */
       
   183 TUint32 TFatConfig::DynamicDirCacheMaxPageSizeLog2() const
       
   184     {
       
   185     ASSERT(iInitialised);
       
   186     return iDynamicDirCacheMaxPageSizeLog2;
       
   187     }
       
   188 
       
   189 
       
   190 #endif //FAT_CONFIGURATOR_INL
       
   191 
       
   192 
       
   193 
       
   194 
       
   195 
       
   196