userlibandfileserver/fileserver/sfile/sf_file_cache_defs.h
changeset 0 a41df078684a
child 20 597aaf25e343
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2006-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\sfile\sf_file_cache_defs.h
       
    15 // This file contains default settings for file caching. 
       
    16 // Some of these settings may be overriden by appropriate entries in the estart.txt file
       
    17 // Sizes / lengths specified in kilobytes, timeouts in miliseconds
       
    18 // 
       
    19 //
       
    20 
       
    21 /**
       
    22  @file
       
    23  @internalTechnology
       
    24 */
       
    25 
       
    26 
       
    27 // Global file-cache settings 
       
    28 const TBool KDefaultGlobalCacheEnabled			= ETrue; 
       
    29 const TInt KDefaultGlobalCacheSize				= (32*1024);	// 32768 K = 32 MBytes - the maximum for all files
       
    30 // The maximum amount of locked data allowed for all files
       
    31 const TInt KDefaultGlobalCacheMaxLockedSize	= (1*1024);		// 1 Mb maximum locked data
       
    32 // Low memory threshold as a percentage of total RAM.
       
    33 // If the amount of RAM drops below this value, attempts to allocate memory for a file caching will fail
       
    34 const TInt KDefaultLowMemoryThreshold			= 10;			// 10 % of total RAM
       
    35 
       
    36 // per-drive file-cache settings. 
       
    37 const TInt KDefaultFileCacheMaxReadAheadLen	= (128);	// 128K	// NB non-configurable by estart
       
    38 const TInt KDefaultFileCacheSize				= (256);	// 256K
       
    39 const TInt KDefaultFairSchedulingLen			= (128);	// 128K
       
    40 
       
    41 
       
    42 enum {EFileCacheFlagOff, EFileCacheFlagEnabled, EFileCacheFlagOn};
       
    43 
       
    44 // default drive cache settings - these may be overridden by estart.txt settings or file open mode 
       
    45 
       
    46 const TInt KDefaultFileCacheRead				= EFileCacheFlagEnabled;
       
    47 const TInt KDefaultFileCacheReadAhead			= EFileCacheFlagOn;		// NB only enabled if read caching also enabled
       
    48 const TInt KDefaultFileCacheWrite				= EFileCacheFlagEnabled;
       
    49 
       
    50 /**
       
    51 If set to ETrue, media driver reads on this drive are considered to be asynchronous 
       
    52 i.e. interrupt driven. This results in read-aheads being issued before completing a client read request.
       
    53 
       
    54 If set to EFalse, media driver reads on this drive are considered to be synchronous 
       
    55 i.e. issuing a read-ahead is likely to block any client thread which will normally be running at
       
    56 lower priority than the media driver's thread. In this case read-aheads only happen during periods 
       
    57 of inactivity so as to improve latency: this is achieved by lowering the process of the drive thread
       
    58 if there is only one read-ahead request in the drive thread's queue.
       
    59 */
       
    60 const TInt KDefaultFileCacheReadAsync			= ETrue;
       
    61  
       
    62 // time after which a file will be removed from closed file queue
       
    63 const TInt KDefaultClosedFileKeepAliveTime = 3000;			// 3,000 ms = 3 seconds
       
    64 
       
    65 // time after which a file containing dirty data will be flushed
       
    66 const TInt KDefaultDirtyDataFlushTime = 3000;				// 3,000 ms = 3 seconds
       
    67