aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 905808bc94bb..2604e7ea8582 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4695,3 +4695,35 @@ nfs4_state_shutdown(void)
4695 nfs4_unlock_state(); 4695 nfs4_unlock_state();
4696 nfsd4_destroy_callback_queue(); 4696 nfsd4_destroy_callback_queue();
4697} 4697}
4698
4699static void
4700get_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid)
4701{
4702 if (cstate->current_stateid && CURRENT_STATEID(stateid))
4703 memcpy(stateid, cstate->current_stateid, sizeof(stateid_t));
4704}
4705
4706static void
4707put_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid)
4708{
4709 if (cstate->minorversion)
4710 cstate->current_stateid = stateid;
4711}
4712
4713void
4714nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open)
4715{
4716 put_stateid(cstate, &open->op_stateid);
4717}
4718
4719void
4720nfsd4_get_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
4721{
4722 get_stateid(cstate, &close->cl_stateid);
4723}
4724
4725void
4726nfsd4_set_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
4727{
4728 get_stateid(cstate, &close->cl_stateid);
4729}