#define VTRANS_UNLOCK
#endif /* AFS_PTHREAD_ENV */
-typedef enum { fileServer, /* the fileserver process */
- volumeUtility, /* volserver, or a single volume salvager (non-dafs) */
- salvager, /* standalone whole-partition salvager */
- salvageServer, /* dafs online salvager */
- debugUtility /* fssync-debug or similar utility */
+/**
+ * volume package program type enumeration.
+ */
+typedef enum {
+ fileServer = 1, /**< the fileserver process */
+ volumeUtility = 2, /**< volserver, or a
+ * single volume salvager (non-dafs) */
+ salvager = 3, /**< standalone whole-partition salvager */
+ salvageServer = 4, /**< dafs online salvager */
+ debugUtility = 5 /**< fssync-debug or similar utility */
} ProgramType;
extern ProgramType programType; /* The type of program using the package */
/* Some initialization parameters for the volume package */
/* Add new initialization parameters here */
-extern int (*V_BreakVolumeCallbacks) ();
-extern int (*vol_PollProc) ();
+extern int (*V_BreakVolumeCallbacks) (VolumeId);
+extern int (*vol_PollProc) (void);
+
#define DOPOLL ((vol_PollProc)? (*vol_PollProc)() : 0)
#ifdef AFS_DEMAND_ATTACH_FS
#define VLRU_DEFAULT_OFFLINE_INTERVAL (60*2) /* 2 minutes */
#define VLRU_DEFAULT_OFFLINE_MAX 8 /* 8 volumes */
+
+/**
+ * DAFS thread-specific options structure
+ */
+typedef struct VThreadOptions {
+ int disallow_salvsync; /**< whether or not salvsync calls are allowed
+ * on this thread (deadlock prevention). */
+} VThreadOptions_t;
+extern pthread_key_t VThread_key;
+extern VThreadOptions_t VThread_defaults;
+
#endif /* AFS_DEMAND_ATTACH_FS */
byte specialStatus; /* An error code to return on VGetVolume: the
* volume is unavailable for the reason quoted,
* currently VBUSY or VMOVED */
+ afs_uint32 checkoutMode; /* for volume utilities, mode number for current checkout */
afs_uint32 updateTime; /* Time that this volume was put on the updated
* volume list--the list of volumes that will be
* salvaged should the file server crash */
#define V_vnodeIndex(vp) ((vp)->vnodeIndex)
#define V_nextVnodeUnique(vp) ((vp)->nextVnodeUnique)
#define V_linkHandle(vp) ((vp)->linkHandle)
+#define V_checkoutMode(vp) ((vp)->checkoutMode)
#ifdef AFS_DEMAND_ATTACH_FS
#define V_attachState(vp) ((vp)->attach_state)
#define V_attachFlags(vp) ((vp)->attach_flags)
extern Volume *VAttachVolumeByName_r(Error * ec, char *partition, char *name,
int mode);
extern void VShutdown(void);
+extern void VSetTranquil(void);
extern void VUpdateVolume(Error * ec, Volume * vp);
extern void VUpdateVolume_r(Error * ec, Volume * vp, int flags);
extern void VAddToVolumeUpdateList(Error * ec, Volume * vp);
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);
+extern void VGetVolumePath(Error * ec, VolId volumeId, char **partitionp,
+ char **namep);
+extern char *vol_DevName(dev_t adev, char *wpath);
#ifdef AFS_DEMAND_ATTACH_FS
extern Volume *VPreAttachVolumeByName(Error * ec, char *partition, char *name);
extern int VRegisterVolOp_r(Volume * vp, FSSYNC_VolOp_info * vopinfo);
extern int VDeregisterVolOp_r(Volume * vp);
extern void VCancelReservation_r(Volume * vp);
+extern int VChildProcReconnectFS_r(void);
+extern void VOfflineForVolOp_r(Error *ec, Volume *vp, char *message);
#endif /* AFS_DEMAND_ATTACH_FS */
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