diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/mds/mds_table_types.h | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/mds/mds_table_types.h')
-rw-r--r-- | src/mds/mds_table_types.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/mds/mds_table_types.h b/src/mds/mds_table_types.h new file mode 100644 index 00000000..bfb2baa9 --- /dev/null +++ b/src/mds/mds_table_types.h @@ -0,0 +1,81 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +/* + * Ceph - scalable distributed file system + * + * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net> + * + * This is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software + * Foundation. See file COPYING. + * + */ + +#ifndef CEPH_MDSTABLETYPES_H +#define CEPH_MDSTABLETYPES_H + +// MDS TABLES + +#include <string_view> + +enum { + TABLE_ANCHOR, + TABLE_SNAP, +}; + +inline std::string_view get_mdstable_name(int t) { + switch (t) { + case TABLE_ANCHOR: return "anchortable"; + case TABLE_SNAP: return "snaptable"; + default: ceph_abort(); return std::string_view(); + } +} + +enum { + TABLESERVER_OP_QUERY = 1, + TABLESERVER_OP_QUERY_REPLY = -2, + TABLESERVER_OP_PREPARE = 3, + TABLESERVER_OP_AGREE = -4, + TABLESERVER_OP_COMMIT = 5, + TABLESERVER_OP_ACK = -6, + TABLESERVER_OP_ROLLBACK = 7, + TABLESERVER_OP_SERVER_UPDATE = 8, + TABLESERVER_OP_SERVER_READY = -9, + TABLESERVER_OP_NOTIFY_ACK = 10, + TABLESERVER_OP_NOTIFY_PREP = -11, +}; + +inline std::string_view get_mdstableserver_opname(int op) { + switch (op) { + case TABLESERVER_OP_QUERY: return "query"; + case TABLESERVER_OP_QUERY_REPLY: return "query_reply"; + case TABLESERVER_OP_PREPARE: return "prepare"; + case TABLESERVER_OP_AGREE: return "agree"; + case TABLESERVER_OP_COMMIT: return "commit"; + case TABLESERVER_OP_ACK: return "ack"; + case TABLESERVER_OP_ROLLBACK: return "rollback"; + case TABLESERVER_OP_SERVER_UPDATE: return "server_update"; + case TABLESERVER_OP_SERVER_READY: return "server_ready"; + case TABLESERVER_OP_NOTIFY_ACK: return "notify_ack"; + case TABLESERVER_OP_NOTIFY_PREP: return "notify_prep"; + default: ceph_abort(); return std::string_view(); + } +} + +enum { + TABLE_OP_CREATE, + TABLE_OP_UPDATE, + TABLE_OP_DESTROY, +}; + +inline std::string_view get_mdstable_opname(int op) { + switch (op) { + case TABLE_OP_CREATE: return "create"; + case TABLE_OP_UPDATE: return "update"; + case TABLE_OP_DESTROY: return "destroy"; + default: ceph_abort(); return std::string_view(); + } +} + +#endif |