diff options
author | Manoj Naik <manoj@almaden.ibm.com> | 2006-06-09 09:34:24 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-09 09:34:24 -0400 |
commit | 99baf625d3b9b8944920acc7c2d06079a37458c5 (patch) | |
tree | 2878013e4a44562502fe18ce4ecff0cd0dcaf4ec /fs | |
parent | 7aaa0b3bd4d215d9ce4d62b6c2043a63ba650f93 (diff) |
NFSv4: Decode mounted_on_fileid attribute in getattr.
It is ignored if fileid is also requested. This will be used on referrals
(fs_locations).
Signed-off-by: Manoj Naik <manoj@almaden.ibm.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index f6a1ea7df374..4b6613f61341 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -2326,6 +2326,22 @@ static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t | |||
2326 | return 0; | 2326 | return 0; |
2327 | } | 2327 | } |
2328 | 2328 | ||
2329 | static int decode_attr_mounted_on_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid) | ||
2330 | { | ||
2331 | uint32_t *p; | ||
2332 | |||
2333 | *fileid = 0; | ||
2334 | if (unlikely(bitmap[1] & (FATTR4_WORD1_MOUNTED_ON_FILEID - 1U))) | ||
2335 | return -EIO; | ||
2336 | if (likely(bitmap[1] & FATTR4_WORD1_MOUNTED_ON_FILEID)) { | ||
2337 | READ_BUF(8); | ||
2338 | READ64(*fileid); | ||
2339 | bitmap[1] &= ~FATTR4_WORD1_MOUNTED_ON_FILEID; | ||
2340 | } | ||
2341 | dprintk("%s: fileid=%Lu\n", __FUNCTION__, (unsigned long long)*fileid); | ||
2342 | return 0; | ||
2343 | } | ||
2344 | |||
2329 | static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) | 2345 | static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) |
2330 | { | 2346 | { |
2331 | uint32_t *p; | 2347 | uint32_t *p; |
@@ -2983,6 +2999,7 @@ static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, cons | |||
2983 | bitmap[2] = {0}, | 2999 | bitmap[2] = {0}, |
2984 | type; | 3000 | type; |
2985 | int status, fmode = 0; | 3001 | int status, fmode = 0; |
3002 | uint64_t fileid; | ||
2986 | 3003 | ||
2987 | if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0) | 3004 | if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0) |
2988 | goto xdr_error; | 3005 | goto xdr_error; |
@@ -3032,6 +3049,10 @@ static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, cons | |||
3032 | goto xdr_error; | 3049 | goto xdr_error; |
3033 | if ((status = decode_attr_time_modify(xdr, bitmap, &fattr->mtime)) != 0) | 3050 | if ((status = decode_attr_time_modify(xdr, bitmap, &fattr->mtime)) != 0) |
3034 | goto xdr_error; | 3051 | goto xdr_error; |
3052 | if ((status = decode_attr_mounted_on_fileid(xdr, bitmap, &fileid)) != 0) | ||
3053 | goto xdr_error; | ||
3054 | if (fattr->fileid == 0 && fileid != 0) | ||
3055 | fattr->fileid = fileid; | ||
3035 | if ((status = verify_attr_len(xdr, savep, attrlen)) == 0) | 3056 | if ((status = verify_attr_len(xdr, savep, attrlen)) == 0) |
3036 | fattr->valid = NFS_ATTR_FATTR | NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4; | 3057 | fattr->valid = NFS_ATTR_FATTR | NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4; |
3037 | xdr_error: | 3058 | xdr_error: |