volser: apply static keyword to VolPartitionInfo definition
[openafs.git] / src / volser / volprocs.c
index 13bba38..6c4a239 100644 (file)
@@ -407,7 +407,7 @@ SAFSVolPartitionInfo64(struct rx_call *acid, char *pname, struct diskPartition64
     return code;
 }
 
-afs_int32
+static afs_int32
 VolPartitionInfo(struct rx_call *acid, char *pname, struct diskPartition64
                 *partition)
 {
@@ -2789,6 +2789,7 @@ VolMonitor(struct rx_call *acid, transDebugEntries *transInfo)
 {
     transDebugInfo *pntr;
     afs_int32 allocSize = 50;
+    afs_int32 code = 0;
     struct volser_trans *tt, *nt, *allTrans;
 
     if (!afsconf_CheckRestrictedQuery(tdir, acid, restrictedQueryLevel))
@@ -2832,6 +2833,10 @@ VolMonitor(struct rx_call *acid, transDebugEntries *transInfo)
            allocSize = (allocSize * 3) / 2;
            pntr = realloc(transInfo->transDebugEntries_val,
                           allocSize * sizeof(transDebugInfo));
+           if (pntr == NULL) {
+               code = ENOMEM;
+               goto done;
+           }
            transInfo->transDebugEntries_val = pntr;
            pntr =
                transInfo->transDebugEntries_val +
@@ -2843,7 +2848,7 @@ VolMonitor(struct rx_call *acid, transDebugEntries *transInfo)
 done:
     VTRANS_UNLOCK;
 
-    return 0;
+    return code;
 }
 
 afs_int32
@@ -2994,7 +2999,8 @@ SAFSVolConvertROtoRWvolume(struct rx_call *acid, afs_int32 partId,
 #endif
             ttc = NewTrans(volumeId, partId);
             if (!ttc) {
-               return VOLSERVOLBUSY;
+               ret = VOLSERVOLBUSY;
+               goto done;
             }
 #ifdef AFS_NAMEI_ENV
            ret = namei_ConvertROtoRWvolume(pname, volumeId);
@@ -3004,7 +3010,7 @@ SAFSVolConvertROtoRWvolume(struct rx_call *acid, afs_int32 partId,
            break;
        }
     }
-
+  done:
     if (ttc)
         DeleteTrans(ttc, 1);