diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-10-27 22:12:41 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-10-27 22:12:41 -0400 |
commit | 516a6af641bb50c608329a5bd751acd0d65cc4ab (patch) | |
tree | 93b240cb19460073cac3363517fcc0e253fb48d9 /fs/nfs/nfs4proc.c | |
parent | 3338c143b4fde2d256016b63043ec8e2c93eba19 (diff) |
NFS: Add optional post-op getattr instruction to the NFSv4 file close.
"Optional" means that the close call will not fail if the getattr
at the end of the compound fails.
If it does succeed, try to refresh inode attributes.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index f363fd6c7f4d..7be3d2d15d6f 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -865,6 +865,7 @@ struct nfs4_closedata { | |||
865 | struct nfs4_state *state; | 865 | struct nfs4_state *state; |
866 | struct nfs_closeargs arg; | 866 | struct nfs_closeargs arg; |
867 | struct nfs_closeres res; | 867 | struct nfs_closeres res; |
868 | struct nfs_fattr fattr; | ||
868 | }; | 869 | }; |
869 | 870 | ||
870 | static void nfs4_free_closedata(struct nfs4_closedata *calldata) | 871 | static void nfs4_free_closedata(struct nfs4_closedata *calldata) |
@@ -904,6 +905,7 @@ static void nfs4_close_done(struct rpc_task *task) | |||
904 | return; | 905 | return; |
905 | } | 906 | } |
906 | } | 907 | } |
908 | nfs_refresh_inode(calldata->inode, calldata->res.fattr); | ||
907 | state->state = calldata->arg.open_flags; | 909 | state->state = calldata->arg.open_flags; |
908 | nfs4_free_closedata(calldata); | 910 | nfs4_free_closedata(calldata); |
909 | } | 911 | } |
@@ -941,6 +943,7 @@ static void nfs4_close_begin(struct rpc_task *task) | |||
941 | rpc_exit(task, 0); | 943 | rpc_exit(task, 0); |
942 | return; | 944 | return; |
943 | } | 945 | } |
946 | nfs_fattr_init(calldata->res.fattr); | ||
944 | if (mode != 0) | 947 | if (mode != 0) |
945 | msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_DOWNGRADE]; | 948 | msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_DOWNGRADE]; |
946 | calldata->arg.open_flags = mode; | 949 | calldata->arg.open_flags = mode; |
@@ -960,6 +963,7 @@ static void nfs4_close_begin(struct rpc_task *task) | |||
960 | */ | 963 | */ |
961 | int nfs4_do_close(struct inode *inode, struct nfs4_state *state, mode_t mode) | 964 | int nfs4_do_close(struct inode *inode, struct nfs4_state *state, mode_t mode) |
962 | { | 965 | { |
966 | struct nfs_server *server = NFS_SERVER(inode); | ||
963 | struct nfs4_closedata *calldata; | 967 | struct nfs4_closedata *calldata; |
964 | int status = -ENOMEM; | 968 | int status = -ENOMEM; |
965 | 969 | ||
@@ -974,8 +978,11 @@ int nfs4_do_close(struct inode *inode, struct nfs4_state *state, mode_t mode) | |||
974 | calldata->arg.seqid = nfs_alloc_seqid(&state->owner->so_seqid); | 978 | calldata->arg.seqid = nfs_alloc_seqid(&state->owner->so_seqid); |
975 | if (calldata->arg.seqid == NULL) | 979 | if (calldata->arg.seqid == NULL) |
976 | goto out_free_calldata; | 980 | goto out_free_calldata; |
981 | calldata->arg.bitmask = server->attr_bitmask; | ||
982 | calldata->res.fattr = &calldata->fattr; | ||
983 | calldata->res.server = server; | ||
977 | 984 | ||
978 | status = nfs4_call_async(NFS_SERVER(inode)->client, nfs4_close_begin, | 985 | status = nfs4_call_async(server->client, nfs4_close_begin, |
979 | nfs4_close_done, calldata); | 986 | nfs4_close_done, calldata); |
980 | if (status == 0) | 987 | if (status == 0) |
981 | goto out; | 988 | goto out; |