]> git.baikalelectronics.ru Git - kernel.git/commit
fscache: Attach the index key and aux data to the cookie
authorDavid Howells <dhowells@redhat.com>
Wed, 4 Apr 2018 12:41:28 +0000 (13:41 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 4 Apr 2018 12:41:28 +0000 (13:41 +0100)
commit43d826a924fce585901e6fb66916cdd05718f40a
tree83cdb77f5490a0990eade886aa7f8dd087864996
parentecffb099770fc53b4c9801ace565aa085500194d
fscache: Attach the index key and aux data to the cookie

Attach copies of the index key and auxiliary data to the fscache cookie so
that:

 (1) The callbacks to the netfs for this stuff can be eliminated.  This
     can simplify things in the cache as the information is still
     available, even after the cache has relinquished the cookie.

 (2) Simplifies the locking requirements of accessing the information as we
     don't have to worry about the netfs object going away on us.

 (3) The cache can do lazy updating of the coherency information on disk.
     As long as the cache is flushed before reboot/poweroff, there's no
     need to update the coherency info on disk every time it changes.

 (4) Cookies can be hashed or put in a tree as the index key is easily
     available.  This allows:

     (a) Checks for duplicate cookies can be made at the top fscache layer
       rather than down in the bowels of the cache backend.

     (b) Caching can be added to a netfs object that has a cookie if the
       cache is brought online after the netfs object is allocated.

A certain amount of space is made in the cookie for inline copies of the
data, but if it won't fit there, extra memory will be allocated for it.

The downside of this is that live cache operation requires more memory.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Anna Schumaker <anna.schumaker@netapp.com>
Tested-by: Steve Dickson <steved@redhat.com>
26 files changed:
Documentation/filesystems/caching/netfs-api.txt
fs/9p/cache.c
fs/afs/cache.c
fs/afs/cell.c
fs/afs/inode.c
fs/afs/internal.h
fs/afs/volume.c
fs/cachefiles/interface.c
fs/cachefiles/namei.c
fs/cachefiles/xattr.c
fs/ceph/cache.c
fs/cifs/cache.c
fs/cifs/fscache.c
fs/cifs/fscache.h
fs/fscache/cache.c
fs/fscache/cookie.c
fs/fscache/fsdef.c
fs/fscache/internal.h
fs/fscache/netfs.c
fs/fscache/object-list.c
fs/fscache/object.c
fs/fscache/operation.c
fs/nfs/fscache-index.c
fs/nfs/fscache.c
fs/nfs/fscache.h
include/linux/fscache.h