@@ -32,7 +32,7 @@ This document contains the following sections:
3232 (9) Setting the data file size
3333 (10) Page alloc/read/write
3434 (11) Page uncaching
35- (12) Index and data file update
35+ (12) Index and data file consistency
3636 (13) Miscellaneous cookie operations
3737 (14) Cookie unregistration
3838 (15) Index invalidation
@@ -433,7 +433,7 @@ to the caller. The attribute adjustment excludes read and write operations.
433433
434434
435435=====================
436- PAGE READ/ ALLOC/WRITE
436+ PAGE ALLOC/READ /WRITE
437437=====================
438438
439439And the sixth step is to store and retrieve pages in the cache. There are
@@ -499,7 +499,7 @@ Else if there's a copy of the page resident in the cache:
499499 (*) An argument that's 0 on success or negative for an error code.
500500
501501 If an error occurs, it should be assumed that the page contains no usable
502- data.
502+ data. fscache_readpages_cancel() may need to be called.
503503
504504 end_io_func() will be called in process context if the read is results in
505505 an error, but it might be called in interrupt context if the read is
@@ -623,6 +623,22 @@ some of the pages being read and some being allocated. Those pages will have
623623been marked appropriately and will need uncaching.
624624
625625
626+ CANCELLATION OF UNREAD PAGES
627+ ----------------------------
628+
629+ If one or more pages are passed to fscache_read_or_alloc_pages() but not then
630+ read from the cache and also not read from the underlying filesystem then
631+ those pages will need to have any marks and reservations removed. This can be
632+ done by calling:
633+
634+ void fscache_readpages_cancel(struct fscache_cookie *cookie,
635+ struct list_head *pages);
636+
637+ prior to returning to the caller. The cookie argument should be as passed to
638+ fscache_read_or_alloc_pages(). Every page in the pages list will be examined
639+ and any that have PG_fscache set will be uncached.
640+
641+
626642==============
627643PAGE UNCACHING
628644==============
@@ -690,9 +706,18 @@ written to the cache and for the cache to finish with the page generally. No
690706error is returned.
691707
692708
693- ==========================
694- INDEX AND DATA FILE UPDATE
695- ==========================
709+ ===============================
710+ INDEX AND DATA FILE CONSISTENCY
711+ ===============================
712+
713+ To find out whether auxiliary data for an object is up to data within the
714+ cache, the following function can be called:
715+
716+ int fscache_check_consistency(struct fscache_cookie *cookie)
717+
718+ This will call back to the netfs to check whether the auxiliary data associated
719+ with a cookie is correct. It returns 0 if it is and -ESTALE if it isn't; it
720+ may also return -ENOMEM and -ERESTARTSYS.
696721
697722To request an update of the index data for an index or other object, the
698723following function should be called:
0 commit comments