diff options
author | Amitay Isaacs <amitay@gmail.com> | 2017-03-02 16:36:55 +1100 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2017-06-29 10:34:27 +0200 |
commit | 4e60637b31d90509b8a1a6f5ca0b70e2dbe2eac0 (patch) | |
tree | 19f7f1850ae5e575efa009e77fe57998ab24ebb4 /ctdb/common | |
parent | cb7e5e76905a900c8ad4488ba49ade90c2abe93d (diff) | |
download | samba-4e60637b31d90509b8a1a6f5ca0b70e2dbe2eac0.tar.gz |
ctdb-daemon: Add accessors for CTDB_DB_FLAGS_REPLICATED flag
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/common')
-rw-r--r-- | ctdb/common/common.h | 1 | ||||
-rw-r--r-- | ctdb/common/ctdb_ltdb.c | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/ctdb/common/common.h b/ctdb/common/common.h index 8aeec82b6fc..1b276ca2139 100644 --- a/ctdb/common/common.h +++ b/ctdb/common/common.h @@ -45,6 +45,7 @@ struct ctdb_db_context *ctdb_db_handle(struct ctdb_context *ctdb, const char *name); bool ctdb_db_persistent(struct ctdb_db_context *ctdb_db); +bool ctdb_db_replicated(struct ctdb_db_context *ctdb_db); bool ctdb_db_volatile(struct ctdb_db_context *ctdb_db); bool ctdb_db_readonly(struct ctdb_db_context *ctdb_db); diff --git a/ctdb/common/ctdb_ltdb.c b/ctdb/common/ctdb_ltdb.c index 814133e89de..f4f216e1ee3 100644 --- a/ctdb/common/ctdb_ltdb.c +++ b/ctdb/common/ctdb_ltdb.c @@ -92,9 +92,18 @@ bool ctdb_db_persistent(struct ctdb_db_context *ctdb_db) return false; } +bool ctdb_db_replicated(struct ctdb_db_context *ctdb_db) +{ + if (ctdb_db->db_flags & CTDB_DB_FLAGS_REPLICATED) { + return true; + } + return false; +} + bool ctdb_db_volatile(struct ctdb_db_context *ctdb_db) { - if (ctdb_db->db_flags & CTDB_DB_FLAGS_PERSISTENT) { + if ((ctdb_db->db_flags & CTDB_DB_FLAGS_PERSISTENT) || + (ctdb_db->db_flags & CTDB_DB_FLAGS_REPLICATED)) { return false; } return true; |