volser: Remove masked assignment in vol_split
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 19 Feb 2013 14:51:30 +0000 (14:51 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 22 Feb 2013 06:03:23 +0000 (22:03 -0800)
The declaration (and assignment) to size at the outermost scope
in the copyVnodes function is masked by a later declaration at a
inner scope.

Just remove the outer declaration to clarify what's happening.

Caught by clang-analyzer

Change-Id: If23bdcf8a4c2d23d6224762fecce35be9cf15873
Reviewed-on: http://gerrit.openafs.org/9168
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/volser/vol_split.c

index 5b39496..29f5646 100644 (file)
@@ -314,7 +314,6 @@ afs_int32 copyVnodes(struct Msg *m, Volume *vol, Volume *newvol,
     FdHandle_t *newfdP = 0;
     struct VnodeClassInfo *vcp = &VnodeClassInfo[class];
     struct VnodeExtract *e;
-    afs_sfsize_t size;
     afs_uint64 offset;
     Inode ino, newino;
 
@@ -332,7 +331,6 @@ afs_int32 copyVnodes(struct Msg *m, Volume *vol, Volume *newvol,
        code = EIO;
        goto Bad_Copy;
     }
-    size = FDH_SIZE(fdP);
 
     for (i=0; i<length; i++) {
        e = &list[i];
@@ -434,7 +432,7 @@ afs_int32 copyVnodes(struct Msg *m, Volume *vol, Volume *newvol,
        IHandle_t *h, *newh;
         char buf2[SIZEOF_LARGEDISKVNODE];
         struct VnodeDiskObject *vnode2 = (struct VnodeDiskObject *)&buf2;
-       afs_uint64 newoffset;
+       afs_uint64 newoffset, size;
 
        newoffset = vcp->diskSize;
        if (FDH_PREAD(newfdP, vnode2, vcp->diskSize, newoffset) != vcp->diskSize) {