Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297430
b: refs/heads/master
c: 62cd4a5
h: refs/heads/master
v: v3
  • Loading branch information
Tigran Mkrtchyan authored and J. Bruce Fields committed Feb 15, 2012
1 parent 451eb76 commit 57b349e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b70484c67cf5241cfbea0ee31b83e42e5bac163
refs/heads/master: 62cd4a591c6e0ead783940169fb8d34fe3f04992
11 changes: 10 additions & 1 deletion trunk/fs/nfsd/current_stateid.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
#include "state.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_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 *);

/*
* 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 */
2 changes: 2 additions & 0 deletions trunk/fs/nfsd/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
.op_flags = OP_MODIFIES_SOMETHING,
.op_name = "OP_LOCK",
.op_rsize_bop = (nfsd4op_rsize)nfsd4_lock_rsize,
.op_set_currentstateid = (stateid_setter)nfsd4_set_lockstateid,
},
[OP_LOCKT] = {
.op_func = (nfsd4op_func)nfsd4_lockt,
Expand All @@ -1484,6 +1485,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
.op_flags = OP_MODIFIES_SOMETHING,
.op_name = "OP_LOCKU",
.op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize,
.op_get_currentstateid = (stateid_getter)nfsd4_get_lockustateid,
},
[OP_LOOKUP] = {
.op_func = (nfsd4op_func)nfsd4_lookup,
Expand Down
22 changes: 20 additions & 2 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -4710,20 +4710,38 @@ put_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid)
cstate->current_stateid = stateid;
}

/*
* functions to set current state id
*/
void
nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open)
{
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
nfsd4_get_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
{
get_stateid(cstate, &close->cl_stateid);
}

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);
}

0 comments on commit 57b349e

Please sign in to comment.