diff options
author | Tigran Mkrtchyan <kofemann@gmail.com> | 2012-02-13 22:55:24 +0100 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-02-15 11:20:38 -0500 |
commit | 8b70484c67cf5241cfbea0ee31b83e42e5bac163 (patch) | |
tree | 2625d76be0ddbc5b1c27ca5aca96006482e49747 /fs/nfsd/nfs4state.c | |
parent | 19ff0f288c6f2100987408ecc2cb911a2d50bc76 (diff) | |
download | op-kernel-dev-8b70484c67cf5241cfbea0ee31b83e42e5bac163.zip op-kernel-dev-8b70484c67cf5241cfbea0ee31b83e42e5bac163.tar.gz |
nfsd41: handle current stateid in open and close
Signed-off-by: Tigran Mkrtchyan <kofemann@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 905808b..2604e7e 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4695,3 +4695,35 @@ nfs4_state_shutdown(void) nfs4_unlock_state(); nfsd4_destroy_callback_queue(); } + +static void +get_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid) +{ + if (cstate->current_stateid && CURRENT_STATEID(stateid)) + memcpy(stateid, cstate->current_stateid, sizeof(stateid_t)); +} + +static void +put_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid) +{ + if (cstate->minorversion) + cstate->current_stateid = stateid; +} + +void +nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open) +{ + put_stateid(cstate, &open->op_stateid); +} + +void +nfsd4_get_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close) +{ + get_stateid(cstate, &close->cl_stateid); +} + +void +nfsd4_set_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close) +{ + get_stateid(cstate, &close->cl_stateid); +} |