#define __fssync_h_
-#define FSYNC_PROTO_VERSION 2
+#define FSYNC_PROTO_VERSION 3
/**
* FSYNC command codes.
+ *
+ * If you add more command codes here, be sure to add some documentation
+ * in doc/arch/fssync.txt.
*/
enum FSYNCOpCode {
FSYNC_VOL_ON = SYNC_COM_CODE_DECL(0), /**< bring Volume online */
FSYNC_VOL_FORCE_ERROR = SYNC_COM_CODE_DECL(16), /**< force volume into error state */
FSYNC_VOL_LEAVE_OFF = SYNC_COM_CODE_DECL(17), /**< end vol op, but leave volume offline */
FSYNC_VOL_QUERY_VNODE = SYNC_COM_CODE_DECL(18), /**< query vnode state */
+ FSYNC_OP_CODE_END
};
/**
FSYNC_NO_PENDING_VOL_OP = SYNC_REASON_CODE_DECL(7), /**< no volume operation pending */
FSYNC_VOL_PKG_ERROR = SYNC_REASON_CODE_DECL(8), /**< error in the volume package */
FSYNC_UNKNOWN_VNID = SYNC_REASON_CODE_DECL(9), /**< vnode id not known by fileserver */
+ FSYNC_WRONG_PART = SYNC_REASON_CODE_DECL(10),/**< volume attached on different partition */
+ FSYNC_BAD_STATE = SYNC_REASON_CODE_DECL(11),/**< current volume state does not allow this operation */
+ FSYNC_REASON_CODE_END
};
/* FSYNC response codes */
struct offlineInfo * volumes;
} FSSYNC_VolOp_command;
+
+/**
+ * volume operation processing state.
+ */
+enum FSSYNC_VolOpState {
+ FSSYNC_VolOpPending = 0, /**< volume operation request received */
+ FSSYNC_VolOpDenied = 1, /**< volume operation request denied */
+ FSSYNC_VolOpRunningOnline = 2, /**< volume operation is running while volume is online */
+ FSSYNC_VolOpRunningOffline = 3, /**< volume operation is running while volume is offline */
+ FSSYNC_VolOpRunningUnknown = 4 /**< volume operation is running; VVolOpLeaveOnline_r resolution unknown */
+};
+
/**
* volume operation information node.
*
typedef struct FSSYNC_VolOp_info {
SYNC_command_hdr com;
FSSYNC_VolOp_hdr vop;
+ enum FSSYNC_VolOpState vol_op_state;
} FSSYNC_VolOp_info;
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_ */