|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-3FEEFC4D-19B5-502A-8310-40646B9C34BC" xml:lang="en"><title>Run |
|
13 time cache settings</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 |
|
15 |
|
16 <p><b>Read caching </b> </p> |
|
17 <p>A client, or multiple clients, may issue repeated requests to read data |
|
18 from the same locality within a file. Data that has been read previously that |
|
19 is still in the cache can be returned to the client without continuously re-reading |
|
20 the data from the media. </p> |
|
21 <p> <b>Note</b>: Read caching has little benefit when files are accessed sequentially |
|
22 in large blocks, and are never re-read. </p> |
|
23 |
|
24 |
|
25 <p><b>Read ahead caching </b> </p> |
|
26 <p>Read ahead caching builds on read caching by detecting clients that are |
|
27 performing streaming operations and speculatively reading ahead on the assumption |
|
28 that, once the data is in the cache it is likely to be accessed in the near |
|
29 future, thus improving performance. </p> |
|
30 |
|
31 |
|
32 <p><b>Write caching </b> </p> |
|
33 <p>Write caching is implemented to perform a small level of write back caching |
|
34 that overcomes the inefficiencies of clients that perform small write operations |
|
35 by consolidating multiple file updates into a single larger write operation, |
|
36 thus taking advantage of media that is written on a block basis as well as |
|
37 minimising the overhead of metadata updates that the file system performs. </p> |
|
38 <section><title>Opening files with different modes</title> <p>The system is |
|
39 configured by partners. Read caching, read ahead caching and write caching |
|
40 are set on a per drive basis and are one of three states, these are:</p><ul> |
|
41 <li><p>ON </p></li> |
|
42 <li><p>ENABLED </p></li> |
|
43 <li><p>OFF</p></li> |
|
44 </ul><p>If caching is set to ENABLED or ON for a drive by the partner then |
|
45 you, as the client, can enable or disable caching at run-time on a per file |
|
46 basis. However, if caching is set to OFF it cannot be altered at run-time. |
|
47 The <codeph>TFileMode</codeph> enumeration supports the run time file caching |
|
48 configurations. The file open modes are as follows: </p><codeblock xml:space="preserve">EFileWriteBuffered =0x00000800, // Enables write buffering |
|
49 EFileWriteDirectIO =0x00001000, // Disables write buffering |
|
50 EFileReadBuffered =0x00002000, // Enables read buffering |
|
51 EFileReadDirectIO =0x00004000, // Disables read buffering |
|
52 EFileReadAheadOn =0x00008000, // Enables read ahead |
|
53 EFileReadAheadOff =0x00010000 // Disables read ahead</codeblock><p>If the |
|
54 values above are not specified when a file is opened then these default settings |
|
55 are used:</p><ul> |
|
56 <li><p>if caching is set to ENABLED for a drive by the partner then caching |
|
57 is OFF by default </p></li> |
|
58 <li><p>if caching is set to ON for a drive by the partner then caching is |
|
59 ON by default</p></li> |
|
60 </ul><note>If caching is set to OFF for a particular drive by the partner, |
|
61 caching cannot be enabled.</note><p>Use the <codeph>TFileMode</codeph> values |
|
62 with the following functions to alter the way in which an open file is accessed. </p><ul> |
|
63 <li><p><xref href="GUID-BE0804F6-4375-3C8A-8C83-968F510466E0.dita#GUID-BE0804F6-4375-3C8A-8C83-968F510466E0/GUID-72470A68-7E07-30EF-A3C8-AA855CDAF60E"><apiname>RFile::Open()</apiname></xref></p></li> |
|
64 <li><p><xref href="GUID-BE0804F6-4375-3C8A-8C83-968F510466E0.dita#GUID-BE0804F6-4375-3C8A-8C83-968F510466E0/GUID-1EB4AA8F-9363-3EC5-8AE2-1F70F15FCF15"><apiname>RFile::Create()</apiname></xref></p></li> |
|
65 <li><p><xref href="GUID-BE0804F6-4375-3C8A-8C83-968F510466E0.dita#GUID-BE0804F6-4375-3C8A-8C83-968F510466E0/GUID-C2069B9B-04C0-3878-BF08-289DBC83DDF8"><apiname>RFile::Replace()</apiname></xref></p></li> |
|
66 <li><p><xref href="GUID-BE0804F6-4375-3C8A-8C83-968F510466E0.dita#GUID-BE0804F6-4375-3C8A-8C83-968F510466E0/GUID-87D0C77C-CC63-3D70-BACE-3C5EE702BD37"><apiname>RFile::Temp()</apiname></xref></p></li> |
|
67 </ul></section> |
|
68 </conbody></concept> |