]> git.proxmox.com Git - ceph.git/blob - ceph/src/mds/mds_table_types.h
import ceph 16.2.6
[ceph.git] / 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 #include <string_view>
21
22 enum {
23 TABLE_ANCHOR,
24 TABLE_SNAP,
25 };
26
27 inline std::string_view get_mdstable_name(int t) {
28 switch (t) {
29 case TABLE_ANCHOR: return "anchortable";
30 case TABLE_SNAP: return "snaptable";
31 default: ceph_abort(); return std::string_view();
32 }
33 }
34
35 enum {
36 TABLESERVER_OP_QUERY = 1,
37 TABLESERVER_OP_QUERY_REPLY = -2,
38 TABLESERVER_OP_PREPARE = 3,
39 TABLESERVER_OP_AGREE = -4,
40 TABLESERVER_OP_COMMIT = 5,
41 TABLESERVER_OP_ACK = -6,
42 TABLESERVER_OP_ROLLBACK = 7,
43 TABLESERVER_OP_SERVER_UPDATE = 8,
44 TABLESERVER_OP_SERVER_READY = -9,
45 TABLESERVER_OP_NOTIFY_ACK = 10,
46 TABLESERVER_OP_NOTIFY_PREP = -11,
47 };
48
49 inline std::string_view get_mdstableserver_opname(int op) {
50 switch (op) {
51 case TABLESERVER_OP_QUERY: return "query";
52 case TABLESERVER_OP_QUERY_REPLY: return "query_reply";
53 case TABLESERVER_OP_PREPARE: return "prepare";
54 case TABLESERVER_OP_AGREE: return "agree";
55 case TABLESERVER_OP_COMMIT: return "commit";
56 case TABLESERVER_OP_ACK: return "ack";
57 case TABLESERVER_OP_ROLLBACK: return "rollback";
58 case TABLESERVER_OP_SERVER_UPDATE: return "server_update";
59 case TABLESERVER_OP_SERVER_READY: return "server_ready";
60 case TABLESERVER_OP_NOTIFY_ACK: return "notify_ack";
61 case TABLESERVER_OP_NOTIFY_PREP: return "notify_prep";
62 default: ceph_abort(); return std::string_view();
63 }
64 }
65
66 enum {
67 TABLE_OP_CREATE,
68 TABLE_OP_UPDATE,
69 TABLE_OP_DESTROY,
70 };
71
72 inline std::string_view get_mdstable_opname(int op) {
73 switch (op) {
74 case TABLE_OP_CREATE: return "create";
75 case TABLE_OP_UPDATE: return "update";
76 case TABLE_OP_DESTROY: return "destroy";
77 default: ceph_abort(); return std::string_view();
78 }
79 }
80
81 #endif