mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-30 23:54:04 +08:00
a6b5a28eb5
Change the nfs filesystem to support fscache's indexing rewrite and reenable caching in nfs. The following changes have been made: (1) The fscache_netfs struct is no more, and there's no need to register the filesystem as a whole. (2) The session cookie is now an fscache_volume cookie, allocated with fscache_acquire_volume(). That takes three parameters: a string representing the "volume" in the index, a string naming the cache to use (or NULL) and a u64 that conveys coherency metadata for the volume. For nfs, I've made it render the volume name string as: "nfs,<ver>,<family>,<address>,<port>,<fsidH>,<fsidL>*<,param>[,<uniq>]" (3) The fscache_cookie_def is no more and needed information is passed directly to fscache_acquire_cookie(). The cache no longer calls back into the filesystem, but rather metadata changes are indicated at other times. fscache_acquire_cookie() is passed the same keying and coherency information as before. (4) fscache_enable/disable_cookie() have been removed. Call fscache_use_cookie() and fscache_unuse_cookie() when a file is opened or closed to prevent a cache file from being culled and to keep resources to hand that are needed to do I/O. If a file is opened for writing, we invalidate it with FSCACHE_INVAL_DIO_WRITE in lieu of doing writeback to the cache, thereby making it cease caching until all currently open files are closed. This should give the same behaviour as the uptream code. Making the cache store local modifications isn't straightforward for NFS, so that's left for future patches. (5) fscache_invalidate() now needs to be given uptodate auxiliary data and a file size. It also takes a flag to indicate if this was due to a DIO write. (6) Call nfs_fscache_invalidate() with FSCACHE_INVAL_DIO_WRITE on a file to which a DIO write is made. (7) Call fscache_note_page_release() from nfs_release_page(). (8) Use a killable wait in nfs_vm_page_mkwrite() when waiting for PG_fscache to be cleared. (9) The functions to read and write data to/from the cache are stubbed out pending a conversion to use netfslib. Changes ======= ver #3: - Added missing =n fallback for nfs_fscache_release_file()[1][2]. ver #2: - Use gfpflags_allow_blocking() rather than using flag directly. - fscache_acquire_volume() now returns errors. - Remove NFS_INO_FSCACHE as it's no longer used. - Need to unuse a cookie on file-release, not inode-clear. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> Co-developed-by: David Howells <dhowells@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com> Acked-by: Jeff Layton <jlayton@kernel.org> cc: Trond Myklebust <trond.myklebust@hammerspace.com> cc: Anna Schumaker <anna.schumaker@netapp.com> cc: linux-nfs@vger.kernel.org cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/202112100804.nksO8K4u-lkp@intel.com/ [1] Link: https://lore.kernel.org/r/202112100957.2oEDT20W-lkp@intel.com/ [2] Link: https://lore.kernel.org/r/163819668938.215744.14448852181937731615.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906979003.143852.2601189243864854724.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967182112.1823006.7791504655391213379.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021575950.640689.12069642327533368467.stgit@warthog.procyon.org.uk/ # v4
38 lines
1.3 KiB
Makefile
38 lines
1.3 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for the Linux nfs filesystem routines.
|
|
#
|
|
|
|
obj-$(CONFIG_NFS_FS) += nfs.o
|
|
|
|
CFLAGS_nfstrace.o += -I$(src)
|
|
nfs-y := client.o dir.o file.o getroot.o inode.o super.o \
|
|
io.o direct.o pagelist.o read.o symlink.o unlink.o \
|
|
write.o namespace.o mount_clnt.o nfstrace.o \
|
|
export.o sysfs.o fs_context.o
|
|
nfs-$(CONFIG_ROOT_NFS) += nfsroot.o
|
|
nfs-$(CONFIG_SYSCTL) += sysctl.o
|
|
nfs-$(CONFIG_NFS_FSCACHE) += fscache.o
|
|
|
|
obj-$(CONFIG_NFS_V2) += nfsv2.o
|
|
nfsv2-y := nfs2super.o proc.o nfs2xdr.o
|
|
|
|
obj-$(CONFIG_NFS_V3) += nfsv3.o
|
|
nfsv3-y := nfs3super.o nfs3client.o nfs3proc.o nfs3xdr.o
|
|
nfsv3-$(CONFIG_NFS_V3_ACL) += nfs3acl.o
|
|
|
|
obj-$(CONFIG_NFS_V4) += nfsv4.o
|
|
CFLAGS_nfs4trace.o += -I$(src)
|
|
nfsv4-y := nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o nfs4super.o nfs4file.o \
|
|
delegation.o nfs4idmap.o callback.o callback_xdr.o callback_proc.o \
|
|
nfs4namespace.o nfs4getroot.o nfs4client.o nfs4session.o \
|
|
dns_resolve.o nfs4trace.o
|
|
nfsv4-$(CONFIG_NFS_USE_LEGACY_DNS) += cache_lib.o
|
|
nfsv4-$(CONFIG_SYSCTL) += nfs4sysctl.o
|
|
nfsv4-$(CONFIG_NFS_V4_1) += pnfs.o pnfs_dev.o pnfs_nfs.o
|
|
nfsv4-$(CONFIG_NFS_V4_2) += nfs42proc.o nfs42xattr.o
|
|
|
|
obj-$(CONFIG_PNFS_FILE_LAYOUT) += filelayout/
|
|
obj-$(CONFIG_PNFS_BLOCK) += blocklayout/
|
|
obj-$(CONFIG_PNFS_FLEXFILE_LAYOUT) += flexfilelayout/
|