1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/sfile/sf_file_cache_defs.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,67 @@
1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// f32\sfile\sf_file_cache_defs.h
1.18 +// This file contains default settings for file caching.
1.19 +// Some of these settings may be overriden by appropriate entries in the estart.txt file
1.20 +// Sizes / lengths specified in kilobytes, timeouts in miliseconds
1.21 +//
1.22 +//
1.23 +
1.24 +/**
1.25 + @file
1.26 + @internalTechnology
1.27 +*/
1.28 +
1.29 +
1.30 +// Global file-cache settings
1.31 +const TBool KDefaultGlobalCacheEnabled = ETrue;
1.32 +const TInt KDefaultGlobalCacheSize = (32*1024); // 32768 K = 32 MBytes - the maximum for all files
1.33 +// The maximum amount of locked data allowed for all files
1.34 +const TInt KDefaultGlobalCacheMaxLockedSize = (1*1024); // 1 Mb maximum locked data
1.35 +// Low memory threshold as a percentage of total RAM.
1.36 +// If the amount of RAM drops below this value, attempts to allocate memory for a file caching will fail
1.37 +const TInt KDefaultLowMemoryThreshold = 10; // 10 % of total RAM
1.38 +
1.39 +// per-drive file-cache settings.
1.40 +const TInt KDefaultFileCacheMaxReadAheadLen = (128); // 128K // NB non-configurable by estart
1.41 +const TInt KDefaultFileCacheSize = (256); // 256K
1.42 +const TInt KDefaultFairSchedulingLen = (128); // 128K
1.43 +
1.44 +
1.45 +enum {EFileCacheFlagOff, EFileCacheFlagEnabled, EFileCacheFlagOn};
1.46 +
1.47 +// default drive cache settings - these may be overridden by estart.txt settings or file open mode
1.48 +
1.49 +const TInt KDefaultFileCacheRead = EFileCacheFlagEnabled;
1.50 +const TInt KDefaultFileCacheReadAhead = EFileCacheFlagOn; // NB only enabled if read caching also enabled
1.51 +const TInt KDefaultFileCacheWrite = EFileCacheFlagEnabled;
1.52 +
1.53 +/**
1.54 +If set to ETrue, media driver reads on this drive are considered to be asynchronous
1.55 +i.e. interrupt driven. This results in read-aheads being issued before completing a client read request.
1.56 +
1.57 +If set to EFalse, media driver reads on this drive are considered to be synchronous
1.58 +i.e. issuing a read-ahead is likely to block any client thread which will normally be running at
1.59 +lower priority than the media driver's thread. In this case read-aheads only happen during periods
1.60 +of inactivity so as to improve latency: this is achieved by lowering the process of the drive thread
1.61 +if there is only one read-ahead request in the drive thread's queue.
1.62 +*/
1.63 +const TInt KDefaultFileCacheReadAsync = ETrue;
1.64 +
1.65 +// time after which a file will be removed from closed file queue
1.66 +const TInt KDefaultClosedFileKeepAliveTime = 3000; // 3,000 ms = 3 seconds
1.67 +
1.68 +// time after which a file containing dirty data will be flushed
1.69 +const TInt KDefaultDirtyDataFlushTime = 3000; // 3,000 ms = 3 seconds
1.70 +