struct btrfs_ioctl_logical_ino_args *loi;
struct btrfs_data_container *inodes = NULL;
struct btrfs_path *path = NULL;
- bool ignore_offset = false;
- bool search_commit_root = false;
+ bool ignore_offset;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return PTR_ERR(loi);
if (version == 1) {
+ ignore_offset = false;
size = min_t(u32, loi->size, SZ_64K);
} else {
- u64 flags = loi->flags;
/* All reserved bits must be 0 for now */
if (memchr_inv(loi->reserved, 0, sizeof(loi->reserved))) {
ret = -EINVAL;
goto out_loi;
}
- if (flags & BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET) {
- ignore_offset = true;
- flags &= BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET;
- }
- if (flags & BTRFS_LOGICAL_INO_ARGS_SEARCH_COMMIT_ROOT) {
- search_commit_root = true;
- flags &= BTRFS_LOGICAL_INO_ARGS_SEARCH_COMMIT_ROOT;
- }
/* Only accept flags we have defined so far */
- if (flags) {
+ if (loi->flags & ~(BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET)) {
ret = -EINVAL;
goto out_loi;
}
+ ignore_offset = loi->flags & BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET;
size = min_t(u32, loi->size, SZ_16M);
}
ret = -ENOMEM;
goto out;
}
- path->search_commit_root = search_commit_root;
- path->skip_locking = search_commit_root;
inodes = init_data_container(size);
if (IS_ERR(inodes)) {
};
/* Return every ref to the extent, not just those containing logical block.
* Requires logical == extent bytenr. */
-#define BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0)
-/* Search the commit root instead of joining the current transaction.
- * Avoids transaction commit latency, but results may be out of date. */
-#define BTRFS_LOGICAL_INO_ARGS_SEARCH_COMMIT_ROOT (1ULL << 1)
+#define BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0)
enum btrfs_dev_stat_values {
/* disk I/O failure stats */