OPTION(filestore_sloppy_crc, OPT_BOOL, false) // track sloppy crcs
OPTION(filestore_sloppy_crc_block_size, OPT_INT, 65536)
+OPTION(filestore_max_alloc_hint_size, OPT_U64, 1ULL << 20) // bytes
+
OPTION(filestore_max_sync_interval, OPT_DOUBLE, 5) // seconds
OPTION(filestore_min_sync_interval, OPT_DOUBLE, .01) // seconds
OPTION(filestore_btrfs_snap, OPT_BOOL, true)
m_filestore_dump_fmt(true),
m_filestore_sloppy_crc(g_conf->filestore_sloppy_crc),
m_filestore_sloppy_crc_block_size(g_conf->filestore_sloppy_crc_block_size),
+ m_filestore_max_alloc_hint_size(g_conf->filestore_max_alloc_hint_size),
m_fs_type(FS_TYPE_NONE),
m_filestore_max_inline_xattr_size(0),
m_filestore_max_inline_xattrs(0)
{
// TODO: a more elaborate hint calculation
- uint64_t hint = expected_write_size;
+ uint64_t hint = MIN(expected_write_size, m_filestore_max_alloc_hint_size);
ret = backend->set_alloc_hint(**fd, hint);
dout(20) << "set_alloc_hint hint " << hint << " ret " << ret << dendl;
"filestore_replica_fadvise",
"filestore_sloppy_crc",
"filestore_sloppy_crc_block_size",
+ "filestore_max_alloc_hint_size",
NULL
};
return KEYS;
changed.count("filestore_fail_eio") ||
changed.count("filestore_sloppy_crc") ||
changed.count("filestore_sloppy_crc_block_size") ||
+ changed.count("filestore_max_alloc_hint_size") ||
changed.count("filestore_replica_fadvise")) {
Mutex::Locker l(lock);
m_filestore_min_sync_interval = conf->filestore_min_sync_interval;
m_filestore_replica_fadvise = conf->filestore_replica_fadvise;
m_filestore_sloppy_crc = conf->filestore_sloppy_crc;
m_filestore_sloppy_crc_block_size = conf->filestore_sloppy_crc_block_size;
+ m_filestore_max_alloc_hint_size = conf->filestore_max_alloc_hint_size;
}
if (changed.count("filestore_commit_timeout")) {
Mutex::Locker l(sync_entry_timeo_lock);