diff options
author | Tigran Mkrtchyan <kofemann@gmail.com> | 2012-02-13 16:55:31 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-02-15 11:20:44 -0500 |
commit | 9428fe1abb672c67169d3b6abf0faa120f020c32 (patch) | |
tree | a8f28e4b20a81656d71abfc9aef61976a10e2385 /fs | |
parent | 1e97b5190d9538748cbf72c20a56b2c5cbd2f61d (diff) |
nfsd41: consume current stateid on DELEGRETURN and OPENDOWNGRADE
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 | 3 | ||||
-rw-r--r-- | fs/nfsd/nfs4proc.c | 3 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 18 |
3 files changed, 24 insertions, 0 deletions
diff --git a/fs/nfsd/current_stateid.h b/fs/nfsd/current_stateid.h index e1ae9500e9fc..d8c99928b431 100644 --- a/fs/nfsd/current_stateid.h +++ b/fs/nfsd/current_stateid.h | |||
@@ -7,6 +7,7 @@ | |||
7 | /* | 7 | /* |
8 | * functions to set current state id | 8 | * functions to set current state id |
9 | */ | 9 | */ |
10 | extern void nfsd4_set_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *); | ||
10 | extern void nfsd4_set_openstateid(struct nfsd4_compound_state *, struct nfsd4_open *); | 11 | extern void nfsd4_set_openstateid(struct nfsd4_compound_state *, struct nfsd4_open *); |
11 | extern void nfsd4_set_lockstateid(struct nfsd4_compound_state *, struct nfsd4_lock *); | 12 | extern void nfsd4_set_lockstateid(struct nfsd4_compound_state *, struct nfsd4_lock *); |
12 | extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); | 13 | extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); |
@@ -14,6 +15,8 @@ extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_c | |||
14 | /* | 15 | /* |
15 | * functions to consume current state id | 16 | * functions to consume current state id |
16 | */ | 17 | */ |
18 | extern void nfsd4_get_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *); | ||
19 | extern void nfsd4_get_delegreturnstateid(struct nfsd4_compound_state *, struct nfsd4_delegreturn *); | ||
17 | extern void nfsd4_get_freestateid(struct nfsd4_compound_state *, struct nfsd4_free_stateid *); | 20 | extern void nfsd4_get_freestateid(struct nfsd4_compound_state *, struct nfsd4_free_stateid *); |
18 | extern void nfsd4_get_setattrstateid(struct nfsd4_compound_state *, struct nfsd4_setattr *); | 21 | extern void nfsd4_get_setattrstateid(struct nfsd4_compound_state *, struct nfsd4_setattr *); |
19 | extern void nfsd4_get_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); | 22 | extern void nfsd4_get_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *); |
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index d11656bdc649..1ee0e7c42e97 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -1454,6 +1454,7 @@ static struct nfsd4_operation nfsd4_ops[] = { | |||
1454 | .op_flags = OP_MODIFIES_SOMETHING, | 1454 | .op_flags = OP_MODIFIES_SOMETHING, |
1455 | .op_name = "OP_DELEGRETURN", | 1455 | .op_name = "OP_DELEGRETURN", |
1456 | .op_rsize_bop = nfsd4_only_status_rsize, | 1456 | .op_rsize_bop = nfsd4_only_status_rsize, |
1457 | .op_get_currentstateid = (stateid_getter)nfsd4_get_delegreturnstateid, | ||
1457 | }, | 1458 | }, |
1458 | [OP_GETATTR] = { | 1459 | [OP_GETATTR] = { |
1459 | .op_func = (nfsd4op_func)nfsd4_getattr, | 1460 | .op_func = (nfsd4op_func)nfsd4_getattr, |
@@ -1521,6 +1522,8 @@ static struct nfsd4_operation nfsd4_ops[] = { | |||
1521 | .op_flags = OP_MODIFIES_SOMETHING, | 1522 | .op_flags = OP_MODIFIES_SOMETHING, |
1522 | .op_name = "OP_OPEN_DOWNGRADE", | 1523 | .op_name = "OP_OPEN_DOWNGRADE", |
1523 | .op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize, | 1524 | .op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize, |
1525 | .op_get_currentstateid = (stateid_getter)nfsd4_get_opendowngradestateid, | ||
1526 | .op_set_currentstateid = (stateid_setter)nfsd4_set_opendowngradestateid, | ||
1524 | }, | 1527 | }, |
1525 | [OP_PUTFH] = { | 1528 | [OP_PUTFH] = { |
1526 | .op_func = (nfsd4op_func)nfsd4_putfh, | 1529 | .op_func = (nfsd4op_func)nfsd4_putfh, |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 5258ac1f4cbd..7b0b6f0f69cb 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -4714,6 +4714,12 @@ put_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid) | |||
4714 | * functions to set current state id | 4714 | * functions to set current state id |
4715 | */ | 4715 | */ |
4716 | void | 4716 | void |
4717 | nfsd4_set_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *odp) | ||
4718 | { | ||
4719 | put_stateid(cstate, &odp->od_stateid); | ||
4720 | } | ||
4721 | |||
4722 | void | ||
4717 | nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open) | 4723 | nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open) |
4718 | { | 4724 | { |
4719 | put_stateid(cstate, &open->op_stateid); | 4725 | put_stateid(cstate, &open->op_stateid); |
@@ -4736,6 +4742,18 @@ nfsd4_set_lockstateid(struct nfsd4_compound_state *cstate, struct nfsd4_lock *lo | |||
4736 | */ | 4742 | */ |
4737 | 4743 | ||
4738 | void | 4744 | void |
4745 | nfsd4_get_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *odp) | ||
4746 | { | ||
4747 | get_stateid(cstate, &odp->od_stateid); | ||
4748 | } | ||
4749 | |||
4750 | void | ||
4751 | nfsd4_get_delegreturnstateid(struct nfsd4_compound_state *cstate, struct nfsd4_delegreturn *drp) | ||
4752 | { | ||
4753 | get_stateid(cstate, &drp->dr_stateid); | ||
4754 | } | ||
4755 | |||
4756 | void | ||
4739 | nfsd4_get_freestateid(struct nfsd4_compound_state *cstate, struct nfsd4_free_stateid *fsp) | 4757 | nfsd4_get_freestateid(struct nfsd4_compound_state *cstate, struct nfsd4_free_stateid *fsp) |
4740 | { | 4758 | { |
4741 | get_stateid(cstate, &fsp->fr_stateid); | 4759 | get_stateid(cstate, &fsp->fr_stateid); |