fsprobe: Tidy header includes
[openafs.git] / src / fsprobe / fsprobe.c
index 016a5bd..0d62519 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
-
-#include <string.h>
-
-#include <fsprobe.h>           /*Interface for this module */
 #include <lwp.h>               /*Lightweight process package */
 #include <afs/cellconfig.h>
 #include <afs/afsint.h>
 #include <afs/afsutil.h>
-    
-#define LWP_STACK_SIZE (16 * 1024)
+#include <afs/volser.h>
+#include <afs/volser_prototypes.h>
+#define FSINT_COMMON_XG
+#include <afs/afscbint.h>
 
-/*
- * Routines we need that don't have explicit include file definitions.
- */
-extern int RXAFSCB_ExecuteRequest(struct rx_call *);   /*AFS callback dispatcher */
+#include "fsprobe.h"           /*Interface for this module */
 
-/*
- * Help out the linker by explicitly importing the callback routines.
- */
-extern afs_int32 SRXAFSCB_CallBack(struct rx_call *, AFSCBFids *, AFSCBs *);
-extern afs_int32 SRXAFSCB_InitCallBackState2(struct rx_call *, 
-                                            struct interfaceAddr *);
-extern afs_int32 SRXAFSCB_Probe(struct rx_call *);
+#define LWP_STACK_SIZE (16 * 1024)
 
 /*
  * Exported variables.
@@ -234,7 +224,7 @@ fsprobe_LWP(void *unused)
 {                              /*fsprobe_LWP */
 
     static char rn[] = "fsprobe_LWP";  /*Routine name */
-    register afs_int32 code;   /*Results of calls */
+    afs_int32 code;    /*Results of calls */
     struct timeval tv;         /*Time structure */
     int conn_idx;              /*Connection index */
     struct fsprobe_ConnectionInfo *curr_conn;  /*Current connection */
@@ -277,7 +267,7 @@ fsprobe_LWP(void *unused)
                    RXAFS_GetStatistics64(curr_conn->rxconn, STATS64_VERSION, &stats64);
                if (*curr_probeOK == RXGEN_OPCODE)
                    *curr_probeOK =
-                       RXAFS_GetStatistics(curr_conn->rxconn, curr_stats);
+                       RXAFS_GetStatistics(curr_conn->rxconn, (ViceStatistics *)curr_stats);
                else if (*curr_probeOK == 0) {
                    curr_stats->CurrentTime = RoundInt64ToInt32(stats64.ViceStatistics64_val[STATS64_CURRENTTIME]);
                    curr_stats->BootTime = RoundInt64ToInt32(stats64.ViceStatistics64_val[STATS64_BOOTTIME]);
@@ -323,8 +313,8 @@ fsprobe_LWP(void *unused)
                            strcpy(curr_stats->Disk[i].Name, pname);
                        }
                        if (code == RXGEN_OPCODE) {
-                           code = 
-                               AFSVolPartitionInfo(curr_conn->rxVolconn, 
+                           code =
+                               AFSVolPartitionInfo(curr_conn->rxVolconn,
                                                    pname, &partition);
                            if (!code) {
                                curr_stats->Disk[i].BlocksAvailable =
@@ -399,7 +389,7 @@ XListPartitions(struct rx_connection *aconn, struct partList *ptrPartList,
 {
     struct pIDs partIds;
     struct partEntries partEnts;
-    register int i, j = 0, code;
+    int i, j = 0, code;
 
     *cntp = 0;
     if (newvolserver == 1) {
@@ -484,13 +474,13 @@ XListPartitions(struct rx_connection *aconn, struct partList *ptrPartList,
  *------------------------------------------------------------------------*/
 
 int
-fsprobe_Init(int a_numServers, struct sockaddr_in *a_socketArray, 
+fsprobe_Init(int a_numServers, struct sockaddr_in *a_socketArray,
             int a_ProbeFreqInSecs, int (*a_ProbeHandler)(void),
             int a_debug)
 {                              /*fsprobe_Init */
 
     static char rn[] = "fsprobe_Init"; /*Routine name */
-    register afs_int32 code;   /*Return value */
+    afs_int32 code;    /*Return value */
     static struct rx_securityClass *CBsecobj;  /*Callback security object */
     struct rx_securityClass *secobj;   /*Client security object */
     struct rx_service *rxsrv_afsserver;        /*Server for AFS */
@@ -558,7 +548,7 @@ fsprobe_Init(int a_numServers, struct sockaddr_in *a_socketArray,
        malloc(a_numServers * sizeof(struct fsprobe_ConnectionInfo));
     if (fsprobe_ConnInfo == (struct fsprobe_ConnectionInfo *)0) {
        fprintf(stderr,
-               "[%s] Can't allocate %d connection info structs (%lu bytes)\n",
+               "[%s] Can't allocate %d connection info structs (%"AFS_SIZET_FMT" bytes)\n",
                rn, a_numServers,
                (a_numServers * sizeof(struct fsprobe_ConnectionInfo)));
        return (-1);            /*No cleanup needs to be done yet */