OPTION(rbd_blacklist_expire_seconds, OPT_INT, 0) // number of seconds to blacklist - set to 0 for OSD default
OPTION(rbd_request_timed_out_seconds, OPT_INT, 30) // number of seconds before maint request times out
OPTION(rbd_skip_partial_discard, OPT_BOOL, false) // when trying to discard a range inside an object, set to true to skip zeroing the range.
+OPTION(rbd_enable_alloc_hint, OPT_BOOL, true) // when writing a object, it will issue a hint to osd backend to indicate the expected size object need
/*
* The following options change the behavior for librbd's image creation methods that
}
void AioWrite::add_write_ops(librados::ObjectWriteOperation *wr) {
- wr->set_alloc_hint(m_ictx->get_object_size(), m_ictx->get_object_size());
+ if (m_ictx->enable_alloc_hint)
+ wr->set_alloc_hint(m_ictx->get_object_size(), m_ictx->get_object_size());
wr->write(m_object_off, m_write_data);
wr->set_op_flags2(m_op_flags);
}
ASSIGN_OPTION(blacklist_on_break_lock);
ASSIGN_OPTION(blacklist_expire_seconds);
ASSIGN_OPTION(request_timed_out_seconds);
+ ASSIGN_OPTION(enable_alloc_hint);
}
}
bool blacklist_on_break_lock;
uint32_t blacklist_expire_seconds;
uint32_t request_timed_out_seconds;
+ bool enable_alloc_hint;
static bool _filter_metadata_confs(const string &prefix, std::map<string, bool> &configs,
map<string, bufferlist> &pairs, map<string, bufferlist> *res);