diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2010-09-29 15:41:49 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-10-07 18:48:49 -0400 |
commit | 955a857e062642cd3ebe1dc7bb38c0f85d8f8f17 (patch) | |
tree | f95fc349c245c4a0a3f6f8fcc5bf02f36a756134 /fs/nfs/nfs4xdr.c | |
parent | aa510da5bfe1dfe263215fd0e05dac96e738a782 (diff) |
NFS: new idmapper
This patch creates a new idmapper system that uses the request-key function to
place a call into userspace to map user and group ids to names. The old
idmapper was single threaded, which prevented more than one request from running
at a single time. This means that a user would have to wait for an upcall to
finish before accessing a cached result.
The upcall result is stored on a keyring of type id_resolver. See the file
Documentation/filesystems/nfs/idmapper.txt for instructions.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
[Trond: fix up the return value of nfs_idmap_lookup_name and clean up code]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 3feace66b981..6ea5c9392fe4 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -816,7 +816,7 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const | |||
816 | if (iap->ia_valid & ATTR_MODE) | 816 | if (iap->ia_valid & ATTR_MODE) |
817 | len += 4; | 817 | len += 4; |
818 | if (iap->ia_valid & ATTR_UID) { | 818 | if (iap->ia_valid & ATTR_UID) { |
819 | owner_namelen = nfs_map_uid_to_name(server->nfs_client, iap->ia_uid, owner_name); | 819 | owner_namelen = nfs_map_uid_to_name(server->nfs_client, iap->ia_uid, owner_name, IDMAP_NAMESZ); |
820 | if (owner_namelen < 0) { | 820 | if (owner_namelen < 0) { |
821 | dprintk("nfs: couldn't resolve uid %d to string\n", | 821 | dprintk("nfs: couldn't resolve uid %d to string\n", |
822 | iap->ia_uid); | 822 | iap->ia_uid); |
@@ -828,7 +828,7 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const | |||
828 | len += 4 + (XDR_QUADLEN(owner_namelen) << 2); | 828 | len += 4 + (XDR_QUADLEN(owner_namelen) << 2); |
829 | } | 829 | } |
830 | if (iap->ia_valid & ATTR_GID) { | 830 | if (iap->ia_valid & ATTR_GID) { |
831 | owner_grouplen = nfs_map_gid_to_group(server->nfs_client, iap->ia_gid, owner_group); | 831 | owner_grouplen = nfs_map_gid_to_group(server->nfs_client, iap->ia_gid, owner_group, IDMAP_NAMESZ); |
832 | if (owner_grouplen < 0) { | 832 | if (owner_grouplen < 0) { |
833 | dprintk("nfs: couldn't resolve gid %d to string\n", | 833 | dprintk("nfs: couldn't resolve gid %d to string\n", |
834 | iap->ia_gid); | 834 | iap->ia_gid); |