vlserver: Tidy header includes
[openafs.git] / src / vlserver / vldb_check.c
index e141feb..496bbe6 100644 (file)
@@ -7,6 +7,22 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
+#include <afsconfig.h>
+#include <afs/param.h>
+
+#include <roken.h>
+
+#ifdef AFS_NT40_ENV
+#include <WINNT/afsevent.h>
+#endif
+
+#include <ubik.h>
+#include <afs/afsutil.h>
+#include <afs/cmd.h>
+
+#include "vlserver.h"
+#include "vldbint.h"
+
 /* Read a VLDB file and verify it for correctness */
 
 #define VL  0x001              /* good volume entry */
 #define vldbread(x,y,z) vldbio(x,y,z,0)
 #define vldbwrite(x,y,z) vldbio(x,y,z,1)
 
-#include <afsconfig.h>
-#include <afs/param.h>
-
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#include <WINNT/afsevent.h>
-#include <io.h>
-#else
-#include <sys/socket.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#endif
-
-#include "vlserver.h"
-#include "vldbint.h"
-#include <ubik.h>
-#include <afs/afsutil.h>
-#include <afs/cmd.h>
-
 #define ADDR(x) (x/sizeof(struct nvlentry))
 
 int fd;
@@ -1219,11 +1209,8 @@ WorkerBee(struct cmd_syndesc *as, void *arock)
     if (verbose)
        quiet_println("Verify each volume entry\n");
     for (i = 0; i < maxentries; i++) {
-       int nextp = 0;
-       int reft = 0;
        int hash = 0;
         int nexthash = 0;
-       afs_uint32 *nextpp = NULL;
        char *which = NULL;
 
        if (record[i].type == 0)
@@ -1244,40 +1231,28 @@ WorkerBee(struct cmd_syndesc *as, void *arock)
                       vlentry.name, record[i].addr);
 
            if (!(record[i].type & NH)) {
-               nextp = ADDR(vlentry.nextNameHash);
-               reft = REFN;
                hash = NameHash(vlentry.name);
-               nextpp = &vlentry.nextNameHash;
                which = "name";
                volidbuf[0]='\0';
                foundbad = 1;
            }
 
            if (vlentry.volumeId[0] && !(record[i].type & RWH)) {
-               nextp = ADDR(vlentry.nextIdHash[0]);
-               reft = REFRW;
                hash = IdHash(vlentry.volumeId[0]);
-               nextpp = &(vlentry.nextIdHash[0]);
                which = "RW";
                sprintf(volidbuf, "id %u ", vlentry.volumeId[0]);
                foundbad = 1;
            }
 
            if (vlentry.volumeId[1] && !(record[i].type & ROH)) {
-               nextp = ADDR(vlentry.nextIdHash[1]);
-               reft = REFRO;
                hash = IdHash(vlentry.volumeId[1]);
-               nextpp = &(vlentry.nextIdHash[1]);
                which = "RO";
                sprintf(volidbuf, "id %u ", vlentry.volumeId[1]);
                foundbad = 1;
            }
 
            if (vlentry.volumeId[2] && !(record[i].type & BKH)) {
-               nextp = ADDR(vlentry.nextIdHash[2]);
-               reft = REFBK;
                hash = IdHash(vlentry.volumeId[2]);
-               nextpp = &(vlentry.nextIdHash[2]);
                which = "BK";
                sprintf(volidbuf, "id %u ", vlentry.volumeId[2]);
                foundbad = 1;
@@ -1285,10 +1260,7 @@ WorkerBee(struct cmd_syndesc *as, void *arock)
 
            if (!validVolumeAddr(vlentry.nextNameHash) ||
                record[ADDR(vlentry.nextNameHash)].type & MULTN) {
-               nextp = ADDR(vlentry.nextNameHash);
-               reft = REFN;
                hash = NameHash(vlentry.name);
-               nextpp = &vlentry.nextNameHash;
                which = "name";
                volidbuf[0]='\0';
                if (validVolumeAddr(vlentry.nextNameHash)) {
@@ -1303,10 +1275,7 @@ WorkerBee(struct cmd_syndesc *as, void *arock)
 
            if (!validVolumeAddr(vlentry.nextIdHash[0]) ||
                record[ADDR(vlentry.nextIdHash[0])].type & MULTRW) {
-               nextp = ADDR(vlentry.nextIdHash[0]);
-               reft = REFRW;
                hash = IdHash(vlentry.volumeId[0]);
-               nextpp = &(vlentry.nextIdHash[0]);
                which = "RW";
                sprintf(volidbuf, "id %u ", vlentry.volumeId[0]);
                if (validVolumeAddr(vlentry.nextIdHash[0])) {
@@ -1321,10 +1290,7 @@ WorkerBee(struct cmd_syndesc *as, void *arock)
 
            if (!validVolumeAddr(vlentry.nextIdHash[1]) ||
                record[ADDR(vlentry.nextIdHash[1])].type & MULTRO) {
-               nextp = ADDR(vlentry.nextIdHash[1]);
-               reft = REFRO;
                hash = IdHash(vlentry.volumeId[1]);
-               nextpp = &(vlentry.nextIdHash[1]);
                which = "RO";
                sprintf(volidbuf, "id %u ", vlentry.volumeId[1]);
                if (validVolumeAddr(vlentry.nextIdHash[1])) {
@@ -1339,10 +1305,7 @@ WorkerBee(struct cmd_syndesc *as, void *arock)
 
            if (!validVolumeAddr(vlentry.nextIdHash[2]) ||
                record[ADDR(vlentry.nextIdHash[2])].type & MULTBK) {
-               nextp = ADDR(vlentry.nextIdHash[2]);
-               reft = REFBK;
                hash = IdHash(vlentry.volumeId[2]);
-               nextpp = &(vlentry.nextIdHash[2]);
                which = "BK";
                sprintf(volidbuf, "id %u ", vlentry.volumeId[2]);
                if (validVolumeAddr(vlentry.nextIdHash[2])) {