// bluestore_block_path = spdk:55cd2e404bd73932
OPTION(bluestore_block_path, OPT_STR, "")
OPTION(bluestore_block_size, OPT_U64, 10 * 1024*1024*1024) // 10gb for testing
+OPTION(bluestore_block_create, OPT_BOOL, true)
OPTION(bluestore_block_db_path, OPT_STR, "")
OPTION(bluestore_block_db_size, OPT_U64, 0) // rocksdb ssts (hot/warm)
+OPTION(bluestore_block_db_create, OPT_BOOL, false)
OPTION(bluestore_block_wal_path, OPT_STR, "")
OPTION(bluestore_block_wal_size, OPT_U64, 96 * 1024*1024) // rocksdb wal
+OPTION(bluestore_block_wal_create, OPT_BOOL, false)
OPTION(bluestore_max_dir_size, OPT_U32, 1000000)
OPTION(bluestore_min_alloc_size, OPT_U32, 64*1024)
OPTION(bluestore_onode_map_size, OPT_U32, 1024) // onodes per collection
int BlueStore::_setup_block_symlink_or_file(
string name,
string epath,
- uint64_t size)
+ uint64_t size,
+ bool create)
{
dout(20) << __func__ << " name " << name << " path " << epath
- << " size " << size << dendl;
+ << " size " << size << " create=" << (int)create << dendl;
int r = 0;
if (epath.length()) {
if (!epath.compare(0, sizeof(SPDK_PREFIX-1), SPDK_PREFIX)) {
}
}
if (size) {
- int fd = ::openat(path_fd, name.c_str(), O_RDWR, 0644);
+ unsigned flags = O_RDWR;
+ if (create)
+ flags |= O_CREAT;
+ int fd = ::openat(path_fd, name.c_str(), flags, 0644);
if (fd >= 0) {
// block file is present
struct stat st;
}
r = _setup_block_symlink_or_file("block", g_conf->bluestore_block_path,
- g_conf->bluestore_block_size);
+ g_conf->bluestore_block_size,
+ g_conf->bluestore_block_create);
if (r < 0)
goto out_close_fsid;
r = _setup_block_symlink_or_file("block.wal", g_conf->bluestore_block_wal_path,
- g_conf->bluestore_block_wal_size);
+ g_conf->bluestore_block_wal_size,
+ g_conf->bluestore_block_wal_create);
if (r < 0)
goto out_close_fsid;
r = _setup_block_symlink_or_file("block.db", g_conf->bluestore_block_db_path,
- g_conf->bluestore_block_db_size);
+ g_conf->bluestore_block_db_size,
+ g_conf->bluestore_block_db_create);
if (r < 0)
goto out_close_fsid;
int _open_collections(int *errors=0);
void _close_collections();
- int _setup_block_symlink_or_file(string name, string path, uint64_t size);
+ int _setup_block_symlink_or_file(string name, string path, uint64_t size,
+ bool create);
int _write_bdev_label(string path, bluestore_bdev_label_t label);
static int _read_bdev_label(string path, bluestore_bdev_label_t *label);
filestore wbthrottle btrfs ios hard limit = 20
filestore wbthrottle btrfs inodes hard limit = 30
bluestore fsck on mount = true
+ bluestore block create = true
bluestore block db size = 67108864
+ bluestore block db create = true
bluestore block wal size = 134217728
+ bluestore block wal create = true
$COSDDEBUG
$COSDMEMSTORE
$extra_conf
for f in $CEPH_DEV_DIR/osd$osd/* ; do btrfs sub delete $f || true ; done || true
mkdir -p $CEPH_DEV_DIR/osd$osd
- # for bluestore
- touch $CEPH_DEV_DIR/osd$osd/block
- touch $CEPH_DEV_DIR/osd$osd/block.db
- touch $CEPH_DEV_DIR/osd$osd/block.wal
-
uuid=`uuidgen`
echo "add osd$osd $uuid"
$SUDO $CEPH_ADM osd create $uuid