mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
volser: clean up and clarify storeEntry usage
In several routines in vsprocs.c, we declare and clear nvldbentry storeEntry long before it is actually needed. Instead, where possible, move the declaration and memset of storeEntry closer to the actual point of use. No functional change is incurred by this commit. Change-Id: Iffbf5ff56fab4d221586dfb93bbbbfde063c856e Reviewed-on: https://gerrit.openafs.org/14353 Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
This commit is contained in:
parent
ab660e2537
commit
f3b5bb9a05
@ -854,13 +854,11 @@ UV_DeleteVolume(afs_uint32 aserver, afs_int32 apart, afs_uint32 avolid)
|
||||
afs_int32 ttid = 0;
|
||||
afs_int32 code, rcode;
|
||||
afs_int32 error = 0;
|
||||
struct nvldbentry entry, storeEntry;
|
||||
struct nvldbentry entry;
|
||||
int islocked = 0;
|
||||
afs_int32 avoltype = -1, vtype;
|
||||
int notondisk = 0, notinvldb = 0;
|
||||
|
||||
memset(&storeEntry, 0, sizeof(struct nvldbentry));
|
||||
|
||||
/* Find and read the VLDB entry for this volume */
|
||||
code = GetLockedEntry(avolid, avoltype, VLOP_DELETE, &entry);
|
||||
if (code) {
|
||||
@ -987,6 +985,9 @@ UV_DeleteVolume(afs_uint32 aserver, afs_int32 apart, afs_uint32 avolid)
|
||||
"Could not delete the VLDB entry for the volume %u \n",
|
||||
avolid);
|
||||
} else {
|
||||
struct nvldbentry storeEntry;
|
||||
|
||||
memset(&storeEntry, 0, sizeof(storeEntry));
|
||||
MapNetworkToHost(&entry, &storeEntry);
|
||||
code =
|
||||
VLDB_ReplaceEntry(avolid, vtype, &storeEntry,
|
||||
@ -2213,7 +2214,7 @@ UV_CopyVolume2(afs_uint32 afromvol, afs_uint32 afromserver, afs_int32 afrompart,
|
||||
afs_int32 volflag;
|
||||
struct volser_status tstatus;
|
||||
struct destServer destination;
|
||||
struct nvldbentry entry, newentry, storeEntry;
|
||||
struct nvldbentry entry, newentry;
|
||||
afs_int32 error;
|
||||
afs_int32 tmp;
|
||||
afs_uint32 tmpVol;
|
||||
@ -2524,6 +2525,8 @@ cpincr:
|
||||
}
|
||||
|
||||
if (!(flags & RV_NOVLDB)) {
|
||||
struct nvldbentry storeEntry;
|
||||
|
||||
/* create the vldb entry for the copied volume */
|
||||
strncpy(newentry.name, atovolname, VOLSER_OLDMAXVOLNAME);
|
||||
newentry.nServers = 1;
|
||||
@ -2683,7 +2686,7 @@ UV_BackupVolume(afs_uint32 aserver, afs_int32 apart, afs_uint32 avolid)
|
||||
afs_int32 ttid = 0, btid = 0;
|
||||
afs_uint32 backupID;
|
||||
afs_int32 code = 0, rcode = 0;
|
||||
struct nvldbentry entry, storeEntry;
|
||||
struct nvldbentry entry;
|
||||
afs_int32 error = 0;
|
||||
int vldblocked = 0, vldbmod = 0;
|
||||
|
||||
@ -2811,6 +2814,8 @@ UV_BackupVolume(afs_uint32 aserver, afs_int32 apart, afs_uint32 avolid)
|
||||
/* Now update the vldb - if modified */
|
||||
if (vldblocked) {
|
||||
if (vldbmod) {
|
||||
struct nvldbentry storeEntry;
|
||||
|
||||
MapNetworkToHost(&entry, &storeEntry);
|
||||
code =
|
||||
VLDB_ReplaceEntry(avolid, RWVOL, &storeEntry,
|
||||
@ -5443,7 +5448,7 @@ CheckVolume(volintInfo * volumeinfo, afs_uint32 aserver, afs_int32 apart,
|
||||
int idx = 0;
|
||||
int j;
|
||||
afs_int32 code, error = 0;
|
||||
struct nvldbentry entry, storeEntry;
|
||||
struct nvldbentry entry;
|
||||
char pname[10];
|
||||
int pass = 0, createentry, addvolume, modified, mod, doit = 1;
|
||||
afs_uint32 rwvolid;
|
||||
@ -5833,6 +5838,8 @@ CheckVolume(volintInfo * volumeinfo, afs_uint32 aserver, afs_int32 apart,
|
||||
*maxvolid = entry.volumeId[RWVOL];
|
||||
|
||||
if (modified && doit) {
|
||||
struct nvldbentry storeEntry;
|
||||
|
||||
MapNetworkToHost(&entry, &storeEntry);
|
||||
|
||||
if (createentry) {
|
||||
@ -6500,7 +6507,6 @@ static afs_int32
|
||||
CheckVldb(struct nvldbentry * entry, afs_int32 * modified, afs_int32 * deleted)
|
||||
{
|
||||
afs_int32 code, error = 0;
|
||||
struct nvldbentry storeEntry;
|
||||
int islocked = 0, mod, modentry, delentry = 0;
|
||||
int pass = 0, doit=1;
|
||||
|
||||
@ -6580,6 +6586,8 @@ CheckVldb(struct nvldbentry * entry, afs_int32 * modified, afs_int32 * deleted)
|
||||
}
|
||||
delentry = 1;
|
||||
} else {
|
||||
struct nvldbentry storeEntry;
|
||||
|
||||
/* Replace old entry with our new one */
|
||||
MapNetworkToHost(entry, &storeEntry);
|
||||
code =
|
||||
|
Loading…
Reference in New Issue
Block a user