[OpenAFS-devel] hosttable

Jimmy Engelbrecht jimmy@e.kth.se
03 Oct 2001 18:37:00 +0200


--=-=-=

Jimmy Engelbrecht <jimmy-li@e.kth.se> writes:

> Btw: what is that point with printing out 32 Bits of the pointer to
> the holds-array ?

I consider this a bug, the following patch (stubs written by
lha@e.kth.se) does something usefull instead:

# cat /usr/afs/local/hosts.dump 
List of active hosts at Wed Oct  3 18:26:45 2001

ip:5730ed82 port:22811 hidx:2 cbid:0 lock:0 last:1002126405 active:1002126405 down:0 del:0 cons:0 cldel:0
         hpfailed:0 hcpsCall:1002126405 hcps [ -17166 -11641 -11636] [ 5730ed82] holds: 0001000000000000 slot/bit: 0/1
ip:6d30ed82 port:26386 hidx:1 cbid:0 lock:0 last:1002126372 active:1002126372 down:0 del:0 cons:0 cldel:0
         hpfailed:0 hcpsCall:1002126372 hcps [ -17166 -11641 -11636] [] holds: 0001000000000000 slot/bit: 0/1
ip:2030ed82 port:22811 hidx:0 cbid:0 lock:0 last:1002126346 active:1002126346 down:0 del:0 cons:0 cldel:0
         hpfailed:0 hcpsCall:1002126346 hcps [ -17166 -11641 -11636] [ 2030ed82] holds: 0001000000000000 slot/bit: 0/1


--=-=-=
Content-Disposition: attachment; filename=holds.patch
Content-Description: patch as attachment

Index: host.c
===================================================================
RCS file: /cvs/openafs/src/viced/host.c,v
retrieving revision 1.7
diff -u -u -r1.7 host.c
--- host.c	2001/08/08 00:04:21	1.7
+++ host.c	2001/10/03 16:32:07
@@ -1590,8 +1590,8 @@
     char tmpStr[256];
 
     H_LOCK
-    sprintf(tmpStr, "ip:%x holds:%d port:%d hidx:%d cbid:%d lock:%x last:%u active:%u down:%d del:%d cons:%d cldel:%d\n\t hpfailed:%d hcpsCall:%u hcps [",
-	    host->host, host->holds, host->port, host->index, host->cblist,
+    sprintf(tmpStr, "ip:%x port:%d hidx:%d cbid:%d lock:%x last:%u active:%u down:%d del:%d cons:%d cldel:%d\n\t hpfailed:%d hcpsCall:%u hcps [",
+	    host->host, host->port, host->index, host->cblist,
 	    CheckLock(&host->lock), host->LastCall, host->ActiveCall, 
 	    (host->hostFlags & VENUSDOWN), host->hostFlags&HOSTDELETED, 
 	    host->Console, host->hostFlags & CLIENTDELETED, 
@@ -1609,8 +1609,16 @@
 	    sprintf(tmpStr, " %x", host->interface->addr[i]);
 	    STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
 	}
-    sprintf(tmpStr, "]\n");
+    sprintf(tmpStr, "] holds: ");
     STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
+
+    for (i = 0 ; i < h_maxSlots ; i++) {
+      sprintf(tmpStr, "%04x", host->holds[i]);
+      STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
+    }
+    sprintf(tmpStr, " slot/bit: %d/%d\n", h_holdSlot(), h_holdbit());
+    STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
+
     H_UNLOCK
     return held;
 

--=-=-=--