volser: Set but not used variables
authorMarc Dionne <marc.c.dionne@gmail.com>
Sat, 11 Sep 2010 15:11:18 +0000 (11:11 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 27 Sep 2010 15:21:55 +0000 (08:21 -0700)
Fix instances of variables defined and set but never used in the
volser directory.

Spotted by gcc 4.6

Change-Id: Ibb1896cdde51985d1c14b563f8a6de6cec90403f
Reviewed-on: http://gerrit.openafs.org/2852
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/volser/vol_split.c
src/volser/volprocs.c
src/volser/vos.c
src/volser/vsprocs.c

index eb5b084..211ae29 100644 (file)
@@ -665,12 +665,10 @@ deleteVnodes(Volume *vol, afs_int32 class,
        code = EIO;
        goto Bad_Delete;
     }
-    size = FDH_SIZE(fdP);
 
     for (i=0; i<length; i++) {
        e = &list[i];
        if (e->flag & NEEDED) {
-           afs_uint64 size;
            offset = (e->vN + 1 - class) << (vcp->logSize -1);
            if (FDH_PREAD(fdP, vnode, vcp->diskSize, offset) != vcp->diskSize) {
                Log("Couldn't read in %s Index of volume %u at offset %"
index 59e8490..94f4586 100644 (file)
@@ -2328,7 +2328,6 @@ static afs_int32
 VolListOneVolume(struct rx_call *acid, afs_int32 partid,
                  afs_uint32 volumeId, volEntries *volumeInfo)
 {
-    volintInfo *pntr;
     struct DiskPartition64 *partP;
     char pname[9], volname[20];
     DIR *dirp;
@@ -2342,7 +2341,6 @@ VolListOneVolume(struct rx_call *acid, afs_int32 partid,
        return ENOMEM;
     memset(volumeInfo->volEntries_val, 0, sizeof(volintInfo)); /* Clear structure */
 
-    pntr = volumeInfo->volEntries_val;
     volumeInfo->volEntries_len = 1;
     if (GetPartName(partid, pname))
        return VOLSERILLEGAL_PARTITION;
@@ -2428,7 +2426,6 @@ VolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID,
                   afs_uint32 a_volID, volXEntries *a_volumeXInfoP)
 {                              /*SAFSVolXListOneVolume */
 
-    volintXInfo *xInfoP;       /*Ptr to the extended vol info */
     struct DiskPartition64 *partP;     /*Ptr to partition */
     char pname[9], volname[20];        /*Partition, volume names */
     DIR *dirp;                 /*Partition directory ptr */
@@ -2447,7 +2444,6 @@ VolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID,
        return ENOMEM;
     memset(a_volumeXInfoP->volXEntries_val, 0, sizeof(volintXInfo)); /* Clear structure */
 
-    xInfoP = a_volumeXInfoP->volXEntries_val;
     a_volumeXInfoP->volXEntries_len = 1;
     code = ENODEV;
 
index 391ff34..6181465 100644 (file)
@@ -2998,13 +2998,10 @@ RestoreVolumeCmd(struct cmd_syndesc *as, void *arock)
     afs_int32 acreation = 0, alastupdate = 0;
     int restoreflags = 0;
     int readonly = 0, offline = 0, voltype = RWVOL;
-    char prompt;
     char afilename[MAXPATHLEN], avolname[VOLSER_MAXVOLNAME + 1], apartName[10];
     char volname[VOLSER_MAXVOLNAME + 1];
     struct nvldbentry entry;
 
-    prompt = 'n';
-
     aparentid = 0;
     if (as->parms[4].items) {
        avolid = vsu_GetVolumeID(as->parms[4].items->data, cstruct, &err);
index 034cf68..405a62d 100644 (file)
@@ -398,9 +398,6 @@ PrintError(char *msg, afs_int32 errcode)
        break;
     default:
        {
-
-           afs_int32 offset;
-
            initialize_KA_error_table();
            initialize_RXK_error_table();
            initialize_KTC_error_table();
@@ -408,7 +405,6 @@ PrintError(char *msg, afs_int32 errcode)
            initialize_CMD_error_table();
            initialize_VL_error_table();
 
-           offset = errcode & ((1 << ERRCODE_RANGE) - 1);
            fprintf(STDERR, "%s: %s\n", afs_error_table_name(errcode),
                    afs_error_message(errcode));
            break;
@@ -2244,13 +2240,10 @@ UV_CopyVolume2(afs_uint32 afromvol, afs_uint32 afromserver, afs_int32 afrompart,
     struct volser_status tstatus;
     struct destServer destination;
     struct nvldbentry entry, newentry, storeEntry;
-    int islocked;
     afs_int32 error;
     afs_int32 tmp;
     afs_uint32 tmpVol;
-    int justclone = 0;
 
-    islocked = 0;
     fromconn = (struct rx_connection *)0;
     toconn = (struct rx_connection *)0;
     fromtid = 0;
@@ -2276,12 +2269,6 @@ UV_CopyVolume2(afs_uint32 afromvol, afs_uint32 afromserver, afs_int32 afrompart,
     fromconn = UV_Bind(afromserver, AFSCONF_VOLUMEPORT);
     fromtid = totid = 0;       /* initialize to uncreated */
 
-
-    /* check if we can shortcut and use a local clone instead of a full copy */
-    if (afromserver == atoserver && afrompart == atopart) {
-       justclone = 1;
-    }
-
     /* ***
      * clone the read/write volume locally.
      * ***/
@@ -3402,7 +3389,7 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver,
     manyResults results;
     int rwindex, roindex, roclone, roexists;
     afs_uint32 rwcrdate = 0;
-    afs_uint32 rwupdate, clcrdate;
+    afs_uint32 clcrdate;
     struct rtime {
        int validtime;
        afs_uint32 uptime;
@@ -3503,7 +3490,6 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver,
            ONERROR(code, afromvol,
                    "Failed to get the status of RW volume %u\n");
            rwcrdate = volstatus.creationDate;
-           rwupdate = volstatus.updateDate;
 
            /* End transaction on RW */
            code = AFSVolEndTrans(fromconn, fromtid, &rcode);
@@ -3611,7 +3597,6 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver,
                "Failed to get the status of the RW volume %u\n");
        VDONE;
        rwcrdate = volstatus.creationDate;
-       rwupdate = volstatus.updateDate;
 
        /* End the transaction on the RW volume */
        VPRINT1("Ending cloning transaction on RW volume %u...", afromvol);
@@ -4988,7 +4973,6 @@ UV_RemoveSite(afs_uint32 server, afs_int32 part, afs_uint32 volid)
 {
     afs_int32 vcode;
     struct nvldbentry entry, storeEntry;
-    int islocked;
 
     vcode = ubik_VL_SetLock(cstruct, 0, volid, RWVOL, VLOP_ADDSITE);
     if (vcode) {
@@ -4997,7 +4981,6 @@ UV_RemoveSite(afs_uint32 server, afs_int32 part, afs_uint32 volid)
        PrintError("", vcode);
        return (vcode);
     }
-    islocked = 1;
     vcode = VLDB_GetEntryByID(volid, RWVOL, &entry);
     if (vcode) {
        fprintf(STDERR,
@@ -5564,7 +5547,7 @@ CheckVolume(volintInfo * volumeinfo, afs_uint32 aserver, afs_int32 apart,
     afs_int32 code, error = 0;
     struct nvldbentry entry, storeEntry;
     char pname[10];
-    int pass = 0, islocked = 0, createentry, addvolume, modified, mod, doit = 1;
+    int pass = 0, createentry, addvolume, modified, mod, doit = 1;
     afs_uint32 rwvolid;
     char hoststr[16];
 
@@ -5589,7 +5572,6 @@ CheckVolume(volintInfo * volumeinfo, afs_uint32 aserver, afs_int32 apart,
                    (unsigned long)rwvolid);
            ERROR_EXIT(code);
        }
-       islocked = 1;
     }
 
     createentry = 0;           /* Do we need to create a VLDB entry */