diff options
-rw-r--r-- | fs/nfs/callback.c | 15 | ||||
-rw-r--r-- | fs/nfs/idmap.c | 14 | ||||
-rw-r--r-- | fs/nfs/internal.h | 12 | ||||
-rw-r--r-- | fs/nfs/super.c | 40 |
4 files changed, 39 insertions, 42 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index fe0a6b8ac149..d6c4bae14bb9 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c | |||
@@ -36,6 +36,21 @@ static struct svc_program nfs4_callback_program; | |||
36 | 36 | ||
37 | unsigned int nfs_callback_set_tcpport; | 37 | unsigned int nfs_callback_set_tcpport; |
38 | unsigned short nfs_callback_tcpport; | 38 | unsigned short nfs_callback_tcpport; |
39 | static const int nfs_set_port_min = 0; | ||
40 | static const int nfs_set_port_max = 65535; | ||
41 | |||
42 | static int param_set_port(const char *val, struct kernel_param *kp) | ||
43 | { | ||
44 | char *endp; | ||
45 | int num = simple_strtol(val, &endp, 0); | ||
46 | if (endp == val || *endp || num < nfs_set_port_min || num > nfs_set_port_max) | ||
47 | return -EINVAL; | ||
48 | *((int *)kp->arg) = num; | ||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | module_param_call(callback_tcpport, param_set_port, param_get_int, | ||
53 | &nfs_callback_set_tcpport, 0644); | ||
39 | 54 | ||
40 | /* | 55 | /* |
41 | * This is the callback kernel thread. | 56 | * This is the callback kernel thread. |
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index 07a5dd57646e..873deb96a6cd 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c | |||
@@ -57,6 +57,20 @@ | |||
57 | /* Default cache timeout is 10 minutes */ | 57 | /* Default cache timeout is 10 minutes */ |
58 | unsigned int nfs_idmap_cache_timeout = 600 * HZ; | 58 | unsigned int nfs_idmap_cache_timeout = 600 * HZ; |
59 | 59 | ||
60 | static int param_set_idmap_timeout(const char *val, struct kernel_param *kp) | ||
61 | { | ||
62 | char *endp; | ||
63 | int num = simple_strtol(val, &endp, 0); | ||
64 | int jif = num * HZ; | ||
65 | if (endp == val || *endp || num < 0 || jif < num) | ||
66 | return -EINVAL; | ||
67 | *((int *)kp->arg) = jif; | ||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | module_param_call(idmap_cache_timeout, param_set_idmap_timeout, param_get_int, | ||
72 | &nfs_idmap_cache_timeout, 0644); | ||
73 | |||
60 | struct idmap_hashent { | 74 | struct idmap_hashent { |
61 | unsigned long ih_expires; | 75 | unsigned long ih_expires; |
62 | __u32 ih_id; | 76 | __u32 ih_id; |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 660e9ff5341c..4802157963f8 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -15,7 +15,7 @@ struct nfs_clone_mount { | |||
15 | rpc_authflavor_t authflavor; | 15 | rpc_authflavor_t authflavor; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | /* namespace-nfs4.c */ | 18 | /* nfs4namespace.c */ |
19 | #ifdef CONFIG_NFS_V4 | 19 | #ifdef CONFIG_NFS_V4 |
20 | extern struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, struct dentry *dentry); | 20 | extern struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, struct dentry *dentry); |
21 | #else | 21 | #else |
@@ -46,6 +46,7 @@ extern void nfs_destroy_directcache(void); | |||
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | /* nfs2xdr.c */ | 48 | /* nfs2xdr.c */ |
49 | extern int nfs_stat_to_errno(int); | ||
49 | extern struct rpc_procinfo nfs_procedures[]; | 50 | extern struct rpc_procinfo nfs_procedures[]; |
50 | extern u32 * nfs_decode_dirent(u32 *, struct nfs_entry *, int); | 51 | extern u32 * nfs_decode_dirent(u32 *, struct nfs_entry *, int); |
51 | 52 | ||
@@ -54,8 +55,9 @@ extern struct rpc_procinfo nfs3_procedures[]; | |||
54 | extern u32 *nfs3_decode_dirent(u32 *, struct nfs_entry *, int); | 55 | extern u32 *nfs3_decode_dirent(u32 *, struct nfs_entry *, int); |
55 | 56 | ||
56 | /* nfs4xdr.c */ | 57 | /* nfs4xdr.c */ |
57 | extern int nfs_stat_to_errno(int); | 58 | #ifdef CONFIG_NFS_V4 |
58 | extern u32 *nfs4_decode_dirent(u32 *p, struct nfs_entry *entry, int plus); | 59 | extern u32 *nfs4_decode_dirent(u32 *p, struct nfs_entry *entry, int plus); |
60 | #endif | ||
59 | 61 | ||
60 | /* nfs4proc.c */ | 62 | /* nfs4proc.c */ |
61 | #ifdef CONFIG_NFS_V4 | 63 | #ifdef CONFIG_NFS_V4 |
@@ -97,15 +99,13 @@ extern char *nfs_path(const char *base, const struct dentry *dentry, | |||
97 | /* | 99 | /* |
98 | * Determine the mount path as a string | 100 | * Determine the mount path as a string |
99 | */ | 101 | */ |
102 | #ifdef CONFIG_NFS_V4 | ||
100 | static inline char * | 103 | static inline char * |
101 | nfs4_path(const struct dentry *dentry, char *buffer, ssize_t buflen) | 104 | nfs4_path(const struct dentry *dentry, char *buffer, ssize_t buflen) |
102 | { | 105 | { |
103 | #ifdef CONFIG_NFS_V4 | ||
104 | return nfs_path(NFS_SB(dentry->d_sb)->mnt_path, dentry, buffer, buflen); | 106 | return nfs_path(NFS_SB(dentry->d_sb)->mnt_path, dentry, buffer, buflen); |
105 | #else | ||
106 | return NULL; | ||
107 | #endif | ||
108 | } | 107 | } |
108 | #endif | ||
109 | 109 | ||
110 | /* | 110 | /* |
111 | * Determine the device name as a string | 111 | * Determine the device name as a string |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 06c321beacfe..63497345806b 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -187,40 +187,6 @@ static struct super_operations nfs4_sops = { | |||
187 | }; | 187 | }; |
188 | #endif | 188 | #endif |
189 | 189 | ||
190 | #ifdef CONFIG_NFS_V4 | ||
191 | static const int nfs_set_port_min = 0; | ||
192 | static const int nfs_set_port_max = 65535; | ||
193 | |||
194 | static int param_set_port(const char *val, struct kernel_param *kp) | ||
195 | { | ||
196 | char *endp; | ||
197 | int num = simple_strtol(val, &endp, 0); | ||
198 | if (endp == val || *endp || num < nfs_set_port_min || num > nfs_set_port_max) | ||
199 | return -EINVAL; | ||
200 | *((int *)kp->arg) = num; | ||
201 | return 0; | ||
202 | } | ||
203 | |||
204 | module_param_call(callback_tcpport, param_set_port, param_get_int, | ||
205 | &nfs_callback_set_tcpport, 0644); | ||
206 | #endif | ||
207 | |||
208 | #ifdef CONFIG_NFS_V4 | ||
209 | static int param_set_idmap_timeout(const char *val, struct kernel_param *kp) | ||
210 | { | ||
211 | char *endp; | ||
212 | int num = simple_strtol(val, &endp, 0); | ||
213 | int jif = num * HZ; | ||
214 | if (endp == val || *endp || num < 0 || jif < num) | ||
215 | return -EINVAL; | ||
216 | *((int *)kp->arg) = jif; | ||
217 | return 0; | ||
218 | } | ||
219 | |||
220 | module_param_call(idmap_cache_timeout, param_set_idmap_timeout, param_get_int, | ||
221 | &nfs_idmap_cache_timeout, 0644); | ||
222 | #endif | ||
223 | |||
224 | static struct shrinker *acl_shrinker; | 190 | static struct shrinker *acl_shrinker; |
225 | 191 | ||
226 | /* | 192 | /* |
@@ -328,9 +294,12 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
328 | 294 | ||
329 | } | 295 | } |
330 | 296 | ||
297 | /* | ||
298 | * Map the security flavour number to a name | ||
299 | */ | ||
331 | static const char *nfs_pseudoflavour_to_name(rpc_authflavor_t flavour) | 300 | static const char *nfs_pseudoflavour_to_name(rpc_authflavor_t flavour) |
332 | { | 301 | { |
333 | static struct { | 302 | static const struct { |
334 | rpc_authflavor_t flavour; | 303 | rpc_authflavor_t flavour; |
335 | const char *str; | 304 | const char *str; |
336 | } sec_flavours[] = { | 305 | } sec_flavours[] = { |
@@ -1368,7 +1337,6 @@ static int nfs4_get_sb(struct file_system_type *fs_type, | |||
1368 | } | 1337 | } |
1369 | 1338 | ||
1370 | s = sget(fs_type, nfs4_compare_super, nfs_set_super, server); | 1339 | s = sget(fs_type, nfs4_compare_super, nfs_set_super, server); |
1371 | |||
1372 | if (IS_ERR(s)) { | 1340 | if (IS_ERR(s)) { |
1373 | error = PTR_ERR(s); | 1341 | error = PTR_ERR(s); |
1374 | goto out_free; | 1342 | goto out_free; |