From: Michael Meffie Date: Fri, 20 May 2011 18:44:39 +0000 (-0400) Subject: volinfo: fix size totals when saving inodes X-Git-Tag: upstream/1.6.1.pre1^2~35 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=81d44944794748ff3211158d3a1c0c9746100b8e;p=packages%2Fo%2Fopenafs.git volinfo: fix size totals when saving inodes 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 Reviewed-by: Derrick Brashear (cherry picked from commit ababc1ba4412ae94b29f8ba0832eac087a024af2) Change-Id: I371a983078c12e09474051ba71f63cdeb57c3631 Reviewed-on: http://gerrit.openafs.org/6301 Reviewed-by: Michael Meffie Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- diff --git a/src/vol/vol-info.c b/src/vol/vol-info.c index e592cf899..a1ab3d35e 100644 --- a/src/vol/vol-info.c +++ b/src/vol/vol-info.c @@ -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);