aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/idmap.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2011-02-22 18:44:31 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-11 15:39:26 -0500
commite4fd72a17d2703cfd626c55893ac4ca7e7d81ce9 (patch)
tree6e605693b5dbd9369b6dfc1ccd83cebcacfe9dc1 /fs/nfs/idmap.c
parentf0b851689a5da2354f19bcbbac30cd2cab45c4a1 (diff)
NFSv4: cleanup idmapper functions to take an nfs_server argument
...instead of the nfs_client. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/idmap.c')
-rw-r--r--fs/nfs/idmap.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index 8518573c3ffc..e2d579d458f1 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -241,21 +241,21 @@ static int nfs_idmap_lookup_id(const char *name, size_t namelen,
241 return ret; 241 return ret;
242} 242}
243 243
244int nfs_map_name_to_uid(struct nfs_client *clp, const char *name, size_t namelen, __u32 *uid) 244int nfs_map_name_to_uid(const struct nfs_server *server, const char *name, size_t namelen, __u32 *uid)
245{ 245{
246 if (nfs_map_string_to_numeric(name, namelen, uid)) 246 if (nfs_map_string_to_numeric(name, namelen, uid))
247 return 0; 247 return 0;
248 return nfs_idmap_lookup_id(name, namelen, "uid", uid); 248 return nfs_idmap_lookup_id(name, namelen, "uid", uid);
249} 249}
250 250
251int nfs_map_group_to_gid(struct nfs_client *clp, const char *name, size_t namelen, __u32 *gid) 251int nfs_map_group_to_gid(const struct nfs_server *server, const char *name, size_t namelen, __u32 *gid)
252{ 252{
253 if (nfs_map_string_to_numeric(name, namelen, gid)) 253 if (nfs_map_string_to_numeric(name, namelen, gid))
254 return 0; 254 return 0;
255 return nfs_idmap_lookup_id(name, namelen, "gid", gid); 255 return nfs_idmap_lookup_id(name, namelen, "gid", gid);
256} 256}
257 257
258int nfs_map_uid_to_name(struct nfs_client *clp, __u32 uid, char *buf, size_t buflen) 258int nfs_map_uid_to_name(const struct nfs_server *server, __u32 uid, char *buf, size_t buflen)
259{ 259{
260 int ret; 260 int ret;
261 ret = nfs_idmap_lookup_name(uid, "user", buf, buflen); 261 ret = nfs_idmap_lookup_name(uid, "user", buf, buflen);
@@ -263,7 +263,7 @@ int nfs_map_uid_to_name(struct nfs_client *clp, __u32 uid, char *buf, size_t buf
263 ret = nfs_map_numeric_to_string(uid, buf, buflen); 263 ret = nfs_map_numeric_to_string(uid, buf, buflen);
264 return ret; 264 return ret;
265} 265}
266int nfs_map_gid_to_group(struct nfs_client *clp, __u32 gid, char *buf, size_t buflen) 266int nfs_map_gid_to_group(const struct nfs_server *server, __u32 gid, char *buf, size_t buflen)
267{ 267{
268 int ret; 268 int ret;
269 269
@@ -729,27 +729,27 @@ static unsigned int fnvhash32(const void *buf, size_t buflen)
729 return hash; 729 return hash;
730} 730}
731 731
732int nfs_map_name_to_uid(struct nfs_client *clp, const char *name, size_t namelen, __u32 *uid) 732int nfs_map_name_to_uid(const struct nfs_server *server, const char *name, size_t namelen, __u32 *uid)
733{ 733{
734 struct idmap *idmap = clp->cl_idmap; 734 struct idmap *idmap = server->nfs_client->cl_idmap;
735 735
736 if (nfs_map_string_to_numeric(name, namelen, uid)) 736 if (nfs_map_string_to_numeric(name, namelen, uid))
737 return 0; 737 return 0;
738 return nfs_idmap_id(idmap, &idmap->idmap_user_hash, name, namelen, uid); 738 return nfs_idmap_id(idmap, &idmap->idmap_user_hash, name, namelen, uid);
739} 739}
740 740
741int nfs_map_group_to_gid(struct nfs_client *clp, const char *name, size_t namelen, __u32 *uid) 741int nfs_map_group_to_gid(const struct nfs_server *server, const char *name, size_t namelen, __u32 *uid)
742{ 742{
743 struct idmap *idmap = clp->cl_idmap; 743 struct idmap *idmap = server->nfs_client->cl_idmap;
744 744
745 if (nfs_map_string_to_numeric(name, namelen, uid)) 745 if (nfs_map_string_to_numeric(name, namelen, uid))
746 return 0; 746 return 0;
747 return nfs_idmap_id(idmap, &idmap->idmap_group_hash, name, namelen, uid); 747 return nfs_idmap_id(idmap, &idmap->idmap_group_hash, name, namelen, uid);
748} 748}
749 749
750int nfs_map_uid_to_name(struct nfs_client *clp, __u32 uid, char *buf, size_t buflen) 750int nfs_map_uid_to_name(const struct nfs_server *server, __u32 uid, char *buf, size_t buflen)
751{ 751{
752 struct idmap *idmap = clp->cl_idmap; 752 struct idmap *idmap = server->nfs_client->cl_idmap;
753 int ret; 753 int ret;
754 754
755 ret = nfs_idmap_name(idmap, &idmap->idmap_user_hash, uid, buf); 755 ret = nfs_idmap_name(idmap, &idmap->idmap_user_hash, uid, buf);
@@ -757,9 +757,9 @@ int nfs_map_uid_to_name(struct nfs_client *clp, __u32 uid, char *buf, size_t buf
757 ret = nfs_map_numeric_to_string(uid, buf, buflen); 757 ret = nfs_map_numeric_to_string(uid, buf, buflen);
758 return ret; 758 return ret;
759} 759}
760int nfs_map_gid_to_group(struct nfs_client *clp, __u32 uid, char *buf, size_t buflen) 760int nfs_map_gid_to_group(const struct nfs_server *server, __u32 uid, char *buf, size_t buflen)
761{ 761{
762 struct idmap *idmap = clp->cl_idmap; 762 struct idmap *idmap = server->nfs_client->cl_idmap;
763 int ret; 763 int ret;
764 764
765 ret = nfs_idmap_name(idmap, &idmap->idmap_group_hash, uid, buf); 765 ret = nfs_idmap_name(idmap, &idmap->idmap_group_hash, uid, buf);