diff options
author | Tigran Mkrtchyan <kofemann@gmail.com> | 2012-02-13 22:55:32 +0100 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-02-15 11:20:45 -0500 |
commit | 37c593c57324740821766c56e48cf09776a68a9c (patch) | |
tree | 9c6f91acb532da56f5d5f24c2aa8a345f717c81a /fs/nfsd/nfs4state.c | |
parent | 9428fe1abb672c67169d3b6abf0faa120f020c32 (diff) | |
download | linux-37c593c57324740821766c56e48cf09776a68a9c.tar.bz2 |
nfsd41: use current stateid by value
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 | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 7b0b6f0f69cb..cf62079e9b71 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4699,15 +4699,23 @@ nfs4_state_shutdown(void) 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)); + if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG) && 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; + if (cstate->minorversion) { + memcpy(&cstate->current_stateid, stateid, sizeof(stateid_t)); + SET_STATE_ID(cstate, CURRENT_STATE_ID_FLAG); + } +} + +void +clear_current_stateid(struct nfsd4_compound_state *cstate) +{ + CLEAR_STATE_ID(cstate, CURRENT_STATE_ID_FLAG); } /* |