Lines Matching +full:write +full:- +full:data
1 .. SPDX-License-Identifier: GPL-2.0
10 (1) A cache is logically organised into volumes and data storage objects
13 (2) Volumes and data storage objects are represented by various types of
18 (4) Cookies have coherency data that allows a cache to determine if the
19 cached data is still valid.
31 (3) Data file registration
33 (5) Resizing a data file (truncation)
34 (6) Data I/O API
35 (7) Data file coherency
36 (8) Data file invalidation
37 (9) Write back resource management
47 represents "data storage objects". These are represented by two types of
81 When performing a read, write or resize on a cookie, the filesystem must first
104 and notes the coherency data.
116 The specified coherency data is stored in the cookie and will be matched
117 against coherency data stored on disk. The data pointer may be NULL if no data
118 is provided. If the coherency data doesn't match, the entire cache volume will
136 coherency data will be set to the value supplied. The amount of coherency data
138 data cookies obtained in this volume must be relinquished before the volume is
142 Data File Registration
146 cookie for data storage::
163 The caller should also pass in a piece of coherency data in aux_data. A buffer
164 of size aux_data_len will be allocated and the coherency data copied in. It is
165 assumed that the size is invariant over time. The coherency data is used to
166 check the validity of data in the cache. Functions are provided by which the
167 coherency data can be updated.
170 used to trim the data and will be stored with the coherency data.
188 Marking A Cookie In-Use
204 needs to access/store data in the cache. This is done in the background, and
208 It optionally updates the stored coherency data and object size and then
209 decreases the in-use counter. When the last user unuses the cookie, it is
213 A cookie must be marked in-use before it can be accessed for read, write or
214 resize - and an in-use mark must be kept whilst there is dirty data in the
218 Note that in-use marks are cumulative. For each time a cookie is marked
219 in-use, it must be unused.
222 Resizing A Data File (Truncation)
231 The caller must have first marked the cookie in-use. The cookie and the new
233 be called from ``->setattr()`` inode operation under the inode lock.
236 Data I/O API
239 To do data I/O operations directly through a cookie, the following functions
258 (for instance, it will return -ENOBUFS if given a NULL cookie, but otherwise do
261 The *read* and *write* functions initiate a direct-IO operation. Both take the
264 data.
270 The read and write functions can be given an optional termination function that
282 Both the read and write functions end the operation when they complete,
289 Data File Coherency
292 To request an update of the coherency data and file size on a cookie, the
299 This will update the cookie's coherency data and/or file size.
302 Data File Invalidation
305 Sometimes it will be necessary to invalidate an object that contains data.
307 of a remote third-party change - at which point the filesystem has to throw
308 away the state and cached data that it had for an file and reload from the
320 reads to fail with -ESTALE, sets the coherency data and file size from the
322 go and get rid of the old data.
328 Write-Back Resource Management
331 To write data to the cache from network filesystem writeback, the cache
339 in-use is held on the cookie for this inode. It can only be changed if the
369 up any hanging ``I_PINNING_FSCACHE_WB``. It also allows the coherency data to
376 If a network filesystem has locally modified data that it wants to write to the
377 cache, it needs to mark the pages to indicate that a write is in progress, and
379 (presumably due to an already in-progress operation). This prevents multiple
395 schedule a write of that region::
418 The write function takes some additional parameters: the cookie representing
423 Note that the write function will always run asynchronously and will unmark all
430 Fscache keeps track of whether we have any data in the cache yet for a cache
432 has done a write and then the page it wrote from has been released by the VM,
443 page to say that a DIO write is underway from that page::
452 .. kernel-doc:: include/linux/fscache.h