aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/inode.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-01-03 03:55:41 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-01-06 14:58:52 -0500
commita72b44222d222749d54b3e370d825094352e389f (patch)
treed64815b696d207927a4154a2cbc649552708c6f2 /fs/nfs/inode.c
parenta895b4a198dd06f8353328867e4f6cfd28b63081 (diff)
NFSv4: Allow user to set the port used by the NFSv4 callback channel
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r--fs/nfs/inode.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 7270b1d73d30..648cb1aef3b1 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -40,6 +40,7 @@
40#include <asm/uaccess.h> 40#include <asm/uaccess.h>
41 41
42#include "nfs4_fs.h" 42#include "nfs4_fs.h"
43#include "callback.h"
43#include "delegation.h" 44#include "delegation.h"
44 45
45#define NFSDBG_FACILITY NFSDBG_VFS 46#define NFSDBG_FACILITY NFSDBG_VFS
@@ -2036,6 +2037,21 @@ static struct file_system_type nfs4_fs_type = {
2036 .fs_flags = FS_ODD_RENAME|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, 2037 .fs_flags = FS_ODD_RENAME|FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
2037}; 2038};
2038 2039
2040static const int nfs_set_port_min = 0;
2041static const int nfs_set_port_max = 65535;
2042static int param_set_port(const char *val, struct kernel_param *kp)
2043{
2044 char *endp;
2045 int num = simple_strtol(val, &endp, 0);
2046 if (endp == val || *endp || num < nfs_set_port_min || num > nfs_set_port_max)
2047 return -EINVAL;
2048 *((int *)kp->arg) = num;
2049 return 0;
2050}
2051
2052module_param_call(callback_tcpport, param_set_port, param_get_int,
2053 &nfs_callback_set_tcpport, 0644);
2054
2039#define nfs4_init_once(nfsi) \ 2055#define nfs4_init_once(nfsi) \
2040 do { \ 2056 do { \
2041 INIT_LIST_HEAD(&(nfsi)->open_states); \ 2057 INIT_LIST_HEAD(&(nfsi)->open_states); \
@@ -2043,8 +2059,25 @@ static struct file_system_type nfs4_fs_type = {
2043 nfsi->delegation_state = 0; \ 2059 nfsi->delegation_state = 0; \
2044 init_rwsem(&nfsi->rwsem); \ 2060 init_rwsem(&nfsi->rwsem); \
2045 } while(0) 2061 } while(0)
2046#define register_nfs4fs() register_filesystem(&nfs4_fs_type) 2062
2047#define unregister_nfs4fs() unregister_filesystem(&nfs4_fs_type) 2063static inline int register_nfs4fs(void)
2064{
2065 int ret;
2066
2067 ret = nfs_register_sysctl();
2068 if (ret != 0)
2069 return ret;
2070 ret = register_filesystem(&nfs4_fs_type);
2071 if (ret != 0)
2072 nfs_unregister_sysctl();
2073 return ret;
2074}
2075
2076static inline void unregister_nfs4fs(void)
2077{
2078 unregister_filesystem(&nfs4_fs_type);
2079 nfs_unregister_sysctl();
2080}
2048#else 2081#else
2049#define nfs4_init_once(nfsi) \ 2082#define nfs4_init_once(nfsi) \
2050 do { } while (0) 2083 do { } while (0)