summaryrefslogtreecommitdiffstats
path: root/ctdb/common/ctdb_ltdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb/common/ctdb_ltdb.c')
-rw-r--r--ctdb/common/ctdb_ltdb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ctdb/common/ctdb_ltdb.c b/ctdb/common/ctdb_ltdb.c
index e604f913b1..6606ea1f31 100644
--- a/ctdb/common/ctdb_ltdb.c
+++ b/ctdb/common/ctdb_ltdb.c
@@ -124,7 +124,12 @@ struct ctdb_db_context *ctdb_attach(struct ctdb_context *ctdb, const char *name,
*/
uint32_t ctdb_lmaster(struct ctdb_context *ctdb, const TDB_DATA *key)
{
- return ctdb_hash(key) % ctdb->num_nodes;
+ uint32_t idx, lmaster;
+
+ idx = ctdb_hash(key) % ctdb->vnn_map->size;
+ lmaster = ctdb->vnn_map->map[idx];
+
+ return lmaster;
}