OPTION(rbd_readahead_max_bytes, OPT_LONGLONG, 512 * 1024) // set to 0 to disable readahead
OPTION(rbd_readahead_disable_after_bytes, OPT_LONGLONG, 50 * 1024 * 1024) // how many bytes are read in total before readahead is disabled
OPTION(rbd_clone_copy_on_read, OPT_BOOL, false)
+OPTION(rbd_object_map, OPT_BOOL, false) // whether to enable the RBD object map
/*
* The following options change the behavior for librbd's image creation methods that
r = rbd.create(io_ctx, imgname, size, order);
} else {
if (features == 0) {
- features = RBD_FEATURE_LAYERING | RBD_FEATURE_EXCLUSIVE_LOCK |
- RBD_FEATURE_OBJECT_MAP;
+ features = RBD_FEATURE_LAYERING | RBD_FEATURE_EXCLUSIVE_LOCK;
+ }
+ if (g_conf->rbd_object_map) {
+ features |= RBD_FEATURE_OBJECT_MAP;
}
if ((stripe_unit || stripe_count) &&
(stripe_unit != (1ull << *order) && stripe_count != 1)) {
librados::IoCtx &c_ioctx, const char *c_name,
uint64_t features, int *c_order)
{
- if (features == 0)
- features = RBD_FEATURES_ALL;
- else if ((features & RBD_FEATURE_LAYERING) != RBD_FEATURE_LAYERING)
+ if (features == 0) {
+ features = (RBD_FEATURES_ALL & ~RBD_FEATURE_OBJECT_MAP);
+ }
+ else if ((features & RBD_FEATURE_LAYERING) != RBD_FEATURE_LAYERING) {
return -EINVAL;
+ }
+ if (g_conf->rbd_object_map) {
+ features |= RBD_FEATURE_OBJECT_MAP;
+ }
return rbd.clone(p_ioctx, p_name, p_snapname, c_ioctx, c_name, features,
c_order);
bool format_specified = false,
output_format_specified = false;
int format = 1;
- uint64_t features = RBD_FEATURE_LAYERING | RBD_FEATURE_EXCLUSIVE_LOCK |
- RBD_FEATURE_OBJECT_MAP;
+ uint64_t features = RBD_FEATURE_LAYERING | RBD_FEATURE_EXCLUSIVE_LOCK;
const char *imgname = NULL, *snapname = NULL, *destname = NULL,
*dest_poolname = NULL, *dest_snapname = NULL, *path = NULL,
*devpath = NULL, *lock_cookie = NULL, *lock_client = NULL,