ubik: Rename flags to dbFlags 64/13864/4
authorAndrew Deason <adeason@sinenomine.net>
Thu, 12 Sep 2019 19:36:04 +0000 (14:36 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 13 Mar 2020 16:44:47 +0000 (12:44 -0400)
Rename ubik_dbase->flags to ubik_dbase->dbFlags, to make it easier to
distinguish between other fields and variables just called 'flags'.

Change-Id: I17258f9a65e989943d066307e332550d66ca7500
Reviewed-on: https://gerrit.openafs.org/13864
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/ubik/beacon.c
src/ubik/disk.c
src/ubik/recovery.c
src/ubik/ubik.c
src/ubik/ubik.p.h
src/ubik/vote.c

index 1642f22..305a118 100644 (file)
@@ -498,7 +498,7 @@ ubeacon_Interact(void *dummy)
 
        UBIK_VERSION_LOCK;
        ttid.epoch = version_globals.ubik_epochTime;
-       if (ubik_dbase->flags & DBWRITING) {
+       if (ubik_dbase->dbFlags & DBWRITING) {
            /*
             * if a write is in progress, we have to send the writeTidCounter
             * which holds the tid counter of the write transaction , and not
index a000925..5b74369 100644 (file)
@@ -803,7 +803,7 @@ udisk_begin(struct ubik_dbase *adbase, int atype, struct ubik_trans **atrans)
 
     *atrans = NULL;
     if (atype == UBIK_WRITETRANS) {
-       if (adbase->flags & DBWRITING)
+       if (adbase->dbFlags & DBWRITING)
            return USYNC;
        code = udisk_LogOpcode(adbase, LOGNEW, 0);
        if (code)
@@ -818,7 +818,7 @@ udisk_begin(struct ubik_dbase *adbase, int atype, struct ubik_trans **atrans)
        adbase->readers++;
     else if (atype == UBIK_WRITETRANS) {
        UBIK_VERSION_LOCK;
-       adbase->flags |= DBWRITING;
+       adbase->dbFlags |= DBWRITING;
        UBIK_VERSION_UNLOCK;
     }
     *atrans = tt;
@@ -937,7 +937,7 @@ udisk_abort(struct ubik_trans *atrans)
      * will do nothing because the abort is there or no LogEnd opcode.
      */
     dbase = atrans->dbase;
-    if (atrans->type == UBIK_WRITETRANS && dbase->flags & DBWRITING) {
+    if (atrans->type == UBIK_WRITETRANS && dbase->dbFlags & DBWRITING) {
        udisk_LogOpcode(dbase, LOGABORT, 1);
        code = (*dbase->truncate) (dbase, LOGFILE, 0);
        if (code)
@@ -973,9 +973,9 @@ udisk_end(struct ubik_trans *atrans)
     /* check if we are the write trans before unsetting the DBWRITING bit, else
      * we could be unsetting someone else's bit.
      */
-    if (atrans->type == UBIK_WRITETRANS && dbase->flags & DBWRITING) {
+    if (atrans->type == UBIK_WRITETRANS && dbase->dbFlags & DBWRITING) {
        UBIK_VERSION_LOCK;
-       dbase->flags &= ~DBWRITING;
+       dbase->dbFlags &= ~DBWRITING;
        UBIK_VERSION_UNLOCK;
     } else {
        dbase->readers--;
@@ -990,7 +990,7 @@ udisk_end(struct ubik_trans *atrans)
 #ifdef AFS_PTHREAD_ENV
     opr_cv_broadcast(&dbase->flags_cond);
 #else
-    LWP_NoYieldSignal(&dbase->flags);
+    LWP_NoYieldSignal(&dbase->dbFlags);
 #endif
     return 0;
 }
index 99b9fd8..414d1ad 100644 (file)
@@ -784,11 +784,11 @@ urecovery_Interact(void *dummy)
             * the write-lock above if there is a write transaction in progress,
             * but then, it won't hurt to check, will it?
             */
-           if (ubik_dbase->flags & DBWRITING) {
+           if (ubik_dbase->dbFlags & DBWRITING) {
                struct timeval tv;
                int safety = 0;
                long cur_usec = 50000;
-               while ((ubik_dbase->flags & DBWRITING) && (safety < 500)) {
+               while ((ubik_dbase->dbFlags & DBWRITING) && (safety < 500)) {
                    DBRELE(ubik_dbase);
                    /* sleep for a little while */
                    tv.tv_sec = 0;
index f93a1bc..6adf9dd 100644 (file)
@@ -618,12 +618,12 @@ BeginTrans(struct ubik_dbase *dbase, afs_int32 transMode,
      * don't know how to restore one without possibly picking up some data from the other. */
     if (transMode == UBIK_WRITETRANS) {
        /* if we're writing already, wait */
-       while (dbase->flags & DBWRITING) {
+       while (dbase->dbFlags & DBWRITING) {
 #ifdef AFS_PTHREAD_ENV
            opr_cv_wait(&dbase->flags_cond, &dbase->versionLock);
 #else
            DBRELE(dbase);
-           LWP_WaitProcess(&dbase->flags);
+           LWP_WaitProcess(&dbase->dbFlags);
            DBHOLD(dbase);
 #endif
        }
index 66c03a8..cfd12f7 100644 (file)
@@ -144,7 +144,7 @@ struct ubik_dbase {
 #endif
     afs_int32 tidCounter;      /*!< last RW or RO trans tid counter */
     afs_int32 writeTidCounter; /*!< last write trans tid counter */
-    afs_int32 flags;           /*!< flags */
+    afs_int32 dbFlags;         /*!< flags */
     /* physio procedures */
     int (*read) (struct ubik_dbase * adbase, afs_int32 afile, void *abuffer,
                 afs_int32 apos, afs_int32 alength);
@@ -417,7 +417,7 @@ struct addr_data {
 
 /*!
  * \brief The version lock protects the structure member, as well as
- * the database version, flags, tidCounter, writeTidCounter. Reading these
+ * the database version, dbFlags, tidCounter, writeTidCounter. Reading these
  * values can be done while holding either UBIK_VERSION_LOCK or DBHOLD. Writing
  * these requires holding both locks.
  */
index 1ae7456..e7a3577 100644 (file)
@@ -439,7 +439,7 @@ SVOTE_Debug(struct rx_call * rxcall, struct ubik_debug * aparm)
        && (urecovery_state & UBIK_RECHAVEDB)) {
        aparm->recoveryState |= UBIK_RECLABELDB;
     }
-    aparm->activeWrite = (ubik_dbase->flags & DBWRITING);
+    aparm->activeWrite = (ubik_dbase->dbFlags & DBWRITING);
     aparm->tidCounter = ubik_dbase->tidCounter;
 
     if (ubik_currentTrans) {
@@ -519,7 +519,7 @@ SVOTE_DebugOld(struct rx_call * rxcall,
        && (urecovery_state & UBIK_RECHAVEDB)) {
        aparm->recoveryState |= UBIK_RECLABELDB;
     }
-    aparm->activeWrite = (ubik_dbase->flags & DBWRITING);
+    aparm->activeWrite = (ubik_dbase->dbFlags & DBWRITING);
     aparm->tidCounter = ubik_dbase->tidCounter;
 
     if (ubik_currentTrans) {