]> git.baikalelectronics.ru Git - kernel.git/commitdiff
NFSD generalize nfsd4_compound_state flag names
authorOlga Kornievskaia <kolga@netapp.com>
Thu, 13 Sep 2018 17:58:24 +0000 (13:58 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 9 Dec 2019 16:42:14 +0000 (11:42 -0500)
Allow for sid_flag field non-stateid use.

Signed-off-by: Andy Adamson <andros@netapp.com>
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4state.c
fs/nfsd/xdr4.h

index dee5aec098fd9fdee0bc0ed02d4b566f4b77876b..8cc9f6e91874c89bad3d926980ce980cc7e8543b 100644 (file)
@@ -531,9 +531,9 @@ nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
                return nfserr_restorefh;
 
        fh_dup2(&cstate->current_fh, &cstate->save_fh);
-       if (HAS_STATE_ID(cstate, SAVED_STATE_ID_FLAG)) {
+       if (HAS_CSTATE_FLAG(cstate, SAVED_STATE_ID_FLAG)) {
                memcpy(&cstate->current_stateid, &cstate->save_stateid, sizeof(stateid_t));
-               SET_STATE_ID(cstate, CURRENT_STATE_ID_FLAG);
+               SET_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG);
        }
        return nfs_ok;
 }
@@ -543,9 +543,9 @@ nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
             union nfsd4_op_u *u)
 {
        fh_dup2(&cstate->save_fh, &cstate->current_fh);
-       if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG)) {
+       if (HAS_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG)) {
                memcpy(&cstate->save_stateid, &cstate->current_stateid, sizeof(stateid_t));
-               SET_STATE_ID(cstate, SAVED_STATE_ID_FLAG);
+               SET_CSTATE_FLAG(cstate, SAVED_STATE_ID_FLAG);
        }
        return nfs_ok;
 }
index 31b71aed4230b3bf3358977cb82f152453672361..ed5e80b3ac1f75841d425ad810ad528ea89f2bce 100644 (file)
@@ -7930,7 +7930,8 @@ nfs4_state_shutdown(void)
 static void
 get_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid)
 {
-       if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG) && CURRENT_STATEID(stateid))
+       if (HAS_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG) &&
+           CURRENT_STATEID(stateid))
                memcpy(stateid, &cstate->current_stateid, sizeof(stateid_t));
 }
 
@@ -7939,14 +7940,14 @@ put_stateid(struct nfsd4_compound_state *cstate, stateid_t *stateid)
 {
        if (cstate->minorversion) {
                memcpy(&cstate->current_stateid, stateid, sizeof(stateid_t));
-               SET_STATE_ID(cstate, CURRENT_STATE_ID_FLAG);
+               SET_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG);
        }
 }
 
 void
 clear_current_stateid(struct nfsd4_compound_state *cstate)
 {
-       CLEAR_STATE_ID(cstate, CURRENT_STATE_ID_FLAG);
+       CLEAR_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG);
 }
 
 /*
index 2937e06f355484cf715e6c982d611f95a623de47..0b4fe0795b720f7b9070bf91afa14d4fe8a1cf27 100644 (file)
@@ -46,9 +46,9 @@
 #define CURRENT_STATE_ID_FLAG (1<<0)
 #define SAVED_STATE_ID_FLAG (1<<1)
 
-#define SET_STATE_ID(c, f) ((c)->sid_flags |= (f))
-#define HAS_STATE_ID(c, f) ((c)->sid_flags & (f))
-#define CLEAR_STATE_ID(c, f) ((c)->sid_flags &= ~(f))
+#define SET_CSTATE_FLAG(c, f) ((c)->sid_flags |= (f))
+#define HAS_CSTATE_FLAG(c, f) ((c)->sid_flags & (f))
+#define CLEAR_CSTATE_FLAG(c, f) ((c)->sid_flags &= ~(f))
 
 struct nfsd4_compound_state {
        struct svc_fh           current_fh;