diff options
author | Tigran Mkrtchyan <kofemann@gmail.com> | 2012-02-13 16:55:25 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-02-15 11:20:39 -0500 |
commit | 62cd4a591c6e0ead783940169fb8d34fe3f04992 (patch) | |
tree | 149caa0d996deaa4556f3cb40cdd6d72b15b333f /fs | |
parent | 8b70484c67cf5241cfbea0ee31b83e42e5bac163 (diff) |
nfsd41: handle current stateid on lock and locku
Signed-off-by: Tigran Mkrtchyan <kofemann@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/current_stateid.h | 11 | ||||
-rw-r--r-- | fs/nfsd/nfs4proc.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 22 |
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 | */ | ||
7 | extern void nfsd4_set_openstateid(struct nfsd4_compound_state *, struct nfsd4_open *); | 10 | extern void nfsd4_set_openstateid(struct nfsd4_compound_state *, struct nfsd4_open *); |
8 | extern void nfsd4_get_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); | 11 | extern void nfsd4_set_lockstateid(struct nfsd4_compound_state *, struct nfsd4_lock *); |
9 | extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); | 12 | extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); |
10 | 13 | ||
14 | /* | ||
15 | * functions to consume current state id | ||
16 | */ | ||
17 | extern void nfsd4_get_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); | ||
18 | extern 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 | */ | ||
4713 | void | 4716 | void |
4714 | nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open) | 4717 | nfsd4_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 | ||
4719 | void | 4722 | void |
4723 | nfsd4_set_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close) | ||
4724 | { | ||
4725 | put_stateid(cstate, &close->cl_stateid); | ||
4726 | } | ||
4727 | |||
4728 | void | ||
4729 | nfsd4_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 | */ | ||
4737 | void | ||
4720 | nfsd4_get_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close) | 4738 | nfsd4_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 | ||
4725 | void | 4743 | void |
4726 | nfsd4_set_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close) | 4744 | nfsd4_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 | } |