vlserver: Consolidate VLDB entry server flag definitions
authorMarc Dionne <marc.c.dionne@gmail.com>
Mon, 23 Jan 2012 02:21:51 +0000 (21:21 -0500)
committerDerrick Brashear <shadow@dementix.org>
Tue, 24 Jan 2012 02:49:05 +0000 (18:49 -0800)
Group the definitions of server flags for VLDB entries in one place,
and rename VLSERVER_FLAG_UUID to make its name consistent with the
other flags.
This makes it easier to see the complete set of flags and avoid
conflicts.

Change-Id: I3b326e3d97bc297c0314cfc48f0a066c3ff0415e
Reviewed-on: http://gerrit.openafs.org/6615
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/WINNT/afsd/cm_volume.c
src/afs/afs_volume.c
src/libafscp/afscp_volume.c
src/vlserver/vldbint.xg
src/vlserver/vlprocs.c

index 6e3481e..59b17a4 100644 (file)
@@ -422,7 +422,7 @@ long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *
             roID = uvldbEntry.volumeId[1];
             bkID = uvldbEntry.volumeId[2];
             for ( i=0, j=0; code == 0 && i<nServers && j<NMAXNSERVERS; i++ ) {
-                if ( !(uvldbEntry.serverFlags[i] & VLSERVER_FLAG_UUID) ) {
+                if ( !(uvldbEntry.serverFlags[i] & VLSF_UUID) ) {
                     serverFlags[j] = uvldbEntry.serverFlags[i];
                     serverNumber[j] = uvldbEntry.serverNumber[i].time_low;
                     j++;
index 2602c3e..3cf7a2e 100644 (file)
@@ -1087,7 +1087,7 @@ LockAndInstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, int acell,
            continue;           /* wrong volume don't use this volume */
        }
 
-       if (!(ve->serverFlags[i] & VLSERVER_FLAG_UUID)) {
+       if (!(ve->serverFlags[i] & VLSF_UUID)) {
            /* The server has no uuid */
            serverid = htonl(ve->serverNumber[i].time_low);
            ts = afs_GetServer(&serverid, 1, acell, cellp->fsport,
index 9ff56f0..72f2df3 100644 (file)
@@ -133,7 +133,7 @@ afscp_VolumeByName(struct afscp_cell *cell, const char *vname,
            afs_dprintf(("uvldbentry server %d flags: %x\n", srv,
                         u.u.serverFlags[srv]));
 
-           if ((u.u.serverFlags[srv] & VLSERVER_FLAG_UUID) == 0)
+           if ((u.u.serverFlags[srv] & VLSF_UUID) == 0)
                server =
                    afscp_ServerByAddr(cell, u.u.serverNumber[srv].time_low);
            else
@@ -257,7 +257,7 @@ afscp_VolumeById(struct afscp_cell *cell, afs_uint32 id)
        for (srv = 0; srv < u.u.nServers; srv++) {
            if ((u.u.serverFlags[srv] & vtype) == 0)
                continue;
-           if ((u.u.serverFlags[srv] & VLSERVER_FLAG_UUID) == 0)
+           if ((u.u.serverFlags[srv] & VLSF_UUID) == 0)
                server =
                    afscp_ServerByAddr(cell, u.u.serverNumber[srv].time_low);
            else
index d97e092..3866d5d 100644 (file)
@@ -65,8 +65,6 @@ const VLUPDATE_REPS_MODSERV   =       0x0400;
 const  VLUPDATE_REPS_MODPART   =       0x0800;
 const  VLUPDATE_REPS_MODFLAG   =       0x1000;
 
-const  VLSERVER_FLAG_UUID      =       0x0010;
-
 /*typedef      string volumename<VL_MAXNAMELEN>;*/
 
 const  DEFAULTBULK     =       10000;
@@ -195,7 +193,8 @@ const VLOP_DUMP        = 0x100;
 %#define       VLSF_ROVOL          0x02
 %#define       VLSF_RWVOL          0x04
 %#define       VLSF_BACKVOL        0x08
-%#define       VLSF_DONTUSE        0x20    /* no conflict with VLSERVER_FLAG_UUID */
+%#define       VLSF_UUID           0x10
+%#define       VLSF_DONTUSE        0x20
 
 typedef        vldbentry bulkentries<>;
 typedef        nvldbentry nbulkentries<>;
index fad5f9c..0bc0147 100644 (file)
@@ -3204,7 +3204,7 @@ vlentry_to_uvldbentry(struct vl_ctx *ctx, struct nvlentry *VlEntry,
 
            tuuid = exp->ex_hostuuid;
            afs_ntohuuid(&tuuid);
-           VldbEntry->serverFlags[i] |= VLSERVER_FLAG_UUID;
+           VldbEntry->serverFlags[i] |= VLSF_UUID;
            VldbEntry->serverNumber[i] = tuuid;
            VldbEntry->serverUnique[i] = ntohl(exp->ex_uniquifier);
        } else {