More warnings cleanup for vol/
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Mon, 27 Jul 2009 21:32:01 +0000 (22:32 +0100)
committerDerrick Brashear <shadow@dementia.org>
Tue, 28 Jul 2009 12:32:31 +0000 (05:32 -0700)
Prototype a number of functions
Add additional includes as required
Make some existing prototypes match the actual declarations
Volume IDs are unsigned in most of the code, change this bit to match
Make various Procs take an anonymous pointer, so they can be type checked
Add vol_internal.h for prototypes internal to this package

Reviewed-on: http://gerrit.openafs.org/235
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 files changed:
src/vol/clone.c
src/vol/fssync-client.c
src/vol/fssync-debug.c
src/vol/fssync.h
src/vol/namei_ops.c
src/vol/namei_ops.h
src/vol/nuke.c
src/vol/physio.c
src/vol/salvager.c
src/vol/vol-info.c
src/vol/vol-salvage.c
src/vol/vol-salvage.h
src/vol/vol_internal.h [new file with mode: 0644]

index ea32812..8bc995d 100644 (file)
@@ -150,8 +150,9 @@ ci_Destroy(struct clone_head *ah)
 }
 
 static int
-IDecProc(Inode adata, struct clone_rock *aparm)
+IDecProc(Inode adata, void *arock)
 {
+    struct clone_rock *aparm = (struct clone_rock *)arock;
     IH_DEC(aparm->h, adata, aparm->vol);
     DOPOLL;
     return 0;
index 271144d..13904e3 100644 (file)
        Institution:    The Information Technology Center, Carnegie-Mellon University
 
  */
-#ifdef notdef
-
-/* All this is going away in early 1989 */
-int newVLDB;                   /* Compatibility flag */
-
-#endif
-static int newVLDB = 1;
-
 
 #ifndef AFS_PTHREAD_ENV
 #define USUAL_PRIORITY (LWP_MAX_PRIORITY - 2)
index b48de7b..8e58dad 100644 (file)
@@ -40,7 +40,6 @@
 #include <afs/afsint.h>
 #include <afs/assert.h>
 
-
 #include <fcntl.h>
 
 #ifndef AFS_NT40_ENV
index 6fa5ee1..a7fef29 100644 (file)
@@ -187,4 +187,6 @@ extern afs_int32 FSYNC_VolOp(VolumeId volume, char *partName, int com, int reaso
 extern afs_int32 FSYNC_StatsOp(FSSYNC_StatsOp_hdr * scom, int command, int reason,
                               SYNC_response * res_in);
 
+extern void FSYNC_fsInit(void);
+
 #endif /* __fssync_h_ */
index 8548ffe..498c9bb 100644 (file)
@@ -1160,8 +1160,8 @@ namei_SetLinkCount(FdHandle_t * fdP, Inode ino, int count, int locked)
 
 /* ListViceInodes - write inode data to a results file. */
 static int DecodeInode(char *dpath, char *name, struct ViceInodeInfo *info,
-                      int volid);
-static int DecodeVolumeName(char *name, int *vid);
+                      unsigned int volid);
+static int DecodeVolumeName(char *name, unsigned int *vid);
 static int namei_ListAFSSubDirs(IHandle_t * dirIH,
                                int (*write_fun) (FILE *,
                                                  struct ViceInodeInfo *,
@@ -1504,11 +1504,11 @@ namei_ListAFSSubDirs(IHandle_t * dirIH,
 }
 
 static int
-DecodeVolumeName(char *name, int *vid)
+DecodeVolumeName(char *name, unsigned int *vid)
 {
     if (strlen(name) <= 2)
        return -1;
-    *vid = (int)flipbase64_to_int64(name);
+    *vid = (unsigned int)flipbase64_to_int64(name);
     return 0;
 }
 
@@ -1519,7 +1519,8 @@ DecodeVolumeName(char *name, int *vid)
  * Get
  */
 static int
-DecodeInode(char *dpath, char *name, struct ViceInodeInfo *info, int volid)
+DecodeInode(char *dpath, char *name, struct ViceInodeInfo *info,
+           unsigned int volid)
 {
     char fpath[512];
     struct afs_stat status;
@@ -1562,6 +1563,7 @@ DecodeInode(char *dpath, char *name, struct ViceInodeInfo *info, int volid)
  * this routine is called by namei_convertROtoRWvolume()
  */
 
+#ifdef FSSYNC_BUILD_CLIENT
 static afs_int32
 convertVolumeInfo(int fdr, int fdw, afs_uint32 vid)
 {
@@ -1593,6 +1595,7 @@ convertVolumeInfo(int fdr, int fdw, afs_uint32 vid)
     }
     return 0;
 }
+#endif
 
 /*
  * Convert a RO-volume into a RW-volume
index 39b03fc..fff38a2 100644 (file)
@@ -72,7 +72,10 @@ typedef struct {
     char n_inode[NAMEI_LCOMP_LEN];
     char n_path[NAMEI_PATH_LEN];
 } namei_t;
+
 void namei_HandleToName(namei_t * name, IHandle_t * h);
+int namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId);
+int namei_replace_file_by_hardlink(IHandle_t *hLink, IHandle_t *hTarget);
 
 #endif /* AFS_NAMEI_ENV */
 
index f1de4d1..76ca13b 100644 (file)
@@ -75,8 +75,9 @@ struct ilist {
  * Note that ainfo->u.param[0] is always the volume ID, for any vice inode.
  */
 static int
-NukeProc(struct ViceInodeInfo *ainfo, afs_int32 avolid, struct ilist **allInodes)
+NukeProc(struct ViceInodeInfo *ainfo, afs_uint32 avolid, void *arock)
 {
+    struct ilist **allInodes = (struct ilist **)arock;
     struct ilist *ti;
     register afs_int32 i;
 
index 65457f2..4136bde 100644 (file)
@@ -40,6 +40,7 @@
 #include "salvage.h"
 #include "afs/assert.h"
 #include "afs/dir.h"
+#include "vol_internal.h"
 
 /* returns 0 on success, errno on failure */
 int
index f62abdb..d10130d 100644 (file)
 #include "salvsync.h"
 #include "viceinode.h"
 #include "salvage.h"
-#include "volinodes.h"         /* header magic number, etc. stuff */
 #include "vol-salvage.h"
 #ifdef AFS_NT40_ENV
 #include <pthread.h>
index fcf0c51..e9fc339 100644 (file)
@@ -47,7 +47,6 @@
 #include "volume.h"
 #include "partition.h"
 #include "viceinode.h"
-#include "volinodes.h"
 #include <afs/afssyscalls.h>
 #include <afs/afsutil.h>
     
index 270ef1e..375f955 100644 (file)
@@ -188,6 +188,8 @@ Vnodes with 0 inode pointers in RW volumes are now deleted.
 #include "salvage.h"
 #include "volinodes.h"         /* header magic number, etc. stuff */
 #include "vol-salvage.h"
+#include "vol_internal.h"
+
 #ifdef AFS_NT40_ENV
 #include <pthread.h>
 #endif
@@ -2413,9 +2415,10 @@ CopyAndSalvage(register struct DirSummary *dir)
 }
 
 int
-JudgeEntry(struct DirSummary *dir, char *name, VnodeId vnodeNumber,
-          Unique unique)
+JudgeEntry(void *dirVal, char *name, afs_int32 vnodeNumber,
+          afs_int32 unique)
 {
+    struct DirSummary *dir = (struct DirSummary *)dirVal;
     struct VnodeEssence *vnodeEssence;
     afs_int32 dirOrphaned, todelete;
 
index 7c3abe0..e1fd524 100644 (file)
@@ -238,8 +238,8 @@ extern void DistilVnodeEssence(VolumeId vid, VnodeClass class, Inode ino,
                               Unique * maxu);
 extern int GetInodeSummary(char *path, VolumeId singleVolumeNumber);
 extern void GetVolumeSummary(VolumeId singleVolumeNumber);
-extern int JudgeEntry(struct DirSummary *dir, char *name, VnodeId vnodeNumber,
-                      Unique unique);
+extern int JudgeEntry(void *dirVal, char *name, afs_int32 vnodeNumber,
+                     afs_int32 unique);
 extern void MaybeZapVolume(register struct InodeSummary *isp, char *message,
                           int deleteMe, int check);
 extern void ObtainSalvageLock(void);
diff --git a/src/vol/vol_internal.h b/src/vol/vol_internal.h
new file mode 100644 (file)
index 0000000..ad34d4a
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef AFS_SRC_VOL_INTERNAL_H
+#define AFS_SRC_VOL_INTERNAL_H
+
+/* physio.c */
+extern void SetSalvageDirHandle(DirHandle *, afs_int32, Device, Inode);
+
+#endif