]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
volser: dont double-stat vnodes when dumping
authorDerrick Brashear <shadow@dementix.org>
Tue, 13 Sep 2011 19:27:37 +0000 (15:27 -0400)
committerDerrick Brashear <shadow@dementix.org>
Wed, 28 Sep 2011 14:02:36 +0000 (07:02 -0700)
we get the size, then we get it again. no clue why. let's just not.

Reviewed-on: http://gerrit.openafs.org/5398
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 6c18c8844f3be6e006c7f59b3cc36f5b1688e04f)

Change-Id: I743432161a80799e11875cdbcb09b1b15d681d77
Reviewed-on: http://gerrit.openafs.org/5413
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/volser/dumpstuff.c

index cd2294c7541afda892e57062f9b5f29d0e745da6..6c6fa3119c8c58018faa0bb280f3dd228fbc97bf 100644 (file)
@@ -716,7 +716,6 @@ DumpFile(struct iod *iodp, int vnode, FdHandle_t * handleP)
 #ifndef AFS_NT40_ENV
     struct afs_stat status;
 #endif
-    afs_sfsize_t size;
 #ifdef AFS_AIX_ENV
 #include <sys/statfs.h>
 #if defined(AFS_AIX52_ENV)
@@ -755,8 +754,7 @@ DumpFile(struct iod *iodp, int vnode, FdHandle_t * handleP)
 #endif /* AFS_NT40_ENV */
 
 
-    size = FDH_SIZE(handleP);
-    SplitInt64(size, hi, lo);
+    SplitInt64(howBig, hi, lo);
     if (hi == 0L) {
        code = DumpInt32(iodp, 'f', lo);
     } else {
@@ -772,7 +770,7 @@ DumpFile(struct iod *iodp, int vnode, FdHandle_t * handleP)
        return VOLSERDUMPERROR;
     }
 
-    for (nbytes = size; (nbytes && !error); nbytes -= howMany) {
+    for (nbytes = howBig; (nbytes && !error); nbytes -= howMany) {
        if (nbytes < howMany)
            howMany = nbytes;
 
@@ -812,7 +810,7 @@ DumpFile(struct iod *iodp, int vnode, FdHandle_t * handleP)
            /* Now seek over the data we could not get. An error here means we
             * can't do the next read.
             */
-           howFar = (size_t)((size - nbytes) + howMany);
+           howFar = (size_t)((howBig - nbytes) + howMany);
        }
 
        /* Now write the data out */