Update NEWS for 1.6.22
[pkg-k5-afs_openafs.git] / src / vol / fssync_inline.h
blob87c1a1fbb68a2c7cf8a0ee9f8e2461f7c57eb390
1 /*
2 * Copyright 2010, Sine Nomine Associates.
3 * All Rights Reserved.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
10 #ifndef AFS_VOL_FSSYNC_INLINE_H
11 #define AFS_VOL_FSSYNC_INLINE_H
13 #include "fssync.h"
15 #define FSYNC_ENUMCASE(en) \
16 case en: return #en
18 static_inline char *
19 FSYNC_com2string(afs_int32 command)
21 switch (command) {
22 FSYNC_ENUMCASE(SYNC_COM_CHANNEL_CLOSE);
23 FSYNC_ENUMCASE(FSYNC_VOL_ON);
24 FSYNC_ENUMCASE(FSYNC_VOL_OFF);
25 FSYNC_ENUMCASE(FSYNC_VOL_LISTVOLUMES);
26 FSYNC_ENUMCASE(FSYNC_VOL_NEEDVOLUME);
27 FSYNC_ENUMCASE(FSYNC_VOL_MOVE);
28 FSYNC_ENUMCASE(FSYNC_VOL_BREAKCBKS);
29 FSYNC_ENUMCASE(FSYNC_VOL_DONE);
30 FSYNC_ENUMCASE(FSYNC_VOL_QUERY);
31 FSYNC_ENUMCASE(FSYNC_VOL_QUERY_HDR);
32 FSYNC_ENUMCASE(FSYNC_VOL_QUERY_VOP);
33 FSYNC_ENUMCASE(FSYNC_VOL_STATS_GENERAL);
34 FSYNC_ENUMCASE(FSYNC_VOL_STATS_VICEP);
35 FSYNC_ENUMCASE(FSYNC_VOL_STATS_HASH);
36 FSYNC_ENUMCASE(FSYNC_VOL_STATS_HDR);
37 FSYNC_ENUMCASE(FSYNC_VOL_STATS_VLRU);
38 FSYNC_ENUMCASE(FSYNC_VOL_ATTACH);
39 FSYNC_ENUMCASE(FSYNC_VOL_FORCE_ERROR);
40 FSYNC_ENUMCASE(FSYNC_VOL_LEAVE_OFF);
41 FSYNC_ENUMCASE(FSYNC_VOL_QUERY_VNODE);
42 FSYNC_ENUMCASE(FSYNC_VG_QUERY);
43 FSYNC_ENUMCASE(FSYNC_VG_ADD);
44 FSYNC_ENUMCASE(FSYNC_VG_DEL);
45 FSYNC_ENUMCASE(FSYNC_VG_SCAN);
46 FSYNC_ENUMCASE(FSYNC_VG_SCAN_ALL);
48 default:
49 return "**UNKNOWN**";
53 static_inline char *
54 FSYNC_reason2string(afs_int32 reason)
56 switch (reason) {
57 FSYNC_ENUMCASE(SYNC_REASON_NONE);
58 FSYNC_ENUMCASE(SYNC_REASON_MALFORMED_PACKET);
59 FSYNC_ENUMCASE(SYNC_REASON_NOMEM);
60 FSYNC_ENUMCASE(SYNC_REASON_ENCODING_ERROR);
61 FSYNC_ENUMCASE(FSYNC_WHATEVER);
62 FSYNC_ENUMCASE(FSYNC_SALVAGE);
63 FSYNC_ENUMCASE(FSYNC_MOVE);
64 FSYNC_ENUMCASE(FSYNC_OPERATOR);
65 FSYNC_ENUMCASE(FSYNC_EXCLUSIVE);
66 FSYNC_ENUMCASE(FSYNC_UNKNOWN_VOLID);
67 FSYNC_ENUMCASE(FSYNC_HDR_NOT_ATTACHED);
68 FSYNC_ENUMCASE(FSYNC_NO_PENDING_VOL_OP);
69 FSYNC_ENUMCASE(FSYNC_VOL_PKG_ERROR);
70 FSYNC_ENUMCASE(FSYNC_UNKNOWN_VNID);
71 FSYNC_ENUMCASE(FSYNC_WRONG_PART);
72 FSYNC_ENUMCASE(FSYNC_BAD_STATE);
73 FSYNC_ENUMCASE(FSYNC_BAD_PART);
74 FSYNC_ENUMCASE(FSYNC_PART_SCANNING);
75 default:
76 return "**UNKNOWN**";
80 #undef FSYNC_ENUMCASE
82 #endif /* AFS_VOL_FSSYNC_INLINE_H */