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

NFS: Keep module parameters in the generic NFS client

Otherwise we break backwards compatibility when v4 becomes a modules.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

authored by

Bryan Schumaker and committed by
Trond Myklebust
fac1e8e4 19d87ca3

+48 -49
-24
fs/nfs/callback.c
··· 37 37 static DEFINE_MUTEX(nfs_callback_mutex); 38 38 static struct svc_program nfs4_callback_program; 39 39 40 - unsigned int nfs_callback_set_tcpport; 41 - unsigned short nfs_callback_tcpport; 42 40 unsigned short nfs_callback_tcpport6; 43 - #define NFS_CALLBACK_MAXPORTNR (65535U) 44 - 45 - static int param_set_portnr(const char *val, const struct kernel_param *kp) 46 - { 47 - unsigned long num; 48 - int ret; 49 - 50 - if (!val) 51 - return -EINVAL; 52 - ret = strict_strtoul(val, 0, &num); 53 - if (ret == -EINVAL || num > NFS_CALLBACK_MAXPORTNR) 54 - return -EINVAL; 55 - *((unsigned int *)kp->arg) = num; 56 - return 0; 57 - } 58 - static struct kernel_param_ops param_ops_portnr = { 59 - .set = param_set_portnr, 60 - .get = param_get_uint, 61 - }; 62 - #define param_check_portnr(name, p) __param_check(name, p, unsigned int); 63 - 64 - module_param_named(callback_tcpport, nfs_callback_set_tcpport, portnr, 0644); 65 41 66 42 /* 67 43 * This is the NFSv4 callback kernel thread.
-3
fs/nfs/idmap.c
··· 52 52 53 53 #define NFS_UINT_MAXLEN 11 54 54 55 - /* Default cache timeout is 10 minutes */ 56 - unsigned int nfs_idmap_cache_timeout = 600; 57 55 static const struct cred *id_resolver_cache; 58 56 static struct key_type key_type_id_resolver_legacy; 59 57 ··· 364 366 } 365 367 366 368 /* idmap classic begins here */ 367 - module_param(nfs_idmap_cache_timeout, int, 0644); 368 369 369 370 enum { 370 371 Opt_find_uid, Opt_find_gid, Opt_find_user, Opt_find_group, Opt_find_err
+3 -1
fs/nfs/nfs4_fs.h
··· 367 367 struct dentry *nfs4_try_mount(int, const char *, struct nfs_mount_info *, struct nfs_subversion *); 368 368 int init_nfs_v4(void); 369 369 void exit_nfs_v4(void); 370 - 370 + extern bool nfs4_disable_idmapping; 371 + extern unsigned short max_session_slots; 372 + extern unsigned short send_implementation_id; 371 373 /* nfs4sysctl.c */ 372 374 #ifdef CONFIG_SYSCTL 373 375 int nfs4_register_sysctl(void);
-9
fs/nfs/nfs4client.c
··· 18 18 #define NFSDBG_FACILITY NFSDBG_CLIENT 19 19 20 20 /* 21 - * Turn off NFSv4 uid/gid mapping when using AUTH_SYS 22 - */ 23 - static bool nfs4_disable_idmapping = true; 24 - 25 - /* 26 21 * Get a unique NFSv4.0 callback identifier which will be used 27 22 * by the V4.0 callback service to lookup the nfs_client struct 28 23 */ ··· 654 659 dprintk("<-- nfs4_create_referral_server() = error %d\n", error); 655 660 return ERR_PTR(error); 656 661 } 657 - 658 - module_param(nfs4_disable_idmapping, bool, 0644); 659 - MODULE_PARM_DESC(nfs4_disable_idmapping, 660 - "Turn off NFSv4 idmapping when using 'sec=sys'");
-6
fs/nfs/nfs4proc.c
··· 72 72 73 73 #define NFS4_MAX_LOOP_ON_RECOVER (10) 74 74 75 - static unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE; 76 - 77 75 struct nfs4_opendata; 78 76 static int _nfs4_proc_open(struct nfs4_opendata *data); 79 77 static int _nfs4_recover_proc_open(struct nfs4_opendata *data); ··· 6929 6931 &nfs4_xattr_nfs4_acl_handler, 6930 6932 NULL 6931 6933 }; 6932 - 6933 - module_param(max_session_slots, ushort, 0644); 6934 - MODULE_PARM_DESC(max_session_slots, "Maximum number of outstanding NFSv4.1 " 6935 - "requests the client will negotiate"); 6936 6934 6937 6935 /* 6938 6936 * Local variables:
-6
fs/nfs/nfs4xdr.c
··· 852 852 XDR_UNIT); 853 853 #endif /* CONFIG_NFS_V4_1 */ 854 854 855 - static unsigned short send_implementation_id = 1; 856 - 857 - module_param(send_implementation_id, ushort, 0644); 858 - MODULE_PARM_DESC(send_implementation_id, 859 - "Send implementation ID with NFSv4.1 exchange_id"); 860 - 861 855 static const umode_t nfs_type2fmt[] = { 862 856 [NF4BAD] = 0, 863 857 [NF4REG] = S_IFREG,
+45
fs/nfs/super.c
··· 2574 2574 return -EINVAL; 2575 2575 } 2576 2576 2577 + /* 2578 + * NFS v4 module parameters need to stay in the 2579 + * NFS client for backwards compatibility 2580 + */ 2581 + unsigned int nfs_callback_set_tcpport; 2582 + unsigned short nfs_callback_tcpport; 2583 + /* Default cache timeout is 10 minutes */ 2584 + unsigned int nfs_idmap_cache_timeout = 600; 2585 + /* Turn off NFSv4 uid/gid mapping when using AUTH_SYS */ 2586 + bool nfs4_disable_idmapping = true; 2587 + unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE; 2588 + unsigned short send_implementation_id = 1; 2589 + 2590 + #define NFS_CALLBACK_MAXPORTNR (65535U) 2591 + 2592 + static int param_set_portnr(const char *val, const struct kernel_param *kp) 2593 + { 2594 + unsigned long num; 2595 + int ret; 2596 + 2597 + if (!val) 2598 + return -EINVAL; 2599 + ret = strict_strtoul(val, 0, &num); 2600 + if (ret == -EINVAL || num > NFS_CALLBACK_MAXPORTNR) 2601 + return -EINVAL; 2602 + *((unsigned int *)kp->arg) = num; 2603 + return 0; 2604 + } 2605 + static struct kernel_param_ops param_ops_portnr = { 2606 + .set = param_set_portnr, 2607 + .get = param_get_uint, 2608 + }; 2609 + #define param_check_portnr(name, p) __param_check(name, p, unsigned int); 2610 + 2611 + module_param_named(callback_tcpport, nfs_callback_set_tcpport, portnr, 0644); 2612 + module_param(nfs_idmap_cache_timeout, int, 0644); 2613 + module_param(nfs4_disable_idmapping, bool, 0644); 2614 + MODULE_PARM_DESC(nfs4_disable_idmapping, 2615 + "Turn off NFSv4 idmapping when using 'sec=sys'"); 2616 + module_param(max_session_slots, ushort, 0644); 2617 + MODULE_PARM_DESC(max_session_slots, "Maximum number of outstanding NFSv4.1 " 2618 + "requests the client will negotiate"); 2619 + module_param(send_implementation_id, ushort, 0644); 2620 + MODULE_PARM_DESC(send_implementation_id, 2621 + "Send implementation ID with NFSv4.1 exchange_id"); 2577 2622 #endif /* CONFIG_NFS_V4 */