ubik: Remove version_cond 61/13361/2
authorAndrew Deason <adeason@sinenomine.net>
Sat, 20 Oct 2018 21:56:57 +0000 (16:56 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 26 Oct 2018 13:29:45 +0000 (09:29 -0400)
Several areas in the code do something like this whenever the database
version is changed:

    #ifdef AFS_PTHREAD_ENV
        opr_cv_broadcast(&ubik_dbase->version_cond);
    #else
        LWP_NoYieldSignal(&ubik_dbase->version);
    #endif

However, ever since commit 3fae4ea1 (ubik: remove unused code),
nothing in the tree waits for this condvar, so it currently doesn't do
anything. Remove this unneeded code.

Change-Id: I6903ed89f9dcee2ce154be8883d656d297c97902
Reviewed-on: https://gerrit.openafs.org/13361
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/ubik/disk.c
src/ubik/recovery.c
src/ubik/remote.c
src/ubik/ubik.c
src/ubik/ubik.p.h

index ed2b55b..a000925 100644 (file)
@@ -877,11 +877,6 @@ udisk_commit(struct ubik_trans *atrans)
 
        UBIK_VERSION_LOCK;
        dbase->version.counter++;       /* bump commit count */
-#ifdef AFS_PTHREAD_ENV
-       opr_cv_broadcast(&dbase->version_cond);
-#else
-       LWP_NoYieldSignal(&dbase->version);
-#endif
        code = udisk_LogEnd(dbase, &dbase->version);
        if (code) {
            dbase->version.counter--;
index 27a3588..1936d5d 100644 (file)
@@ -382,11 +382,6 @@ InitializeDB(struct ubik_dbase *adbase)
            adbase->version.counter = 0;
            (*adbase->setlabel) (adbase, 0, &adbase->version);
        }
-#ifdef AFS_PTHREAD_ENV
-       opr_cv_broadcast(&adbase->version_cond);
-#else
-       LWP_NoYieldSignal(&adbase->version);
-#endif
        UBIK_VERSION_UNLOCK;
     }
     return 0;
@@ -739,11 +734,6 @@ urecovery_Interact(void *dummy)
                urecovery_state |= UBIK_RECHAVEDB;
            }
            udisk_Invalidate(ubik_dbase, 0);    /* data has changed */
-#ifdef AFS_PTHREAD_ENV
-           opr_cv_broadcast(&ubik_dbase->version_cond);
-#else
-           LWP_NoYieldSignal(&ubik_dbase->version);
-#endif
        }
        if (!(urecovery_state & UBIK_RECHAVEDB)) {
            DBRELE(ubik_dbase);
@@ -764,11 +754,6 @@ urecovery_Interact(void *dummy)
                (*ubik_dbase->setlabel) (ubik_dbase, 0, &ubik_dbase->version);
            UBIK_VERSION_UNLOCK;
            udisk_Invalidate(ubik_dbase, 0);    /* data may have changed */
-#ifdef AFS_PTHREAD_ENV
-           opr_cv_broadcast(&ubik_dbase->version_cond);
-#else
-           LWP_NoYieldSignal(&ubik_dbase->version);
-#endif
        }
 
        /* Check the other sites and send the database to them if they
index fafce4f..6874c6a 100644 (file)
@@ -605,11 +605,6 @@ SDISK_SendFile(struct rx_call *rxcall, afs_int32 file,
 #endif
     memcpy(&ubik_dbase->version, avers, sizeof(struct ubik_version));
     udisk_Invalidate(dbase, file);     /* new dbase, flush disk buffers */
-#ifdef AFS_PTHREAD_ENV
-    opr_Assert(pthread_cond_broadcast(&dbase->version_cond) == 0);
-#else
-    LWP_NoYieldSignal(&dbase->version);
-#endif
 
 failed_locked:
     UBIK_VERSION_UNLOCK;
index 30e8cab..a1aee0c 100644 (file)
@@ -438,7 +438,6 @@ ubik_ServerInitCommon(afs_uint32 myHost, short myPort,
     ubik_dbase = tdb;          /* for now, only one db per server; can fix later when we have names for the other dbases */
 
 #ifdef AFS_PTHREAD_ENV
-    opr_cv_init(&tdb->version_cond);
     opr_cv_init(&tdb->flags_cond);
 #endif /* AFS_PTHREAD_ENV */
 
index dad1110..44b57c8 100644 (file)
@@ -164,7 +164,6 @@ struct ubik_dbase {
     struct ubik_version cachedVersion; /*!< version of caller's cached data */
     struct Lock cache_lock; /*!< protects cached application data */
 #ifdef AFS_PTHREAD_ENV
-    pthread_cond_t version_cond;    /*!< condition variable to manage changes to version */
     pthread_cond_t flags_cond;      /*!< condition variable to manage changes to flags */
 #endif
 };