vos: restore status information to 'vos status' 00/13400/4
authorMark Vitale <mvitale@sinenomine.net>
Fri, 30 Nov 2018 17:10:50 +0000 (12:10 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 3 Jan 2019 14:58:42 +0000 (09:58 -0500)
Commit d3eaa39da3693bba708fa2fa951568009e929550 'rx: Make the rx_call
structure private' created accessors for several rx_call members.
However, it simply #ifdef'd out the packet counters and timestamps
reported by 'vos status' (AFSVol_Monitor).  This is a regression for the
1.8.x 'vos status' command.

Instead, supply an accessor so 'vos status' can again be used to monitor
the progress of certain volume operations.

FIXES 134856

Change-Id: I91f5831b21f128bd8e86db63387a454c9e57bcdf
Reviewed-on: https://gerrit.openafs.org/13400
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>

src/rx/rx.h
src/rx/rx_call.c
src/volser/volprocs.c

index 6bbf574..1b3887b 100644 (file)
@@ -102,6 +102,11 @@ extern void rx_RecordCallStatistics(struct rx_call *call,
                                    unsigned int totalFunc,
                                    int isServer);
 
+extern void rx_GetCallStatus(struct rx_call *call,
+                            afs_int32 *readNext,
+                            afs_int32 *transmitNext,
+                            int *lastSendTime,
+                            int *lastReceiveTime);
 /* Peer management */
 extern afs_uint32 rx_HostOf(struct rx_peer *peer);
 extern u_short rx_PortOf(struct rx_peer *peer);
index 43d6034..6f22ce0 100644 (file)
@@ -72,3 +72,23 @@ rx_RecordCallStatistics(struct rx_call *call, unsigned int rxInterface,
                             totalFunc, &queue, &exec, call->app.bytesSent,
                             call->app.bytesRcvd, 1);
 }
+
+/*
+ * Accessor for VolMonitor 'vos status'
+ * note: the rx_call members are all unsigned, but our return targets
+ * in wire struct transDebugInfo are all signed.  Sigh.
+ */
+void
+rx_GetCallStatus(struct rx_call *call, afs_int32 *readNext,
+                       afs_int32 *transmitNext, int *lastSendTime,
+                       int *lastReceiveTime)
+{
+    if (readNext != NULL)
+       *readNext = call->rnext;
+    if (transmitNext != NULL)
+       *transmitNext = call->tnext;
+    if (lastSendTime != NULL)
+       *lastSendTime = call->lastSendTime;
+    if (lastReceiveTime != NULL)
+       *lastReceiveTime = call->lastReceiveTime;
+}
index 3947803..ddd06e5 100644 (file)
@@ -2823,12 +2823,8 @@ VolMonitor(struct rx_call *acid, transDebugEntries *transInfo)
        pntr->callValid = 0;
        if (tt->rxCallPtr) {    /*record call related info */
            pntr->callValid = 1;
-#if 0
-           pntr->readNext = tt->rxCallPtr->rnext;
-           pntr->transmitNext = tt->rxCallPtr->tnext;
-           pntr->lastSendTime = tt->rxCallPtr->lastSendTime;
-           pntr->lastReceiveTime = tt->rxCallPtr->lastReceiveTime;
-#endif
+           rx_GetCallStatus(tt->rxCallPtr, &(pntr->readNext), &(pntr->transmitNext),
+                               &(pntr->lastSendTime), &(pntr->lastReceiveTime));
        }
         VTRANS_OBJ_UNLOCK(tt);
        pntr++;