]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: remove all refs to unused buf_GetNew()
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 8 Jan 2011 17:19:07 +0000 (12:19 -0500)
committerDerrick Brashear <shadow@dementia.org>
Thu, 3 Feb 2011 11:26:21 +0000 (03:26 -0800)
Reviewed-on: http://gerrit.openafs.org/3629
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit f58b17a6150f8d303b408f9eed27bf0e850ec580)

Change-Id: Ideb8532a8de53152aa902834d7dd012a464ad000
Reviewed-on: http://gerrit.openafs.org/3815
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/WINNT/afsd/cm_buf.c
src/WINNT/afsd/cm_buf.h
src/WINNT/afsd/cm_dcache.c

index 72cc7ffe2027049d53ecbddb248690f78ce6a279..af6aaa5eb0eb345be89907c69b0317dc0d51d406 100644 (file)
@@ -1130,61 +1130,12 @@ long buf_GetNewLocked(struct cm_scache *scp, osi_hyper_t *offsetp, cm_req_t *req
     /* not reached */
 } /* the proc */
 
-/* get a page, returning it held but unlocked.  Doesn't fill in the page
- * with I/O, since we're going to write the whole thing new.
+/*
+ * get a page, returning it held but unlocked.  the page may or may not
+ * contain valid data.
+ *
+ * The scp must be unlocked when passed in unlocked.
  */
-long buf_GetNew(struct cm_scache *scp, osi_hyper_t *offsetp, cm_req_t *reqp, cm_buf_t **bufpp)
-{
-    cm_buf_t *bp;
-    long code;
-    osi_hyper_t pageOffset;
-    int created;
-
-    created = 0;
-    pageOffset.HighPart = offsetp->HighPart;
-    pageOffset.LowPart = offsetp->LowPart & ~(cm_data.buf_blockSize-1);
-    while (1) {
-        bp = buf_Find(scp, &pageOffset);
-        if (bp) {
-            /* lock it and break out */
-            lock_ObtainMutex(&bp->mx);
-            break;
-        }
-
-        /* otherwise, we have to create a page */
-        code = buf_GetNewLocked(scp, &pageOffset, reqp, &bp);
-
-        /* check if the buffer was created in a race condition branch.
-         * If so, go around so we can hold a reference to it. 
-         */
-        if (code == CM_BUF_EXISTS) 
-            continue;
-
-        /* something else went wrong */
-        if (code != 0) 
-            return code;
-
-        /* otherwise, we have a locked buffer that we just created */
-        created = 1;
-        break;
-    } /* big while loop */
-
-    /* wait for reads */
-    if (bp->flags & CM_BUF_READING)
-        buf_WaitIO(scp, bp);
-
-    /* once it has been read once, we can unlock it and return it, still
-     * with its refcount held.
-     */
-    lock_ReleaseMutex(&bp->mx);
-    *bufpp = bp;
-    osi_Log4(buf_logp, "buf_GetNew returning bp 0x%p for scp 0x%p, offset 0x%x:%08x",
-              bp, scp, offsetp->HighPart, offsetp->LowPart);
-    return 0;
-}
-
-/* get a page, returning it held but unlocked.  Make sure it is complete */
-/* The scp must be unlocked when passed to this function */
 long buf_Get(struct cm_scache *scp, osi_hyper_t *offsetp, cm_req_t *reqp, cm_buf_t **bufpp)
 {
     cm_buf_t *bp;
index 5fe6fb9deb3b70490b4321236fb9ff05091834d6..670cb9497aa60b8d4acea25fc07e4215e4d54a63 100644 (file)
@@ -173,8 +173,6 @@ extern long buf_GetNewLocked(struct cm_scache *, osi_hyper_t *, cm_req_t *, cm_b
 
 extern long buf_Get(struct cm_scache *, osi_hyper_t *, cm_req_t *, cm_buf_t **);
 
-extern long buf_GetNew(struct cm_scache *, osi_hyper_t *, cm_req_t *, cm_buf_t **);
-
 extern afs_uint32 buf_CleanAsyncLocked(cm_scache_t *, cm_buf_t *, cm_req_t *, afs_uint32 flags, afs_uint32 *);
 
 extern afs_uint32 buf_CleanAsync(cm_scache_t *, cm_buf_t *, cm_req_t *, afs_uint32 flags, afs_uint32 *);
index c9b1762a9ff2e03071018abd7e2a415c31c22dbd..9a09c106a22932fe90ea43d8e4b34befa08e129b 100644 (file)
@@ -74,7 +74,7 @@ long cm_BufWrite(void *vscp, osi_hyper_t *offsetp, long length, long flags,
 
     memset(&volSync, 0, sizeof(volSync));
 
-    /* now, the buffer may or may not be filled with good data (buf_GetNew
+    /* now, the buffer may or may not be filled with good data (buf_GetNewLocked
      * drops lots of locks, and may indeed return a properly initialized
      * buffer, although more likely it will just return a new, empty, buffer.
      */
@@ -1607,7 +1607,7 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *userp
 
     memset(&volSync, 0, sizeof(volSync));
 
-    /* now, the buffer may or may not be filled with good data (buf_GetNew
+    /* now, the buffer may or may not be filled with good data (buf_GetNewLocked
      * drops lots of locks, and may indeed return a properly initialized
      * buffer, although more likely it will just return a new, empty, buffer.
      */