summaryrefslogtreecommitdiff
path: root/extent-tree.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-05-10 19:22:11 +0300
committerDavid Sterba <dsterba@suse.com>2018-06-07 16:37:38 +0200
commit9e2bf8c8abecf878ea5928f2751e92433af124c7 (patch)
tree75f7d294bcfa8bc1fa50ea2aec1ae64f0711313a /extent-tree.c
parent6386ae4d8c6644630ab3f9aa1c92d8aed3b81aea (diff)
btrfs-progs: Use symbolic names for read ahead behavior
Presently btrfs-progs haven't pulled the enum defining the symbolic names of read ahead constants. This commit adds the enum and simultaneously converts all usages to respective symbolic name. No functional change, just making the code human readable. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'extent-tree.c')
-rw-r--r--extent-tree.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/extent-tree.c b/extent-tree.c
index 1694c47..0643815 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -110,7 +110,7 @@ static int cache_block_group(struct btrfs_root *root,
if (!path)
return -ENOMEM;
- path->reada = 2;
+ path->reada = READA_FORWARD;
last = max_t(u64, block_group->key.objectid, BTRFS_SUPER_INFO_OFFSET);
key.objectid = last;
key.offset = 0;
@@ -1389,7 +1389,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
if (!path)
return -ENOMEM;
- path->reada = 1;
+ path->reada = READA_BACK;
ret = insert_inline_extent_backref(trans, root->fs_info->extent_root,
path, bytenr, num_bytes, parent,
@@ -1410,7 +1410,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(path);
- path->reada = 1;
+ path->reada = READA_BACK;
/* now insert the actual backref */
ret = insert_extent_backref(trans, root->fs_info->extent_root,
@@ -1454,7 +1454,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
- path->reada = 1;
+ path->reada = READA_BACK;
key.objectid = bytenr;
key.offset = offset;
@@ -1544,7 +1544,7 @@ int btrfs_set_block_flags(struct btrfs_trans_handle *trans, u64 bytenr,
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
- path->reada = 1;
+ path->reada = READA_BACK;
key.objectid = bytenr;
if (skinny_metadata) {
@@ -2184,7 +2184,7 @@ static int __free_extent(struct btrfs_trans_handle *trans,
if (!path)
return -ENOMEM;
- path->reada = 1;
+ path->reada = READA_BACK;
is_data = owner_objectid >= BTRFS_FIRST_FREE_OBJECTID;
if (is_data)