diff options
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 37 |
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 | ||
2040 | static const int nfs_set_port_min = 0; | ||
2041 | static const int nfs_set_port_max = 65535; | ||
2042 | static 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 | |||
2052 | module_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) | 2063 | static 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 | |||
2076 | static 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) |