ubik: remove unused code 25/13325/3
authorMark Vitale <mvitale@sinenomine.net>
Wed, 9 Nov 2016 21:58:00 +0000 (16:58 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 24 Sep 2018 00:57:31 +0000 (20:57 -0400)
ubik_GetVersion and ubik_WaitVersion have been unused since at least
OpenAFS 1.0.  Remove them.

No functional change should be incurred by this commit.

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

doc/txt/ubik.txt
src/ptserver/ptubik.c
src/ubik/ubik.c
src/ubik/ubik.p.h

index 547654f..8a649f3 100644 (file)
@@ -90,14 +90,6 @@ MAJOR DATA STRUCTURES
       thread to examine them without holding the database lock; see the
       section on the BEACON package for details.
 
-      The condition variable 'version_cond' is used to signal to that the
-      database version may have changed; it is broadcast in udisk_commit(),
-      in SDISK_SendFile(), and from the recovery thread; it is monitored by
-      ubik_WaitVersion(), which can be called by an application to wait for
-      a database version change (this is not currently used in OpenAFS).
-      This CV is associated with the database lock.  When LWP is used, this
-      condition is signalled on &ubik_dbase->version.
-
       The condition variable 'flags_cond' is used by udisk_end() to signal
       that DBWRITING flag has been cleared.  This wakes threads waiting in
       ubik.c:BeginTrans() to begin a new transaction.  This CV is
@@ -1165,12 +1157,6 @@ MAJOR SUBSYSTEMS
 
       Utilities
 
-         The functions ubik_GetVersion() and ubik_WaitVersion() provide the
-         application with a way to discover the current database version
-         and to wait for it to change.  These interfaces are not currently
-         used in OpenAFS.  ubik_GetVersion() needs to acquire the database
-         lock while copying the database version.
-
          The internal function ubikGetPrimaryInterfaceAddr() is used by
          Ubik RPCs to determine a peer server's primary address, given the
          IP address from which a call arrived.  This needs to hold the
index 3c9e946..8e8dfe3 100644 (file)
@@ -93,13 +93,6 @@ ubik_SetLock(struct ubik_trans *atrans, afs_int32 apos, afs_int32 alen,
 }
 
 int
-ubik_WaitVersion(struct ubik_dbase *adatabase,
-                 struct ubik_version *aversion)
-{
-    return (0);
-}
-
-int
 ubik_CheckCache(struct ubik_trans *atrans, ubik_updatecache_func cbf, void *rock)
 {
     return (*cbf)(atrans, rock);
@@ -120,14 +113,6 @@ panic(char *format, ...)
 }
 
 int
-ubik_GetVersion(struct ubik_trans *dummy, struct ubik_version *ver)
-{
-    memset(ver, 0, sizeof(struct ubik_version));
-    return (0);
-}
-
-
-int
 ubik_Seek(struct ubik_trans *tt, afs_int32 afd, afs_int32 pos)
 {
     if (lseek(dbase_fd, pos + HDRSIZE, 0) < 0) {
index f8a8b48..30e8cab 100644 (file)
@@ -1255,43 +1255,6 @@ ubik_SetLock(struct ubik_trans *atrans, afs_int32 apos, afs_int32 alen,
 }
 
 /*!
- * \brief utility to wait for a version # to change
- */
-int
-ubik_WaitVersion(struct ubik_dbase *adatabase,
-                struct ubik_version *aversion)
-{
-    DBHOLD(adatabase);
-    while (1) {
-       /* wait until version # changes, and then return */
-       if (vcmp(*aversion, adatabase->version) != 0) {
-           DBRELE(adatabase);
-           return 0;
-       }
-#ifdef AFS_PTHREAD_ENV
-       opr_cv_wait(&adatabase->version_cond, &adatabase->versionLock);
-#else
-       DBRELE(adatabase);
-       LWP_WaitProcess(&adatabase->version);   /* same vers, just wait */
-       DBHOLD(adatabase);
-#endif
-    }
-}
-
-/*!
- * \brief utility to get the version of the dbase a transaction is dealing with
- */
-int
-ubik_GetVersion(struct ubik_trans *atrans,
-               struct ubik_version *avers)
-{
-    DBHOLD(atrans->dbase);
-    *avers = atrans->dbase->version;
-    DBRELE(atrans->dbase);
-    return 0;
-}
-
-/*!
  * \brief Facility to simplify database caching.
  * \return zero if last trans was done on the local server and was successful.
  * \return -1 means bad (NULL) argument.
index 4585ba9..dad1110 100644 (file)
@@ -572,10 +572,6 @@ extern int ubik_Truncate(struct ubik_trans *transPtr,
                         afs_int32 length);
 extern int ubik_SetLock(struct ubik_trans *atrans, afs_int32 apos,
                        afs_int32 alen, int atype);
-extern int ubik_WaitVersion(struct ubik_dbase *adatabase,
-                           struct ubik_version *aversion);
-extern int ubik_GetVersion(struct ubik_trans *atrans,
-                          struct ubik_version *avers);
 extern int ubik_CheckCache(struct ubik_trans *atrans,
                            ubik_updatecache_func check,
                            void *rock);