nfsd41: handle current stateid in SETATTR and FREE_STATEID
authorTigran Mkrtchyan <kofemann@gmail.com>
Mon, 13 Feb 2012 21:55:30 +0000 (22:55 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 15 Feb 2012 16:20:43 +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 6e54d19a88c3704aed714fd273586faf2ecebd27..e1ae9500e9fc477b50c4390b78984ce5c2d20173 100644 (file)
@@ -14,6 +14,8 @@ extern void nfsd4_set_closestateid(struct nfsd4_compound_state *, struct nfsd4_c
 /*
  * functions to consume current state id
  */
+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 *);
 extern void nfsd4_get_lockustateid(struct nfsd4_compound_state *, struct nfsd4_locku *);
 extern void nfsd4_get_readstateid(struct nfsd4_compound_state *, struct nfsd4_read *);
index 421eb0980a686d09531c2c78004495b9976149ae..d11656bdc649cd6aa9e6f2a201a7bbfeee0977eb 100644 (file)
@@ -1606,6 +1606,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
                .op_name = "OP_SETATTR",
                .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME,
                .op_rsize_bop = (nfsd4op_rsize)nfsd4_setattr_rsize,
+               .op_get_currentstateid = (stateid_getter)nfsd4_get_setattrstateid,
        },
        [OP_SETCLIENTID] = {
                .op_func = (nfsd4op_func)nfsd4_setclientid,
index e97036f32b9b8b70ff2f31ff5fb7781ad8c43dfc..5258ac1f4cbdf1bd8a38ebe17196240ec83a1937 100644 (file)
@@ -4734,6 +4734,19 @@ nfsd4_set_lockstateid(struct nfsd4_compound_state *cstate, struct nfsd4_lock *lo
 /*
  * functions to consume current state id
  */
+
+void
+nfsd4_get_freestateid(struct nfsd4_compound_state *cstate, struct nfsd4_free_stateid *fsp)
+{
+       get_stateid(cstate, &fsp->fr_stateid);
+}
+
+void
+nfsd4_get_setattrstateid(struct nfsd4_compound_state *cstate, struct nfsd4_setattr *setattr)
+{
+       get_stateid(cstate, &setattr->sa_stateid);
+}
+
 void
 nfsd4_get_closestateid(struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
 {