mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00: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
217 lines
6.4 KiB
Plaintext
217 lines
6.4 KiB
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
config NFS_FS
|
|
tristate "NFS client support"
|
|
depends on INET && FILE_LOCKING && MULTIUSER
|
|
select LOCKD
|
|
select SUNRPC
|
|
select NFS_ACL_SUPPORT if NFS_V3_ACL
|
|
help
|
|
Choose Y here if you want to access files residing on other
|
|
computers using Sun's Network File System protocol. To compile
|
|
this file system support as a module, choose M here: the module
|
|
will be called nfs.
|
|
|
|
To mount file systems exported by NFS servers, you also need to
|
|
install the user space mount.nfs command which can be found in
|
|
the Linux nfs-utils package, available from http://linux-nfs.org/.
|
|
Information about using the mount command is available in the
|
|
mount(8) man page. More detail about the Linux NFS client
|
|
implementation is available via the nfs(5) man page.
|
|
|
|
Below you can choose which versions of the NFS protocol are
|
|
available in the kernel to mount NFS servers. Support for NFS
|
|
version 2 (RFC 1094) is always available when NFS_FS is selected.
|
|
|
|
To configure a system which mounts its root file system via NFS
|
|
at boot time, say Y here, select "Kernel level IP
|
|
autoconfiguration" in the NETWORK menu, and select "Root file
|
|
system on NFS" below. You cannot compile this file system as a
|
|
module in this case.
|
|
|
|
If unsure, say N.
|
|
|
|
config NFS_V2
|
|
tristate "NFS client support for NFS version 2"
|
|
depends on NFS_FS
|
|
default y
|
|
help
|
|
This option enables support for version 2 of the NFS protocol
|
|
(RFC 1094) in the kernel's NFS client.
|
|
|
|
If unsure, say Y.
|
|
|
|
config NFS_V3
|
|
tristate "NFS client support for NFS version 3"
|
|
depends on NFS_FS
|
|
default y
|
|
help
|
|
This option enables support for version 3 of the NFS protocol
|
|
(RFC 1813) in the kernel's NFS client.
|
|
|
|
If unsure, say Y.
|
|
|
|
config NFS_V3_ACL
|
|
bool "NFS client support for the NFSv3 ACL protocol extension"
|
|
depends on NFS_V3
|
|
help
|
|
Some NFS servers support an auxiliary NFSv3 ACL protocol that
|
|
Sun added to Solaris but never became an official part of the
|
|
NFS version 3 protocol. This protocol extension allows
|
|
applications on NFS clients to manipulate POSIX Access Control
|
|
Lists on files residing on NFS servers. NFS servers enforce
|
|
ACLs on local files whether this protocol is available or not.
|
|
|
|
Choose Y here if your NFS server supports the Solaris NFSv3 ACL
|
|
protocol extension and you want your NFS client to allow
|
|
applications to access and modify ACLs on files on the server.
|
|
|
|
Most NFS servers don't support the Solaris NFSv3 ACL protocol
|
|
extension. You can choose N here or specify the "noacl" mount
|
|
option to prevent your NFS client from trying to use the NFSv3
|
|
ACL protocol.
|
|
|
|
If unsure, say N.
|
|
|
|
config NFS_V4
|
|
tristate "NFS client support for NFS version 4"
|
|
depends on NFS_FS
|
|
select SUNRPC_GSS
|
|
select KEYS
|
|
help
|
|
This option enables support for version 4 of the NFS protocol
|
|
(RFC 3530) in the kernel's NFS client.
|
|
|
|
To mount NFS servers using NFSv4, you also need to install user
|
|
space programs which can be found in the Linux nfs-utils package,
|
|
available from http://linux-nfs.org/.
|
|
|
|
If unsure, say Y.
|
|
|
|
config NFS_SWAP
|
|
bool "Provide swap over NFS support"
|
|
default n
|
|
depends on NFS_FS && SWAP
|
|
select SUNRPC_SWAP
|
|
help
|
|
This option enables swapon to work on files located on NFS mounts.
|
|
|
|
config NFS_V4_1
|
|
bool "NFS client support for NFSv4.1"
|
|
depends on NFS_V4
|
|
select SUNRPC_BACKCHANNEL
|
|
help
|
|
This option enables support for minor version 1 of the NFSv4 protocol
|
|
(RFC 5661) in the kernel's NFS client.
|
|
|
|
If unsure, say N.
|
|
|
|
config NFS_V4_2
|
|
bool "NFS client support for NFSv4.2"
|
|
depends on NFS_V4_1
|
|
help
|
|
This option enables support for minor version 2 of the NFSv4 protocol
|
|
in the kernel's NFS client.
|
|
|
|
If unsure, say N.
|
|
|
|
config PNFS_FILE_LAYOUT
|
|
tristate
|
|
depends on NFS_V4_1
|
|
default NFS_V4
|
|
|
|
config PNFS_BLOCK
|
|
tristate
|
|
depends on NFS_V4_1 && BLK_DEV_DM
|
|
default NFS_V4
|
|
|
|
config PNFS_FLEXFILE_LAYOUT
|
|
tristate
|
|
depends on NFS_V4_1 && NFS_V3
|
|
default NFS_V4
|
|
|
|
config NFS_V4_1_IMPLEMENTATION_ID_DOMAIN
|
|
string "NFSv4.1 Implementation ID Domain"
|
|
depends on NFS_V4_1
|
|
default "kernel.org"
|
|
help
|
|
This option defines the domain portion of the implementation ID that
|
|
may be sent in the NFS exchange_id operation. The value must be in
|
|
the format of a DNS domain name and should be set to the DNS domain
|
|
name of the distribution.
|
|
If the NFS client is unchanged from the upstream kernel, this
|
|
option should be set to the default "kernel.org".
|
|
|
|
config NFS_V4_1_MIGRATION
|
|
bool "NFSv4.1 client support for migration"
|
|
depends on NFS_V4_1
|
|
default n
|
|
help
|
|
This option makes the NFS client advertise to NFSv4.1 servers that
|
|
it can support NFSv4 migration.
|
|
|
|
The NFSv4.1 pieces of the Linux NFSv4 migration implementation are
|
|
still experimental. If you are not an NFSv4 developer, say N here.
|
|
|
|
config NFS_V4_SECURITY_LABEL
|
|
bool
|
|
depends on NFS_V4_2 && SECURITY
|
|
default y
|
|
|
|
config ROOT_NFS
|
|
bool "Root file system on NFS"
|
|
depends on NFS_FS=y && IP_PNP
|
|
help
|
|
If you want your system to mount its root file system via NFS,
|
|
choose Y here. This is common practice for managing systems
|
|
without local permanent storage. For details, read
|
|
<file:Documentation/admin-guide/nfs/nfsroot.rst>.
|
|
|
|
Most people say N here.
|
|
|
|
config NFS_FSCACHE
|
|
bool "Provide NFS client caching support"
|
|
depends on NFS_FS=m && FSCACHE || NFS_FS=y && FSCACHE=y
|
|
help
|
|
Say Y here if you want NFS data to be cached locally on disc through
|
|
the general filesystem cache manager
|
|
|
|
config NFS_USE_LEGACY_DNS
|
|
bool "Use the legacy NFS DNS resolver"
|
|
depends on NFS_V4
|
|
help
|
|
The kernel now provides a method for translating a host name into an
|
|
IP address. Select Y here if you would rather use your own DNS
|
|
resolver script.
|
|
|
|
If unsure, say N
|
|
|
|
config NFS_USE_KERNEL_DNS
|
|
bool
|
|
depends on NFS_V4 && !NFS_USE_LEGACY_DNS
|
|
select DNS_RESOLVER
|
|
default y
|
|
|
|
config NFS_DEBUG
|
|
bool
|
|
depends on NFS_FS && SUNRPC_DEBUG
|
|
select CRC32
|
|
default y
|
|
|
|
config NFS_DISABLE_UDP_SUPPORT
|
|
bool "NFS: Disable NFS UDP protocol support"
|
|
depends on NFS_FS
|
|
default y
|
|
help
|
|
Choose Y here to disable the use of NFS over UDP. NFS over UDP
|
|
on modern networks (1Gb+) can lead to data corruption caused by
|
|
fragmentation during high loads.
|
|
|
|
config NFS_V4_2_READ_PLUS
|
|
bool "NFS: Enable support for the NFSv4.2 READ_PLUS operation"
|
|
depends on NFS_V4_2
|
|
default n
|
|
help
|
|
This is intended for developers only. The READ_PLUS operation has
|
|
been shown to have issues under specific conditions and should not
|
|
be used in production.
|