Gitweb: http://git.kernel.org/linus/ccc4fc3d11e91477036d1f82bfa2d442f6ce77f0
Commit: ccc4fc3d11e91477036d1f82bfa2d442f6ce77f0
Parent: 36c9559022850f919269564a74bf17fdabf4bb30
Author: David Howells <dhowells@redhat.com>
AuthorDate: Fri Apr 3 16:42:38 2009 +0100
Committer: David Howells <dhowells@redhat.com>
CommitDate: Fri Apr 3 16:42:38 2009 +0100
FS-Cache: Implement the cookie management part of the netfs API
Implement the cookie management part of the FS-Cache netfs client API. The
documentation and API header file were added in a previous patch.
This patch implements the following three functions:
(1) fscache_acquire_cookie().
Acquire a cookie to represent an object to the netfs. If the object in
question is a non-index object, then that object and its parent indices
will be created on disk at this point if they don't already exist. Index
creation is deferred because an index may reside in multiple caches.
(2) fscache_relinquish_cookie().
Retire or release a cookie previously acquired. At this point, the
object on disk may be destroyed.
(3) fscache_update_cookie().
Update the in-cache representation of a cookie. This is used to update
the auxiliary data for coherency management purposes.
With this patch it is possible to have a netfs instruct a cache backend to
look up, validate and create metadata on disk and to destroy it again.
The ability to actually store and retrieve data in the objects so created is
added in later patches.
Note that these functions will never return an error. _All_ errors are
handled internally to FS-Cache.
The worst that can happen is that fscache_acquire_cookie() may return a NULL
pointer - which is considered a negative cookie pointer and can be passed back
to any function that takes a cookie without harm. A negative cookie ...