Add CONFIG_NFS_V4_LOCALIO and CONFIG_NFSD_V4_LOCALIO to Kconfig. Extend nfs_common's nfsd_uuids list infrastructure to NFS v4. Also, nfs and nfsd will only build their respective localio.c if either NFS_V{3,4}_LOCALIO and/or either NFSD_V{3,4}_LOCALIO are enabled. Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx> --- fs/nfs/Kconfig | 14 +++++++++++++- fs/nfs/Makefile | 1 + fs/nfsd/Kconfig | 14 +++++++++++++- fs/nfsd/Makefile | 1 + fs/nfsd/netns.h | 2 +- fs/nfsd/nfssvc.c | 6 +++--- 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig index db8c9d6edcea..453ec4903086 100644 --- a/fs/nfs/Kconfig +++ b/fs/nfs/Kconfig @@ -5,7 +5,7 @@ config NFS_FS select LOCKD select SUNRPC select NFS_ACL_SUPPORT if NFS_V3_ACL - select NFS_LOCALIO_SUPPORT if NFS_V3_LOCALIO + select NFS_LOCALIO_SUPPORT if NFS_V3_LOCALIO || NFS_V4_LOCALIO help Choose Y here if you want to access files residing on other computers using Sun's Network File System protocol. To compile @@ -99,6 +99,18 @@ config NFS_V4 If unsure, say Y. +config NFS_V4_LOCALIO + bool "NFS client support for the NFSv4 LOCALIO protocol extension" + depends on NFS_V4 + help + Some NFS servers support an auxiliary NFSv4 LOCALIO protocol + that is not an official part of the NFS version 4 protocol. + + This option enables support for version 4 of the LOCALIO + protocol in the kernel's NFS client. + + If unsure, say N. + config NFS_SWAP bool "Provide swap over NFS support" default n diff --git a/fs/nfs/Makefile b/fs/nfs/Makefile index 7fed1ce375da..ad9923fb0f03 100644 --- a/fs/nfs/Makefile +++ b/fs/nfs/Makefile @@ -14,6 +14,7 @@ nfs-$(CONFIG_ROOT_NFS) += nfsroot.o nfs-$(CONFIG_SYSCTL) += sysctl.o nfs-$(CONFIG_NFS_FSCACHE) += fscache.o nfs-$(CONFIG_NFS_V3_LOCALIO) += localio.o +nfs-$(CONFIG_NFS_V4_LOCALIO) += localio.o obj-$(CONFIG_NFS_V2) += nfsv2.o nfsv2-y := nfs2super.o proc.o nfs2xdr.o diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig index c8eb7e2d4006..34d540324dfa 100644 --- a/fs/nfsd/Kconfig +++ b/fs/nfsd/Kconfig @@ -9,7 +9,7 @@ config NFSD select EXPORTFS select NFS_ACL_SUPPORT if NFSD_V2_ACL select NFS_ACL_SUPPORT if NFSD_V3_ACL - select NFS_LOCALIO_SUPPORT if NFSD_V3_LOCALIO + select NFS_LOCALIO_SUPPORT if NFSD_V3_LOCALIO || NFSD_V4_LOCALIO depends on MULTIUSER help Choose Y here if you want to allow other computers to access @@ -102,6 +102,18 @@ config NFSD_V4 If unsure, say N. +config NFSD_V4_LOCALIO + bool "NFS server support for the NFSv4 LOCALIO protocol extension" + depends on NFSD_V4 + help + Some NFS servers support an auxiliary NFSv4 LOCALIO protocol + that is not an official part of the NFS version 4 protocol. + + This option enables support for version 4 of the LOCALIO + protocol in the kernel's NFS server. + + If unsure, say N. + config NFSD_PNFS bool diff --git a/fs/nfsd/Makefile b/fs/nfsd/Makefile index 0e01749f6153..51d52fb0cd04 100644 --- a/fs/nfsd/Makefile +++ b/fs/nfsd/Makefile @@ -24,3 +24,4 @@ nfsd-$(CONFIG_NFSD_BLOCKLAYOUT) += blocklayout.o blocklayoutxdr.o nfsd-$(CONFIG_NFSD_SCSILAYOUT) += blocklayout.o blocklayoutxdr.o nfsd-$(CONFIG_NFSD_FLEXFILELAYOUT) += flexfilelayout.o flexfilelayoutxdr.o nfsd-$(CONFIG_NFSD_V3_LOCALIO) += localio.o +nfsd-$(CONFIG_NFSD_V4_LOCALIO) += localio.o diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h index 5c5f7030ad87..afeabe5c7613 100644 --- a/fs/nfsd/netns.h +++ b/fs/nfsd/netns.h @@ -214,7 +214,7 @@ struct nfsd_net { /* last time an admin-revoke happened for NFSv4.0 */ time64_t nfs40_last_revoke; -#if defined(CONFIG_NFSD_V3_LOCALIO) +#if defined(CONFIG_NFSD_V3_LOCALIO) || defined(CONFIG_NFSD_V4_LOCALIO) nfsd_uuid_t nfsd_uuid; #endif }; diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index c18ee0f56da4..fab699699869 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -466,7 +466,7 @@ static int nfsd_startup_net(struct net *net, const struct cred *cred) #ifdef CONFIG_NFSD_V4_2_INTER_SSC nfsd4_ssc_init_umount_work(nn); #endif -#if defined(CONFIG_NFSD_V3_LOCALIO) +#if defined(CONFIG_NFSD_V3_LOCALIO) || defined(CONFIG_NFSD_V4_LOCALIO) INIT_LIST_HEAD(&nn->nfsd_uuid.list); list_add_tail_rcu(&nn->nfsd_uuid.list, &nfsd_uuids); #endif @@ -499,7 +499,7 @@ static void nfsd_shutdown_net(struct net *net) nn->lockd_up = false; } nn->nfsd_net_up = false; -#if defined(CONFIG_NFSD_V3_LOCALIO) +#if defined(CONFIG_NFSD_V3_LOCALIO) || defined(CONFIG_NFSD_V4_LOCALIO) list_del_rcu(&nn->nfsd_uuid.list); #endif nfsd_shutdown_generic(); @@ -832,7 +832,7 @@ nfsd_svc(int nrservs, struct net *net, const struct cred *cred, const char *scop strscpy(nn->nfsd_name, scope ? scope : utsname()->nodename, sizeof(nn->nfsd_name)); -#if defined(CONFIG_NFSD_V3_LOCALIO) +#if defined(CONFIG_NFSD_V3_LOCALIO) || defined(CONFIG_NFSD_V4_LOCALIO) uuid_gen(&nn->nfsd_uuid.uuid); #endif -- 2.44.0