]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
volinfo: fix size totals when saving inodes
authorMichael Meffie <mmeffie@sinenomine.net>
Fri, 20 May 2011 18:44:39 +0000 (14:44 -0400)
committerDerrick Brashear <shadow@dementix.org>
Fri, 16 Dec 2011 11:02:24 +0000 (03:02 -0800)
Fix the volume size calculation when volinfo is invoked with
both -sizeOnly and -saveinodes at the same time.

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

Change-Id: I371a983078c12e09474051ba71f63cdeb57c3631
Reviewed-on: http://gerrit.openafs.org/6301
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/vol/vol-info.c

index e592cf899dbf6fa61de0f9359155d5d1d5fb48f4..a1ab3d35ec43600777449839f717e968ca2e37f2 100644 (file)
@@ -791,7 +791,16 @@ PrintVnodes(Volume * vp, VnodeClass class)
 
        ino = VNDISK_GET_INO(vnode);
        if (saveinodes) {
-           if (VALID_INO(ino) && (class == vSmall)) {
+           if (!VALID_INO(ino)) {
+               continue;
+           }
+           if (dsizeOnly && (class == vLarge)) {
+               afs_fsize_t fileLength;
+
+               VNDISK_GET_LEN(fileLength, vnode);
+               Vvnodesize += fileLength;
+               Vvnodesize_k += fileLength / 1024;
+           } else if (class == vSmall) {
                IHandle_t *ih1;
                FdHandle_t *fdP1;
                IH_INIT(ih1, V_device(vp), V_parentId(vp), ino);