aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2009-03-11 14:10:24 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-03-11 14:10:24 -0400
commit9e6e70f8d8b6698e0017c56b86525aabe9c7cd4c (patch)
tree3364c61dc3fdb1cc69b18e0cf16947abc49c0be5 /fs/nfs/nfs4xdr.c
parent78f945f88ef83dcc7c962614a080e0a9a2db5889 (diff)
NFSv4: Support NFSv4 optional attributes in the struct nfs_fattr
Currently, filling struct nfs_fattr is more or less an all or nothing operation, since NFSv2 and NFSv3 have only mandatory attributes. In NFSv4, some attributes are optional, and so we may simply not be able to fill in those fields. Furthermore, NFSv4 allows you to specify which attributes you are interested in retrieving, thus permitting you to optimise away retrieval of attributes that you know will no change... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 5f0ee3e2bd84..7d220da3db36 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -3012,7 +3012,7 @@ static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, cons
3012 if ((status = decode_attr_type(xdr, bitmap, &type)) != 0) 3012 if ((status = decode_attr_type(xdr, bitmap, &type)) != 0)
3013 goto xdr_error; 3013 goto xdr_error;
3014 fattr->type = nfs_type2fmt[type].nfs2type; 3014 fattr->type = nfs_type2fmt[type].nfs2type;
3015 fmode = nfs_type2fmt[type].mode; 3015 fattr->mode = nfs_type2fmt[type].mode;
3016 3016
3017 if ((status = decode_attr_change(xdr, bitmap, &fattr->change_attr)) != 0) 3017 if ((status = decode_attr_change(xdr, bitmap, &fattr->change_attr)) != 0)
3018 goto xdr_error; 3018 goto xdr_error;
@@ -3026,7 +3026,7 @@ static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, cons
3026 struct nfs4_fs_locations, 3026 struct nfs4_fs_locations,
3027 fattr))) != 0) 3027 fattr))) != 0)
3028 goto xdr_error; 3028 goto xdr_error;
3029 if ((status = decode_attr_mode(xdr, bitmap, &fattr->mode)) != 0) 3029 if ((status = decode_attr_mode(xdr, bitmap, &fmode)) != 0)
3030 goto xdr_error; 3030 goto xdr_error;
3031 fattr->mode |= fmode; 3031 fattr->mode |= fmode;
3032 if ((status = decode_attr_nlink(xdr, bitmap, &fattr->nlink)) != 0) 3032 if ((status = decode_attr_nlink(xdr, bitmap, &fattr->nlink)) != 0)
@@ -3050,7 +3050,7 @@ static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, cons
3050 if (fattr->fileid == 0 && fileid != 0) 3050 if (fattr->fileid == 0 && fileid != 0)
3051 fattr->fileid = fileid; 3051 fattr->fileid = fileid;
3052 if ((status = verify_attr_len(xdr, savep, attrlen)) == 0) 3052 if ((status = verify_attr_len(xdr, savep, attrlen)) == 0)
3053 fattr->valid = NFS_ATTR_FATTR | NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4; 3053 fattr->valid = NFS_ATTR_FATTR_V4;
3054xdr_error: 3054xdr_error:
3055 dprintk("%s: xdr returned %d\n", __func__, -status); 3055 dprintk("%s: xdr returned %d\n", __func__, -status);
3056 return status; 3056 return status;