diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2012-03-01 17:01:57 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-02 17:18:09 -0500 |
commit | 81934ddb8eb62a85b8015c0f2b824a88510965a2 (patch) | |
tree | db5988884f8a0309b488cba6623b1ed2c31af983 /fs/nfs/nfs4proc.c | |
parent | bb4dae5e5b5a92f0ffbcc6ac10c5e8afcd87934d (diff) |
NFS: Introduce NFS_ATTR_FATTR_V4_LOCATIONS
The Linux NFS client must distinguish between referral events (which
it currently supports) and migration events (which it does not yet
support).
In both types of events, an fs_locations array is returned. But upper
layers, not the XDR layer, should make the distinction between a
referral and a migration. There really isn't a way for an XDR decoder
function to distinguish the two, in general.
Slightly adjust the FATTR flags returned by decode_fs_locations()
to set NFS_ATTR_FATTR_V4_LOCATIONS only if a non-empty locations
array was returned from the server. Then have logic in nfs4proc.c
distinguish whether the locations array is for a referral or
something else.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 54767dd66cf..281c2def2b1 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -79,6 +79,7 @@ static int _nfs4_proc_open(struct nfs4_opendata *data); | |||
79 | static int _nfs4_recover_proc_open(struct nfs4_opendata *data); | 79 | static int _nfs4_recover_proc_open(struct nfs4_opendata *data); |
80 | static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); | 80 | static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); |
81 | static int nfs4_async_handle_error(struct rpc_task *, const struct nfs_server *, struct nfs4_state *); | 81 | static int nfs4_async_handle_error(struct rpc_task *, const struct nfs_server *, struct nfs4_state *); |
82 | static void nfs_fixup_referral_attributes(struct nfs_fattr *fattr); | ||
82 | static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr); | 83 | static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr); |
83 | static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred, | 84 | static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred, |
84 | struct nfs_fattr *fattr, struct iattr *sattr, | 85 | struct nfs_fattr *fattr, struct iattr *sattr, |
@@ -2340,7 +2341,6 @@ static int nfs4_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle, | |||
2340 | return nfs4_map_errors(status); | 2341 | return nfs4_map_errors(status); |
2341 | } | 2342 | } |
2342 | 2343 | ||
2343 | static void nfs_fixup_referral_attributes(struct nfs_fattr *fattr); | ||
2344 | /* | 2344 | /* |
2345 | * Get locations and (maybe) other attributes of a referral. | 2345 | * Get locations and (maybe) other attributes of a referral. |
2346 | * Note that we'll actually follow the referral later when | 2346 | * Note that we'll actually follow the referral later when |
@@ -4797,11 +4797,11 @@ static void nfs_fixup_referral_attributes(struct nfs_fattr *fattr) | |||
4797 | if (!(((fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID) || | 4797 | if (!(((fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID) || |
4798 | (fattr->valid & NFS_ATTR_FATTR_FILEID)) && | 4798 | (fattr->valid & NFS_ATTR_FATTR_FILEID)) && |
4799 | (fattr->valid & NFS_ATTR_FATTR_FSID) && | 4799 | (fattr->valid & NFS_ATTR_FATTR_FSID) && |
4800 | (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL))) | 4800 | (fattr->valid & NFS_ATTR_FATTR_V4_LOCATIONS))) |
4801 | return; | 4801 | return; |
4802 | 4802 | ||
4803 | fattr->valid |= NFS_ATTR_FATTR_TYPE | NFS_ATTR_FATTR_MODE | | 4803 | fattr->valid |= NFS_ATTR_FATTR_TYPE | NFS_ATTR_FATTR_MODE | |
4804 | NFS_ATTR_FATTR_NLINK; | 4804 | NFS_ATTR_FATTR_NLINK | NFS_ATTR_FATTR_V4_REFERRAL; |
4805 | fattr->mode = S_IFDIR | S_IRUGO | S_IXUGO; | 4805 | fattr->mode = S_IFDIR | S_IRUGO | S_IXUGO; |
4806 | fattr->nlink = 2; | 4806 | fattr->nlink = 2; |
4807 | } | 4807 | } |