Commit b0331a4c authored by Chris Mason's avatar Chris Mason

Btrfs: Disable btree reada during extent backref lookups.

This reada is generally not effective.
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent e2008b61
...@@ -630,6 +630,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, ...@@ -630,6 +630,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
if (!path) if (!path)
return -ENOMEM; return -ENOMEM;
path->reada = 0;
key.objectid = bytenr; key.objectid = bytenr;
btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY); btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY);
key.offset = num_bytes; key.offset = num_bytes;
...@@ -649,6 +650,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, ...@@ -649,6 +650,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
btrfs_release_path(root->fs_info->extent_root, path); btrfs_release_path(root->fs_info->extent_root, path);
path->reada = 0;
ret = btrfs_insert_extent_backref(trans, root->fs_info->extent_root, ret = btrfs_insert_extent_backref(trans, root->fs_info->extent_root,
path, bytenr, root_objectid, path, bytenr, root_objectid,
ref_generation, owner, owner_offset); ref_generation, owner, owner_offset);
...@@ -680,6 +682,7 @@ static int lookup_extent_ref(struct btrfs_trans_handle *trans, ...@@ -680,6 +682,7 @@ static int lookup_extent_ref(struct btrfs_trans_handle *trans,
WARN_ON(num_bytes < root->sectorsize); WARN_ON(num_bytes < root->sectorsize);
path = btrfs_alloc_path(); path = btrfs_alloc_path();
path->reada = 0;
key.objectid = bytenr; key.objectid = bytenr;
key.offset = num_bytes; key.offset = num_bytes;
btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY); btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY);
...@@ -1240,6 +1243,7 @@ static int __free_extent(struct btrfs_trans_handle *trans, struct btrfs_root ...@@ -1240,6 +1243,7 @@ static int __free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
if (!path) if (!path)
return -ENOMEM; return -ENOMEM;
path->reada = 0;
ret = lookup_extent_backref(trans, extent_root, path, ret = lookup_extent_backref(trans, extent_root, path,
bytenr, root_objectid, bytenr, root_objectid,
ref_generation, ref_generation,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment