Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / mds / mds_table_types.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
2 // vim: ts=8 sw=2 smarttab
3 /*
4  * Ceph - scalable distributed file system
5  *
6  * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7  *
8  * This is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License version 2.1, as published by the Free Software 
11  * Foundation.  See file COPYING.
12  * 
13  */
14
15 #ifndef CEPH_MDSTABLETYPES_H
16 #define CEPH_MDSTABLETYPES_H
17
18 // MDS TABLES
19
20 enum {
21   TABLE_ANCHOR,
22   TABLE_SNAP,
23 };
24
25 inline const char *get_mdstable_name(int t) {
26   switch (t) {
27   case TABLE_ANCHOR: return "anchortable";
28   case TABLE_SNAP: return "snaptable";
29   default: ceph_abort();
30   }
31 }
32
33 enum {
34   TABLESERVER_OP_QUERY        =  1,
35   TABLESERVER_OP_QUERY_REPLY  = -2,
36   TABLESERVER_OP_PREPARE      =  3,
37   TABLESERVER_OP_AGREE        = -4,
38   TABLESERVER_OP_COMMIT       =  5,
39   TABLESERVER_OP_ACK          = -6,
40   TABLESERVER_OP_ROLLBACK     =  7,
41   TABLESERVER_OP_SERVER_UPDATE = 8,
42   TABLESERVER_OP_SERVER_READY = -9,
43 };
44
45 inline const char *get_mdstableserver_opname(int op) {
46   switch (op) {
47   case TABLESERVER_OP_QUERY: return "query";
48   case TABLESERVER_OP_QUERY_REPLY: return "query_reply";
49   case TABLESERVER_OP_PREPARE: return "prepare";
50   case TABLESERVER_OP_AGREE: return "agree";
51   case TABLESERVER_OP_COMMIT: return "commit";
52   case TABLESERVER_OP_ACK: return "ack";
53   case TABLESERVER_OP_ROLLBACK: return "rollback";
54   case TABLESERVER_OP_SERVER_UPDATE: return "server_update";
55   case TABLESERVER_OP_SERVER_READY: return "server_ready";
56   default: ceph_abort(); return 0;
57   }
58 }
59
60 enum {
61   TABLE_OP_CREATE,
62   TABLE_OP_UPDATE,
63   TABLE_OP_DESTROY,
64 };
65
66 inline const char *get_mdstable_opname(int op) {
67   switch (op) {
68   case TABLE_OP_CREATE: return "create";
69   case TABLE_OP_UPDATE: return "update";
70   case TABLE_OP_DESTROY: return "destroy";
71   default: ceph_abort(); return 0;
72   }
73 }
74
75 #endif