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

NFS: Enabling v4.2 should not recompile nfsd and lockd

When CONFIG_NFS_V4_2 is toggled nfsd and lockd will be recompiled,
instead of only the nfs client. This patch moves a small amount of code
into the client directory to avoid unnecessary recompiles.

Signed-off-by: Anna Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

authored by

Anna Schumaker and committed by
Trond Myklebust
694e096f 8c2fabc6

+26 -28
+1
fs/nfs/blocklayout/blocklayout.h
··· 36 36 #include <linux/nfs_fs.h> 37 37 #include <linux/sunrpc/rpc_pipe_fs.h> 38 38 39 + #include "../nfs4_fs.h" 39 40 #include "../pnfs.h" 40 41 #include "../netns.h" 41 42
+2
fs/nfs/dns_resolve.c
··· 46 46 #include <linux/sunrpc/cache.h> 47 47 #include <linux/sunrpc/svcauth.h> 48 48 #include <linux/sunrpc/rpc_pipe_fs.h> 49 + #include <linux/nfs_fs.h> 49 50 51 + #include "nfs4_fs.h" 50 52 #include "dns_resolve.h" 51 53 #include "cache_lib.h" 52 54 #include "netns.h"
+15
fs/nfs/internal.h
··· 269 269 extern struct rpc_procinfo nfs4_procedures[]; 270 270 #endif 271 271 272 + #ifdef CONFIG_NFS_V4_SECURITY_LABEL 273 + extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); 274 + static inline void nfs4_label_free(struct nfs4_label *label) 275 + { 276 + if (label) { 277 + kfree(label->label); 278 + kfree(label); 279 + } 280 + return; 281 + } 282 + #else 283 + static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } 284 + static inline void nfs4_label_free(void *label) {} 285 + #endif /* CONFIG_NFS_V4_SECURITY_LABEL */ 286 + 272 287 /* proc.c */ 273 288 void nfs_close_context(struct nfs_open_context *ctx, int is_sync); 274 289 extern struct nfs_client *nfs_init_client(struct nfs_client *clp,
+8
fs/nfs/nfs4_fs.h
··· 9 9 #ifndef __LINUX_FS_NFS_NFS4_FS_H 10 10 #define __LINUX_FS_NFS_NFS4_FS_H 11 11 12 + #if defined(CONFIG_NFS_V4_2) 13 + #define NFS4_MAX_MINOR_VERSION 2 14 + #elif defined(CONFIG_NFS_V4_1) 15 + #define NFS4_MAX_MINOR_VERSION 1 16 + #else 17 + #define NFS4_MAX_MINOR_VERSION 0 18 + #endif 19 + 12 20 #if IS_ENABLED(CONFIG_NFS_V4) 13 21 14 22 #define NFS4_MAX_LOOP_ON_RECOVER (10)
-10
include/linux/nfs4.h
··· 410 410 #define NFS4_VERSION 4 411 411 #define NFS4_MINOR_VERSION 0 412 412 413 - #if defined(CONFIG_NFS_V4_2) 414 - #define NFS4_MAX_MINOR_VERSION 2 415 - #else 416 - #if defined(CONFIG_NFS_V4_1) 417 - #define NFS4_MAX_MINOR_VERSION 1 418 - #else 419 - #define NFS4_MAX_MINOR_VERSION 0 420 - #endif /* CONFIG_NFS_V4_1 */ 421 - #endif /* CONFIG_NFS_V4_2 */ 422 - 423 413 #define NFS4_DEBUG 1 424 414 425 415 /* Index of predefined Linux client operations */
-18
include/linux/nfs_fs.h
··· 507 507 extern void nfs_release_automount_timer(void); 508 508 509 509 /* 510 - * linux/fs/nfs/nfs4proc.c 511 - */ 512 - #ifdef CONFIG_NFS_V4_SECURITY_LABEL 513 - extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); 514 - static inline void nfs4_label_free(struct nfs4_label *label) 515 - { 516 - if (label) { 517 - kfree(label->label); 518 - kfree(label); 519 - } 520 - return; 521 - } 522 - #else 523 - static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } 524 - static inline void nfs4_label_free(void *label) {} 525 - #endif 526 - 527 - /* 528 510 * linux/fs/nfs/unlink.c 529 511 */ 530 512 extern void nfs_complete_unlink(struct dentry *dentry, struct inode *);