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>
This commit is contained in:
parent
8b70484c67
commit
62cd4a591c
3 changed files with 32 additions and 3 deletions
|
@ -4,8 +4,17 @@
|
||||||
#include "state.h"
|
#include "state.h"
|
||||||
#include "xdr4.h"
|
#include "xdr4.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* functions to set current state id
|
||||||
|
*/
|
||||||
extern void nfsd4_set_openstateid(struct nfsd4_compound_state *, struct nfsd4_open *);
|
extern void nfsd4_set_openstateid(struct nfsd4_compound_state *, struct nfsd4_open *);
|
||||||
extern void nfsd4_get_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *);
|
extern void nfsd4_set_lockstateid(struct nfsd4_compound_state *, struct nfsd4_lock *);
|
||||||
extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *);
|
extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* functions to consume current state id
|
||||||
|
*/
|
||||||
|
extern void nfsd4_get_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *);
|
||||||
|
extern void nfsd4_get_lockustateid(struct nfsd4_compound_state *, struct nfsd4_locku *);
|
||||||
|
|
||||||
#endif /* _NFSD4_CURRENT_STATE_H */
|
#endif /* _NFSD4_CURRENT_STATE_H */
|
||||||
|
|
|
@ -1474,6 +1474,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
|
||||||
.op_flags = OP_MODIFIES_SOMETHING,
|
.op_flags = OP_MODIFIES_SOMETHING,
|
||||||
.op_name = "OP_LOCK",
|
.op_name = "OP_LOCK",
|
||||||
.op_rsize_bop = (nfsd4op_rsize)nfsd4_lock_rsize,
|
.op_rsize_bop = (nfsd4op_rsize)nfsd4_lock_rsize,
|
||||||
|
.op_set_currentstateid = (stateid_setter)nfsd4_set_lockstateid,
|
||||||
},
|
},
|
||||||
[OP_LOCKT] = {
|
[OP_LOCKT] = {
|
||||||
.op_func = (nfsd4op_func)nfsd4_lockt,
|
.op_func = (nfsd4op_func)nfsd4_lockt,
|
||||||
|
@ -1484,6 +1485,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
|
||||||
.op_flags = OP_MODIFIES_SOMETHING,
|
.op_flags = OP_MODIFIES_SOMETHING,
|
||||||
.op_name = "OP_LOCKU",
|
.op_name = "OP_LOCKU",
|
||||||
.op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize,
|
.op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize,
|
||||||
|
.op_get_currentstateid = (stateid_getter)nfsd4_get_lockustateid,
|
||||||
},
|
},
|
||||||
[OP_LOOKUP] = {
|
[OP_LOOKUP] = {
|
||||||
.op_func = (nfsd4op_func)nfsd4_lookup,
|
.op_func = (nfsd4op_func)nfsd4_lookup,
|
||||||
|
|
|
@ -4710,12 +4710,30 @@ put_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid)
|
||||||
cstate->current_stateid = stateid;
|
cstate->current_stateid = stateid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* functions to set current state id
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open)
|
nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open)
|
||||||
{
|
{
|
||||||
put_stateid(cstate, &open->op_stateid);
|
put_stateid(cstate, &open->op_stateid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nfsd4_set_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
|
||||||
|
{
|
||||||
|
put_stateid(cstate, &close->cl_stateid);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nfsd4_set_lockstateid(struct nfsd4_compound_state *cstate, struct nfsd4_lock *lock)
|
||||||
|
{
|
||||||
|
put_stateid(cstate, &lock->lk_resp_stateid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* functions to consume current state id
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
nfsd4_get_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
|
nfsd4_get_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
|
||||||
{
|
{
|
||||||
|
@ -4723,7 +4741,7 @@ nfsd4_get_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nfsd4_set_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
|
nfsd4_get_lockustateid(struct nfsd4_compound_state *cstate, struct nfsd4_locku *locku)
|
||||||
{
|
{
|
||||||
get_stateid(cstate, &close->cl_stateid);
|
get_stateid(cstate, &locku->lu_stateid);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue