Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFSD: Add /sys/kernel/debug/nfsd

Create a small sandbox under /sys/kernel/debug for experimental NFS
server feature settings. There is no API/ABI compatibility guarantee
for these settings.

The only documentation for such settings, if any documentation exists,
is in the kernel source code.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

Chuck Lever 9fe5ea76 f7fb730c

+31
+1
fs/nfsd/Makefile
··· 24 24 nfsd-$(CONFIG_NFSD_SCSILAYOUT) += blocklayout.o blocklayoutxdr.o 25 25 nfsd-$(CONFIG_NFSD_FLEXFILELAYOUT) += flexfilelayout.o flexfilelayoutxdr.o 26 26 nfsd-$(CONFIG_NFS_LOCALIO) += localio.o 27 + nfsd-$(CONFIG_DEBUG_FS) += debugfs.o 27 28 28 29 29 30 .PHONY: xdrgen
+18
fs/nfsd/debugfs.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + 3 + #include <linux/debugfs.h> 4 + 5 + #include "nfsd.h" 6 + 7 + static struct dentry *nfsd_top_dir __read_mostly; 8 + 9 + void nfsd_debugfs_exit(void) 10 + { 11 + debugfs_remove_recursive(nfsd_top_dir); 12 + nfsd_top_dir = NULL; 13 + } 14 + 15 + void nfsd_debugfs_init(void) 16 + { 17 + nfsd_top_dir = debugfs_create_dir("nfsd", NULL); 18 + }
+4
fs/nfsd/nfsctl.c
··· 2281 2281 { 2282 2282 int retval; 2283 2283 2284 + nfsd_debugfs_init(); 2285 + 2284 2286 retval = nfsd4_init_slabs(); 2285 2287 if (retval) 2286 2288 return retval; ··· 2331 2329 nfsd4_exit_pnfs(); 2332 2330 out_free_slabs: 2333 2331 nfsd4_free_slabs(); 2332 + nfsd_debugfs_exit(); 2334 2333 return retval; 2335 2334 } 2336 2335 ··· 2348 2345 nfsd_lockd_shutdown(); 2349 2346 nfsd4_free_slabs(); 2350 2347 nfsd4_exit_pnfs(); 2348 + nfsd_debugfs_exit(); 2351 2349 } 2352 2350 2353 2351 MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>");
+8
fs/nfsd/nfsd.h
··· 156 156 int nfsd_create_serv(struct net *net); 157 157 void nfsd_destroy_serv(struct net *net); 158 158 159 + #ifdef CONFIG_DEBUG_FS 160 + void nfsd_debugfs_init(void); 161 + void nfsd_debugfs_exit(void); 162 + #else 163 + static inline void nfsd_debugfs_init(void) {} 164 + static inline void nfsd_debugfs_exit(void) {} 165 + #endif 166 + 159 167 extern int nfsd_max_blksize; 160 168 161 169 static inline int nfsd_v4client(struct svc_rqst *rq)