From: Tigran Mkrtchyan <kofemann@googlemail.com>
To: linux-nfs@vger.kernel.org
Cc: Tigran Mkrtchyan <kofemann@gmail.com>
Subject: [PATH v6 9/9] nfsd41: consume current stateid on DELEGRETURN and OPENDOWNGRADE
Date: Sun, 15 Jan 2012 17:20:10 +0100 [thread overview]
Message-ID: <1326644410-7482-10-git-send-email-tigran.mkrtchyan@desy.de> (raw)
In-Reply-To: <1326644410-7482-1-git-send-email-tigran.mkrtchyan@desy.de>
From: Tigran Mkrtchyan <kofemann@gmail.com>
Signed-off-by: Tigran Mkrtchyan <kofemann@gmail.com>
---
fs/nfsd/current_stateid.h | 3 +++
fs/nfsd/nfs4proc.c | 3 +++
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 e1ae950..d8c9992 100644
--- a/fs/nfsd/current_stateid.h
+++ b/fs/nfsd/current_stateid.h
@@ -7,6 +7,7 @@
/*
* functions to set current state id
*/
+extern void nfsd4_set_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *);
extern void nfsd4_set_openstateid(struct nfsd4_compound_state *, struct nfsd4_open *);
extern void nfsd4_set_lockstateid(struct nfsd4_compound_state *, struct nfsd4_lock *);
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
/*
* functions to consume current state id
*/
+extern void nfsd4_get_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *);
+extern void nfsd4_get_delegreturnstateid(struct nfsd4_compound_state *, struct nfsd4_delegreturn *);
extern void nfsd4_get_freestateid(struct nfsd4_compound_state *, struct nfsd4_free_stateid *);
extern void nfsd4_get_setattrstateid(struct nfsd4_compound_state *, struct nfsd4_setattr *);
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 124934a..dffc9bd 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1454,6 +1454,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
.op_flags = OP_MODIFIES_SOMETHING,
.op_name = "OP_DELEGRETURN",
.op_rsize_bop = nfsd4_only_status_rsize,
+ .op_get_currentstateid = (stateid_getter)nfsd4_get_delegreturnstateid,
},
[OP_GETATTR] = {
.op_func = (nfsd4op_func)nfsd4_getattr,
@@ -1521,6 +1522,8 @@ static struct nfsd4_operation nfsd4_ops[] = {
.op_flags = OP_MODIFIES_SOMETHING,
.op_name = "OP_OPEN_DOWNGRADE",
.op_rsize_bop = (nfsd4op_rsize)nfsd4_status_stateid_rsize,
+ .op_get_currentstateid = (stateid_getter)nfsd4_get_opendowngradestateid,
+ .op_set_currentstateid = (stateid_setter)nfsd4_set_opendowngradestateid,
},
[OP_PUTFH] = {
.op_func = (nfsd4op_func)nfsd4_putfh,
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 8214c0f..9c5a239 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)
* functions to set current state id
*/
void
+nfsd4_set_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *odp)
+{
+ put_stateid(cstate, &odp->od_stateid);
+}
+
+void
nfsd4_set_openstateid(struct nfsd4_compound_state *cstate, struct nfsd4_open *open)
{
put_stateid(cstate, &open->op_stateid);
@@ -4736,6 +4742,18 @@ nfsd4_set_lockstateid(struct nfsd4_compound_state *cstate, struct nfsd4_lock *lo
*/
void
+nfsd4_get_opendowngradestateid(struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *odp)
+{
+ get_stateid(cstate, &odp->od_stateid);
+}
+
+void
+nfsd4_get_delegreturnstateid(struct nfsd4_compound_state *cstate, struct nfsd4_delegreturn *drp)
+{
+ get_stateid(cstate, &drp->dr_stateid);
+}
+
+void
nfsd4_get_freestateid(struct nfsd4_compound_state *cstate, struct nfsd4_free_stateid *fsp)
{
get_stateid(cstate, &fsp->fr_stateid);
--
1.7.7.5
prev parent reply other threads:[~2012-01-15 16:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-15 16:20 [PATH v6 0/9] handle curruent stateid Tigran Mkrtchyan
2012-01-15 16:20 ` [PATH v6 1/9] nfsd4: initialize current stateid at compile time Tigran Mkrtchyan
2012-01-15 16:20 ` [PATH v6 2/9] nfsd41: handle current stateid in open and close Tigran Mkrtchyan
2012-01-17 19:40 ` J. Bruce Fields
2012-01-17 19:43 ` J. Bruce Fields
2012-01-17 20:14 ` Tigran Mkrtchyan
2012-01-17 20:45 ` J. Bruce Fields
2012-01-17 21:17 ` Tiramisu Mokka
2012-01-15 16:20 ` [PATH v6 3/9] nfsd41: handle current stateid on lock and locku Tigran Mkrtchyan
2012-01-15 16:20 ` [PATH v6 4/9] nfsd41: consume current stateid on read and write Tigran Mkrtchyan
2012-01-15 16:20 ` [PATH v6 5/9] nfsd41: mark PUTFH, PUTPUBFH and PUTROOTFH to clear current stateid Tigran Mkrtchyan
2012-01-15 16:20 ` [PATH v6 6/9] nfsd41: save and restore current stateid with current fh Tigran Mkrtchyan
2012-01-15 16:20 ` [PATH v6 7/9] nfsd41: mark LOOKUP, LOOKUPP and CREATE to invalidate current stateid Tigran Mkrtchyan
2012-01-15 16:20 ` [PATH v6 8/9] nfsd41: handle current stateid in SETATTR and FREE_STATEID Tigran Mkrtchyan
2012-01-15 16:20 ` Tigran Mkrtchyan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1326644410-7482-10-git-send-email-tigran.mkrtchyan@desy.de \
--to=kofemann@googlemail.com \
--cc=kofemann@gmail.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).