nfsd41: consume current stateid on read and write
authorTigran Mkrtchyan <kofemann@gmail.com>
Mon, 13 Feb 2012 21:55:26 +0000 (22:55 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 15 Feb 2012 16:20:40 +0000 (11:20 -0500)
Signed-off-by: Tigran Mkrtchyan <kofemann@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/current_stateid.h
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4state.c

index 21550b69dec62ca8b34a3ff8a0a57918b06947ef..6e54d19a88c3704aed714fd273586faf2ecebd27 100644 (file)
@@ -16,5 +16,7 @@ extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_c
  */
 extern void nfsd4_get_closestateid(struct nfsd4_compound_state *, struct nfsd4_close *);
 extern void nfsd4_get_lockustateid(struct nfsd4_compound_state *, struct nfsd4_locku *);
+extern void nfsd4_get_readstateid(struct nfsd4_compound_state *, struct nfsd4_read *);
+extern void nfsd4_get_writestateid(struct nfsd4_compound_state *, struct nfsd4_write *);
 
 #endif   /* _NFSD4_CURRENT_STATE_H */
index a985e19288b12549688665b6bdb29e3c6e6f8dc1..d788d754ccde36b52fd74cc2303e8364d63cf004 100644 (file)
@@ -1546,6 +1546,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
                .op_flags = OP_MODIFIES_SOMETHING,
                .op_name = "OP_READ",
                .op_rsize_bop = (nfsd4op_rsize)nfsd4_read_rsize,
+               .op_get_currentstateid = (stateid_getter)nfsd4_get_readstateid,
        },
        [OP_READDIR] = {
                .op_func = (nfsd4op_func)nfsd4_readdir,
@@ -1624,6 +1625,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
                .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
                .op_name = "OP_WRITE",
                .op_rsize_bop = (nfsd4op_rsize)nfsd4_write_rsize,
+               .op_get_currentstateid = (stateid_getter)nfsd4_get_writestateid,
        },
        [OP_RELEASE_LOCKOWNER] = {
                .op_func = (nfsd4op_func)nfsd4_release_lockowner,
index 24eae5c11820f836f3a22e54f1d7b909a9c9b88e..e97036f32b9b8b70ff2f31ff5fb7781ad8c43dfc 100644 (file)
@@ -4745,3 +4745,15 @@ nfsd4_get_lockustateid(struct nfsd4_compound_state *cstate, struct nfsd4_locku *
 {
        get_stateid(cstate, &locku->lu_stateid);
 }
+
+void
+nfsd4_get_readstateid(struct nfsd4_compound_state *cstate, struct nfsd4_read *read)
+{
+       get_stateid(cstate, &read->rd_stateid);
+}
+
+void
+nfsd4_get_writestateid(struct nfsd4_compound_state *cstate, struct nfsd4_write *write)
+{
+       get_stateid(cstate, &write->wr_stateid);
+}