diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2011-06-02 14:59:09 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-12 13:40:28 -0400 |
commit | 9aeda35fd643eba683fdb8dba8907fa796a85dda (patch) | |
tree | df797ea6f4eca0601edcdf941ac678d11c79a07a /fs/nfs/nfs4proc.c | |
parent | 7d9747947ae66d8f6a9a9a023a3a5e28df6a536e (diff) |
NFS: added FREE_STATEID call
FREE_STATEID is used to tell the server that we want to free a stateid
that no longer has any locks associated with it. This allows the client
to reclaim locks without encountering edge conditions documented in
section 8.4.3 of RFC 5661.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 5612ba997db7..197ad0a737f6 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -6043,6 +6043,36 @@ static int nfs41_test_stateid(struct nfs_server *server, struct nfs4_state *stat | |||
6043 | } while (exception.retry); | 6043 | } while (exception.retry); |
6044 | return err; | 6044 | return err; |
6045 | } | 6045 | } |
6046 | |||
6047 | static int _nfs4_free_stateid(struct nfs_server *server, struct nfs4_state *state) | ||
6048 | { | ||
6049 | int status; | ||
6050 | struct nfs41_free_stateid_args args = { | ||
6051 | .stateid = &state->stateid, | ||
6052 | }; | ||
6053 | struct nfs41_free_stateid_res res; | ||
6054 | struct rpc_message msg = { | ||
6055 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_FREE_STATEID], | ||
6056 | .rpc_argp = &args, | ||
6057 | .rpc_resp = &res, | ||
6058 | }; | ||
6059 | |||
6060 | args.seq_args.sa_session = res.seq_res.sr_session = NULL; | ||
6061 | status = nfs4_call_sync_sequence(server->client, server, &msg, &args.seq_args, &res.seq_res, 0, 1); | ||
6062 | return status; | ||
6063 | } | ||
6064 | |||
6065 | static int nfs41_free_stateid(struct nfs_server *server, struct nfs4_state *state) | ||
6066 | { | ||
6067 | struct nfs4_exception exception = { }; | ||
6068 | int err; | ||
6069 | do { | ||
6070 | err = nfs4_handle_exception(server, | ||
6071 | _nfs4_free_stateid(server, state), | ||
6072 | &exception); | ||
6073 | } while (exception.retry); | ||
6074 | return err; | ||
6075 | } | ||
6046 | #endif /* CONFIG_NFS_V4_1 */ | 6076 | #endif /* CONFIG_NFS_V4_1 */ |
6047 | 6077 | ||
6048 | struct nfs4_state_recovery_ops nfs40_reboot_recovery_ops = { | 6078 | struct nfs4_state_recovery_ops nfs40_reboot_recovery_ops = { |