aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/current_stateid.h11
-rw-r--r--fs/nfsd/nfs4proc.c2
-rw-r--r--fs/nfsd/nfs4state.c22
3 files changed, 32 insertions, 3 deletions
diff --git a/fs/nfsd/current_stateid.h b/fs/nfsd/current_stateid.h
index a83dd508cb8c..21550b69dec6 100644
--- a/fs/nfsd/current_stateid.h
+++ b/fs/nfsd/current_stateid.h
@@ -4,8 +4,17 @@
4#include "state.h" 4#include "state.h"
5#include "xdr4.h" 5#include "xdr4.h"
6 6
7/*
8 * functions to set current state id
9 */
7extern void nfsd4_set_openstateid(struct nfsd4_compound_state *, struct nfsd4_open *); 10extern void nfsd4_set_openstateid(struct nfsd4_compound_state *, struct nfsd4_open *);
8extern void nfsd4_get_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); 11extern void nfsd4_set_lockstateid(struct nfsd4_compound_state *, struct nfsd4_lock *);
9extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); 12extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *);
10 13
14/*
15 * functions to consume current state id
16 */
17extern void nfsd4_get_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *);
18extern void nfsd4_get_lockustateid(struct nfsd4_compound_state *, struct nfsd4_locku *);
19
11#endif /* _NFSD4_CURRENT_STATE_H */ 20#endif /* _NFSD4_CURRENT_STATE_H */
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index b08f6e50fc48..a985e19288b1 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1474,6 +1474,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
1474 .op_flags = OP_MODIFIES_SOMETHING, 1474 .op_flags = OP_MODIFIES_SOMETHING,
1475 .op_name = "OP_LOCK", 1475 .op_name = "OP_LOCK",
1476 .op_rsize_bop = (nfsd4op_rsize)nfsd4_lock_rsize, 1476 .op_rsize_bop = (nfsd4op_rsize)nfsd4_lock_rsize,
1477 .op_set_currentstateid = (stateid_setter)nfsd4_set_lockstateid,
1477 }, 1478 },
1478 [OP_LOCKT] = { 1479 [OP_LOCKT] = {
1479 .op_func = (nfsd4op_func)nfsd4_lockt, 1480 .op_func = (nfsd4op_func)nfsd4_lockt,
@@ -1484,6 +1485,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
1484 .op_flags = OP_MODIFIES_SOMETHING, 1485 .op_flags = OP_MODIFIES_SOMETHING,
1485 .op_name = "OP_LOCKU", 1486 .op_name = "OP_LOCKU",
1486 .op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize, 1487 .op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize,
1488 .op_get_currentstateid = (stateid_getter)nfsd4_get_lockustateid,
1487 }, 1489 },
1488 [OP_LOOKUP] = { 1490 [OP_LOOKUP] = {
1489 .op_func = (nfsd4op_func)nfsd4_lookup, 1491 .op_func = (nfsd4op_func)nfsd4_lookup,
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 2604e7ea8582..24eae5c11820 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4710,6 +4710,9 @@ put_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid)
4710 cstate->current_stateid = stateid; 4710 cstate->current_stateid = stateid;
4711} 4711}
4712 4712
4713/*
4714 * functions to set current state id
4715 */
4713void 4716void
4714nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open) 4717nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open)
4715{ 4718{
@@ -4717,13 +4720,28 @@ nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *op
4717} 4720}
4718 4721
4719void 4722void
4723nfsd4_set_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
4724{
4725 put_stateid(cstate, &close->cl_stateid);
4726}
4727
4728void
4729nfsd4_set_lockstateid(struct nfsd4_compound_state *cstate, struct nfsd4_lock *lock)
4730{
4731 put_stateid(cstate, &lock->lk_resp_stateid);
4732}
4733
4734/*
4735 * functions to consume current state id
4736 */
4737void
4720nfsd4_get_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close) 4738nfsd4_get_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
4721{ 4739{
4722 get_stateid(cstate, &close->cl_stateid); 4740 get_stateid(cstate, &close->cl_stateid);
4723} 4741}
4724 4742
4725void 4743void
4726nfsd4_set_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close) 4744nfsd4_get_lockustateid(struct nfsd4_compound_state *cstate, struct nfsd4_locku *locku)
4727{ 4745{
4728 get_stateid(cstate, &close->cl_stateid); 4746 get_stateid(cstate, &locku->lu_stateid);
4729} 4747}