aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/idmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/idmap.c')
-rw-r--r--fs/nfs/idmap.c66
1 files changed, 31 insertions, 35 deletions
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index e0ecd5a7e19a..83f7d42d5c76 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -39,6 +39,37 @@
39#include <linux/slab.h> 39#include <linux/slab.h>
40#include <linux/nfs_idmap.h> 40#include <linux/nfs_idmap.h>
41#include <linux/nfs_fs.h> 41#include <linux/nfs_fs.h>
42#include <linux/cred.h>
43#include <linux/sunrpc/sched.h>
44#include <linux/nfs4.h>
45#include <linux/nfs_fs_sb.h>
46#include <linux/keyctl.h>
47#include <linux/key-type.h>
48#include <linux/rcupdate.h>
49#include <linux/err.h>
50#include <keys/user-type.h>
51
52/* include files needed by legacy idmapper */
53#include <linux/module.h>
54#include <linux/mutex.h>
55#include <linux/init.h>
56#include <linux/socket.h>
57#include <linux/in.h>
58#include <linux/sched.h>
59#include <linux/sunrpc/clnt.h>
60#include <linux/workqueue.h>
61#include <linux/sunrpc/rpc_pipe_fs.h>
62#include <linux/nfs_fs.h>
63#include "nfs4_fs.h"
64#include "internal.h"
65
66#define NFS_UINT_MAXLEN 11
67#define IDMAP_HASH_SZ 128
68
69/* Default cache timeout is 10 minutes */
70unsigned int nfs_idmap_cache_timeout = 600 * HZ;
71const struct cred *id_resolver_cache;
72
42 73
43/** 74/**
44 * nfs_fattr_init_names - initialise the nfs_fattr owner_name/group_name fields 75 * nfs_fattr_init_names - initialise the nfs_fattr owner_name/group_name fields
@@ -142,21 +173,6 @@ static int nfs_map_numeric_to_string(__u32 id, char *buf, size_t buflen)
142 return snprintf(buf, buflen, "%u", id); 173 return snprintf(buf, buflen, "%u", id);
143} 174}
144 175
145#include <linux/cred.h>
146#include <linux/sunrpc/sched.h>
147#include <linux/nfs4.h>
148#include <linux/nfs_fs_sb.h>
149#include <linux/keyctl.h>
150#include <linux/key-type.h>
151#include <linux/rcupdate.h>
152#include <linux/err.h>
153
154#include <keys/user-type.h>
155
156#define NFS_UINT_MAXLEN 11
157
158const struct cred *id_resolver_cache;
159
160struct key_type key_type_id_resolver = { 176struct key_type key_type_id_resolver = {
161 .name = "id_resolver", 177 .name = "id_resolver",
162 .instantiate = user_instantiate, 178 .instantiate = user_instantiate,
@@ -327,26 +343,6 @@ static int nfs_idmap_lookup_id(const char *name, size_t namelen,
327} 343}
328 344
329/* idmap classic begins here */ 345/* idmap classic begins here */
330#include <linux/module.h>
331#include <linux/mutex.h>
332#include <linux/init.h>
333#include <linux/socket.h>
334#include <linux/in.h>
335#include <linux/sched.h>
336#include <linux/sunrpc/clnt.h>
337#include <linux/workqueue.h>
338#include <linux/sunrpc/rpc_pipe_fs.h>
339
340#include <linux/nfs_fs.h>
341
342#include "nfs4_fs.h"
343#include "internal.h"
344
345#define IDMAP_HASH_SZ 128
346
347/* Default cache timeout is 10 minutes */
348unsigned int nfs_idmap_cache_timeout = 600 * HZ;
349
350static int param_set_idmap_timeout(const char *val, struct kernel_param *kp) 346static int param_set_idmap_timeout(const char *val, struct kernel_param *kp)
351{ 347{
352 char *endp; 348 char *endp;