#define LVMLOCKD_SOCKET DEFAULT_RUN_DIR "/lvmlockd.socket"
#define LVMLOCKD_ADOPT_FILE DEFAULT_RUN_DIR "/lvmlockd.adopt"
+#define LVMLOCKD_USE_SANLOCK_LVB 0
+
/* Wrappers to open/close connection */
static inline __attribute__((always_inline))
* once someone uses the lock and writes a new lvb value.
* Do nothing.
*/
+ /*
log_debug("S %s R %s res_lock version_zero_valid still zero", ls->name, r->name);
+ */
} else if (r->version_zero_valid && vb.r_version) {
/*
/* LD_RT_LV offset is set in each lm_lock call from lv_args. */
+ /*
+ * Disable sanlock lvb since lock versions are not currently used for
+ * anything, and it's nice to avoid the extra i/o used for lvb's.
+ */
+#if LVMLOCKD_USE_SANLOCK_LVB
if (r->type == LD_RT_GL || r->type == LD_RT_VG) {
rds->vb = zalloc(sizeof(struct val_blk));
if (!rds->vb)
return -ENOMEM;
}
-
+#endif
return 0;
}
struct rd_sanlock *rds = (struct rd_sanlock *)r->lm_data;
/* FIXME: assert r->mode == UN or unlock if it's not? */
-
+#ifdef LVMLOCKD_USE_SANLOCK_LVB
free(rds->vb);
-
+#endif
memset(rds, 0, sizeof(struct rd_sanlock));
r->lm_init = 0;
return 0;
int result;
int ret;
- if (!vg_is_shared(vg))
- return 1;
if (!_use_lvmlockd)
return 0;
if (!_lvmlockd_connected)
return 0;
+ if (!vg_is_shared(vg))
+ return 1;
+
+#if !LVMLOCKD_USE_SANLOCK_LVB
+ /*
+ * lvb (for lock version) is disabled for sanlock since
+ * lock versions are not used any more, and it's more
+ * costly for sanlock to implement (extra i/o.)
+ */
+ if (!strcmp(vg->lock_type, "sanlock"))
+ return 1;
+#endif
reply = _lockd_send("vg_update",
"pid = " FMTd64, (int64_t) getpid(),