1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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>
This commit is contained in:
Amitay Isaacs 2017-03-02 16:36:55 +11:00 committed by Martin Schwenke
parent cb7e5e7690
commit 4e60637b31
2 changed files with 11 additions and 1 deletions

View File

@ -45,6 +45,7 @@ struct ctdb_db_context *ctdb_db_handle(struct ctdb_context *ctdb,
const char *name); const char *name);
bool ctdb_db_persistent(struct ctdb_db_context *ctdb_db); 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_volatile(struct ctdb_db_context *ctdb_db);
bool ctdb_db_readonly(struct ctdb_db_context *ctdb_db); bool ctdb_db_readonly(struct ctdb_db_context *ctdb_db);

View File

@ -92,9 +92,18 @@ bool ctdb_db_persistent(struct ctdb_db_context *ctdb_db)
return false; 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) 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 false;
} }
return true; return true;