OPTION(filestore_dev, 0, OPT_STR, 0),
OPTION(filestore_btrfs_trans, 0, OPT_BOOL, true),
OPTION(filestore_btrfs_snap, 0, OPT_BOOL, false),
+ OPTION(filestore_btrfs_clone_range, 0, OPT_BOOL, true),
OPTION(filestore_flusher, 0, OPT_BOOL, true),
OPTION(filestore_flusher_max_fds, 0, OPT_INT, 512),
OPTION(filestore_sync_flush, 0, OPT_BOOL, false),
const char *filestore_dev;
bool filestore_btrfs_trans;
bool filestore_btrfs_snap;
+ bool filestore_btrfs_clone_range;
bool filestore_flusher;
int filestore_flusher_max_fds;
bool filestore_sync_flush;
btrfs = true;
// clone_range?
- btrfs_clone_range = true;
- int r = _do_clone_range(fsid_fd, -1, 0, 1);
- if (r == -EBADF) {
- dout(0) << "mount btrfs CLONE_RANGE ioctl is supported" << dendl;
+ if (g_conf.filestore_btrfs_clone_range) {
+ btrfs_clone_range = true;
+ int r = _do_clone_range(fsid_fd, -1, 0, 1);
+ if (r == -EBADF) {
+ dout(0) << "mount btrfs CLONE_RANGE ioctl is supported" << dendl;
+ } else {
+ btrfs_clone_range = false;
+ dout(0) << "mount btrfs CLONE_RANGE ioctl is NOT supported: " << strerror_r(-r, buf, sizeof(buf)) << dendl;
+ }
} else {
- btrfs_clone_range = false;
- dout(0) << "mount btrfs CLONE_RANGE ioctl is NOT supported: " << strerror_r(-r, buf, sizeof(buf)) << dendl;
+ dout(0) << "mount btrfs CLONE_RANGE ioctl is DISABLED via 'filestore btrfs clone range' option" << dendl;
}
// snap_create and snap_destroy?