]> git.hungrycats.org Git - linux/commitdiff
Revert "btrfs: introduce BTRFS_LOGICAL_INO_ARGS_SEARCH_COMMIT_ROOT to trade latency...
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sat, 1 Aug 2020 00:31:45 +0000 (20:31 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sat, 1 Aug 2020 00:31:45 +0000 (20:31 -0400)
This reverts commit f35030f24f09ae428a3c069151ee8aaac5d5d041.

fs/btrfs/ioctl.c
include/uapi/linux/btrfs.h

index ccb3a7cfeb14894ccf5fc5ccff8075cbb847e5c8..4f4b13830b258cbb7f860e9e9d3dd68035c4c810 100644 (file)
@@ -4462,8 +4462,7 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info,
        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;
@@ -4473,27 +4472,20 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info,
                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);
        }
 
@@ -4502,8 +4494,6 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info,
                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)) {
index ecb734cc61eea4f6791f6c7487930d6529e20a6d..7a8bc8b920f52e767bc78c55630fc5001acd7add 100644 (file)
@@ -634,10 +634,7 @@ struct btrfs_ioctl_logical_ino_args {
 };
 /* 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 */