From 02f083730750a03e60eb412a1aed1f03d3c62a49 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Mon, 27 Jul 2009 22:32:01 +0100 Subject: [PATCH] More warnings cleanup for vol/ 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 Reviewed-by: Derrick Brashear --- src/vol/clone.c | 3 ++- src/vol/fssync-client.c | 8 -------- src/vol/fssync-debug.c | 1 - src/vol/fssync.h | 2 ++ src/vol/namei_ops.c | 13 ++++++++----- src/vol/namei_ops.h | 3 +++ src/vol/nuke.c | 3 ++- src/vol/physio.c | 1 + src/vol/salvager.c | 1 - src/vol/vol-info.c | 1 - src/vol/vol-salvage.c | 7 +++++-- src/vol/vol-salvage.h | 4 ++-- src/vol/vol_internal.h | 7 +++++++ 13 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 src/vol/vol_internal.h diff --git a/src/vol/clone.c b/src/vol/clone.c index ea32812d4..8bc995d21 100644 --- a/src/vol/clone.c +++ b/src/vol/clone.c @@ -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; diff --git a/src/vol/fssync-client.c b/src/vol/fssync-client.c index 271144dec..13904e377 100644 --- a/src/vol/fssync-client.c +++ b/src/vol/fssync-client.c @@ -15,14 +15,6 @@ 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) diff --git a/src/vol/fssync-debug.c b/src/vol/fssync-debug.c index b48de7bae..8e58dadb2 100644 --- a/src/vol/fssync-debug.c +++ b/src/vol/fssync-debug.c @@ -40,7 +40,6 @@ #include #include - #include #ifndef AFS_NT40_ENV diff --git a/src/vol/fssync.h b/src/vol/fssync.h index 6fa5ee154..a7fef29d7 100644 --- a/src/vol/fssync.h +++ b/src/vol/fssync.h @@ -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_ */ diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 8548ffe65..498c9bb80 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -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 diff --git a/src/vol/namei_ops.h b/src/vol/namei_ops.h index 39b03fcc5..fff38a28e 100644 --- a/src/vol/namei_ops.h +++ b/src/vol/namei_ops.h @@ -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 */ diff --git a/src/vol/nuke.c b/src/vol/nuke.c index f1de4d1ee..76ca13be4 100644 --- a/src/vol/nuke.c +++ b/src/vol/nuke.c @@ -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; diff --git a/src/vol/physio.c b/src/vol/physio.c index 65457f206..4136bde42 100644 --- a/src/vol/physio.c +++ b/src/vol/physio.c @@ -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 diff --git a/src/vol/salvager.c b/src/vol/salvager.c index f62abdb63..d10130d85 100644 --- a/src/vol/salvager.c +++ b/src/vol/salvager.c @@ -119,7 +119,6 @@ #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 diff --git a/src/vol/vol-info.c b/src/vol/vol-info.c index fcf0c511a..e9fc33950 100644 --- a/src/vol/vol-info.c +++ b/src/vol/vol-info.c @@ -47,7 +47,6 @@ #include "volume.h" #include "partition.h" #include "viceinode.h" -#include "volinodes.h" #include #include diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 270ef1e14..375f955c6 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -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 #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; diff --git a/src/vol/vol-salvage.h b/src/vol/vol-salvage.h index 7c3abe09b..e1fd52405 100644 --- a/src/vol/vol-salvage.h +++ b/src/vol/vol-salvage.h @@ -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 index 000000000..ad34d4a92 --- /dev/null +++ b/src/vol/vol_internal.h @@ -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 -- 2.39.5