aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_idmap.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2013-02-01 06:21:47 -0500
committerEric W. Biederman <ebiederm@xmission.com>2013-02-13 09:15:29 -0500
commit9f309c86cf343c59c79d25d9bde5d4a895d2e81f (patch)
tree6be602b278f429a8c20795270305cb381615ccc6 /include/linux/nfs_idmap.h
parent54f834cd5501fb5fc801e4719a3ad0c894a3af2c (diff)
nfs: Convert idmap to use kuids and kgids
Convert nfs_map_name_to_uid to return a kuid_t value. Convert nfs_map_name_to_gid to return a kgid_t value. Convert nfs_map_uid_to_name to take a kuid_t paramater. Convert nfs_map_gid_to_name to take a kgid_t paramater. Tweak nfs_fattr_map_owner_to_name to use a kuid_t intermediate value. Tweak nfs_fattr_map_group_to_name to use a kgid_t intermediate value. Which makes these functions properly handle kuids and kgids, including erroring of the generated kuid or kgid is invalid. Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'include/linux/nfs_idmap.h')
-rw-r--r--include/linux/nfs_idmap.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h
index 2dcef3ab58b6..0f4b79da6584 100644
--- a/include/linux/nfs_idmap.h
+++ b/include/linux/nfs_idmap.h
@@ -36,6 +36,7 @@
36#ifndef NFS_IDMAP_H 36#ifndef NFS_IDMAP_H
37#define NFS_IDMAP_H 37#define NFS_IDMAP_H
38 38
39#include <linux/uidgid.h>
39#include <uapi/linux/nfs_idmap.h> 40#include <uapi/linux/nfs_idmap.h>
40 41
41 42
@@ -67,10 +68,10 @@ void nfs_fattr_init_names(struct nfs_fattr *fattr,
67void nfs_fattr_free_names(struct nfs_fattr *); 68void nfs_fattr_free_names(struct nfs_fattr *);
68void nfs_fattr_map_and_free_names(struct nfs_server *, struct nfs_fattr *); 69void nfs_fattr_map_and_free_names(struct nfs_server *, struct nfs_fattr *);
69 70
70int nfs_map_name_to_uid(const struct nfs_server *, const char *, size_t, __u32 *); 71int nfs_map_name_to_uid(const struct nfs_server *, const char *, size_t, kuid_t *);
71int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, __u32 *); 72int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, kgid_t *);
72int nfs_map_uid_to_name(const struct nfs_server *, __u32, char *, size_t); 73int nfs_map_uid_to_name(const struct nfs_server *, kuid_t, char *, size_t);
73int nfs_map_gid_to_group(const struct nfs_server *, __u32, char *, size_t); 74int nfs_map_gid_to_group(const struct nfs_server *, kgid_t, char *, size_t);
74 75
75extern unsigned int nfs_idmap_cache_timeout; 76extern unsigned int nfs_idmap_cache_timeout;
76#endif /* NFS_IDMAP_H */ 77#endif /* NFS_IDMAP_H */