]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Tidy the vol directory
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Fri, 10 Jul 2009 10:58:44 +0000 (11:58 +0100)
committerDerrick Brashear <shadow@dementia.org>
Fri, 10 Jul 2009 14:45:27 +0000 (08:45 -0600)
- Remove some further warnings from the vol directory
- Add volutil_PartitionName2_r to afsutil_prototypes.h
- Export vol_prototypes.h so it can be used elsewhere in the tree

Reviewed-on: http://gerrit.openafs.org/17
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Verified-by: Derrick Brashear <shadow@dementia.org>
src/util/afsutil_prototypes.h
src/vol/Makefile.in
src/vol/clone.c
src/vol/namei_ops.c
src/vol/vol_prototypes.h [new file with mode: 0644]
src/vol/volume.h
src/vol/vutil.c

index 3bcbacec3c8c5c40dc1c7666679bbff801cd9a0a..d4324cad2c847d02e24f45388cb20ae3d8ec6e8e 100644 (file)
@@ -195,6 +195,7 @@ extern int afsUUID_to_string(const afsUUID * uuid, char *str, size_t strsz);
 /* volparse.c */
 extern afs_int32 volutil_GetPartitionID(char *aname);
 extern char *volutil_PartitionName_r(int avalue, char *tbuffer, int buflen);
+extern afs_int32 volutil_PartitionName2_r(afs_int32 part, char *tbuffer, size_t buflen);
 extern char *volutil_PartitionName(int avalue);
 extern afs_int32 util_GetInt32(register char *as, afs_int32 * aval);
 extern afs_uint32 util_GetUInt32(register char *as, afs_uint32 * aval);
index 6e0b920fe9c70753bd44f4fd28c3a0a2fb361a9e..501a922d2343f2d5e168b69c8d562fea68bbf598 100644 (file)
@@ -50,7 +50,8 @@ all: gi \
        ${TOP_INCDIR}/afs/salvsync.h \
        ${TOP_INCDIR}/afs/daemon_com.h \
        ${TOP_INCDIR}/afs/ihandle.h \
-       ${TOP_INCDIR}/afs/namei_ops.h
+       ${TOP_INCDIR}/afs/namei_ops.h \
+       ${TOP_INCDIR}/afs/vol_prototypes.h
 
 ${TOP_LIBDIR}/vlib.a: vlib.a
        ${INSTALL_DATA} $? $@
@@ -103,6 +104,9 @@ ${TOP_INCDIR}/afs/salvage.h: salvage.h
 ${TOP_INCDIR}/afs/vol-salvage.h: vol-salvage.h
        ${INSTALL_DATA} $? $@
 
+${TOP_INCDIR}/afs/vol_prototypes.h: vol_prototypes.h
+       ${INSTALL_DATA} $? $@
+
 #
 # Installation targets
 #
index fe1704ae3599f274e5ceb7fd52f20aeeee0536e2..b848a77530ec02944c88d5502a4685771f9cbbd7 100644 (file)
@@ -51,6 +51,7 @@
 #include "volume.h"
 #include "partition.h"
 #include "viceinode.h"
+#include "vol_prototypes.h"
 
 /*@printflike@*/ extern void Log(const char *format, ...);
 
index 46efbdd1e8f8f24d9f527321dcd4e1aadf826da6..3c142d3d21cbb938ac62fd0e8712e568b40cfd85 100644 (file)
@@ -98,7 +98,6 @@ emul_flock(int fd, int cmd)
 #define flock(f,c)      emul_flock(f,c)
 #endif
 
-extern char *volutil_PartitionName_r(int volid, char *buf, int buflen);
 int Testing=0;
 
 
@@ -831,8 +830,8 @@ namei_copy_on_write(IHandle_t *h)
        fdP = IH_OPEN(h);
        if (!fdP)
            return EIO;
-       strcpy(&path, name.n_path);
-       strcat(&path, "-tmp");
+       strcpy(path, name.n_path);
+       strcat(path, "-tmp");
        fd = afs_open(path, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 0);
        if (fd < 0) {
            FDH_CLOSE(fdP);
diff --git a/src/vol/vol_prototypes.h b/src/vol/vol_prototypes.h
new file mode 100644 (file)
index 0000000..1be7407
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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
+ */
+
+#ifndef _VOL_PROTOTYPES_H
+#define _VOL_PROTOTYPES_h
+
+/* clone.c */
+extern void CloneVolume(Error *, Volume *, Volume *, Volume *);
+extern int (*vol_PollProc) (void);
+
+/* nuke.c */
+extern int nuke(char *, afs_int32);
+
+/* vutil.c */
+extern void AssignVolumeName(register VolumeDiskData * vol, char *name, char *ext);
+extern void AssignVolumeName_r(register VolumeDiskData * vol, char *name, char *ext);
+extern void ClearVolumeStats(register VolumeDiskData * vol);
+extern void ClearVolumeStats_r(register VolumeDiskData * vol);
+extern afs_int32 CopyVolumeHeader(VolumeDiskData *, VolumeDiskData *);
+
+#endif
+
index 51824d31f4d76833bbd54db4c0bf73a67ac5db19..082a4a3e0536c3191f07a7026487e611e898c411 100644 (file)
@@ -783,6 +783,7 @@ extern int VInitVolumePackage(ProgramType pt, afs_uint32 nLargeVnodes,
                              afs_uint32 nSmallVnodes, int connect, afs_uint32 volcache);
 extern void DiskToVolumeHeader(VolumeHeader_t * h, VolumeDiskHeader_t * dh);
 extern void VolumeHeaderToDisk(VolumeDiskHeader_t * dh, VolumeHeader_t * h);
+extern void AssignVolumeName(VolumeDiskData * vol, char *name, char *ext);
 extern void VTakeOffline_r(register Volume * vp);
 extern void VTakeOffline(register Volume * vp);
 extern Volume * VLookupVolume_r(Error * ec, VolId volumeId, Volume * hint);
@@ -818,6 +819,8 @@ extern void VCancelReservation_r(Volume * vp);
 extern int VVolOpLeaveOnline_r(Volume * vp, FSSYNC_VolOp_info * vopinfo);
 extern int VVolOpSetVBusy_r(Volume * vp, FSSYNC_VolOp_info * vopinfo);
 
+extern void VPurgeVolume(Error * ec, Volume * vp);
+
 
 /* Naive formula relating number of file size to number of 1K blocks in file */
 /* Note:  we charge 1 block for 0 length files so the user can't store
index 2981606653473cf40ffc04554b94070e49eb527a..259aabff8eeedbf56a210127f5a4c493d3395a6e 100644 (file)
@@ -55,6 +55,8 @@
 #include "viceinode.h"
 
 #include "volinodes.h"
+#include "vol_prototypes.h"
+
 #ifdef AFS_AIX_ENV
 #include <sys/lockf.h>
 #endif
 
 /*@printflike@*/ extern void Log(const char *format, ...);
 
-void AssignVolumeName(register VolumeDiskData * vol, char *name, char *ext);
-void AssignVolumeName_r(register VolumeDiskData * vol, char *name, char *ext);
-void ClearVolumeStats(register VolumeDiskData * vol);
-void ClearVolumeStats_r(register VolumeDiskData * vol);
-
-
 #define nFILES (sizeof (stuff)/sizeof(struct stuff))
 
 /* Note:  the volume creation functions herein leave the destroyMe flag in the