That parameter was introduced by commit
b9fab919b748 ("Btrfs: avoid
sleeping in verify_parent_transid while atomic").
At that time we needed to lock the extent buffer range inside the io tree
to avoid content changes, thus it could sleep.
But that behavior is no longer there, as later commit
9e2aff90fc2a
("btrfs: stop using lock_extent in btrfs_buffer_uptodate") dropped the
io tree lock.
We can remove the @atomic parameter safely now.
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
reada_for_search(fs_info, p, parent_level, slot, key->objectid);
/* first we do an atomic uptodate check */
- if (btrfs_buffer_uptodate(tmp, check.transid, true, NULL) > 0) {
+ if (btrfs_buffer_uptodate(tmp, check.transid, NULL) > 0) {
/*
* Do extra check for first_key, eb can be stale due to
* being cached, read from scrub, or have multiple
* detect blocks that either didn't get written at all or got written
* in the wrong place.
*/
-int btrfs_buffer_uptodate(struct extent_buffer *eb, u64 parent_transid, bool atomic,
+int btrfs_buffer_uptodate(struct extent_buffer *eb, u64 parent_transid,
const struct btrfs_tree_parent_check *check)
{
if (!extent_buffer_uptodate(eb))
return 1;
}
- if (atomic)
- return -EAGAIN;
-
if (btrfs_header_generation(eb) != parent_transid) {
btrfs_err_rl(eb->fs_info,
"parent transid verify failed on logical %llu mirror %u wanted %llu found %llu",
goto fail;
}
- ret = btrfs_buffer_uptodate(root->node, generation, false, &check);
+ ret = btrfs_buffer_uptodate(root->node, generation, &check);
if (unlikely(ret <= 0)) {
if (ret == 0)
ret = -EIO;
void btrfs_put_root(struct btrfs_root *root);
void btrfs_mark_buffer_dirty(struct btrfs_trans_handle *trans,
struct extent_buffer *buf);
-int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid, bool atomic,
+int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid,
const struct btrfs_tree_parent_check *check);
int btrfs_read_extent_buffer(struct extent_buffer *buf,
const struct btrfs_tree_parent_check *check);
generation = btrfs_node_ptr_generation(path->nodes[level], path->slots[level]);
- if (btrfs_buffer_uptodate(next, generation, false, NULL))
+ if (btrfs_buffer_uptodate(next, generation, NULL))
return 0;
check.level = level - 1;
if (extent_buffer_uptodate(eb)) {
int ret;
- ret = btrfs_buffer_uptodate(eb, 0, true, check);
+ ret = btrfs_buffer_uptodate(eb, 0, check);
if (unlikely(ret <= 0)) {
if (ret == 0)
ret = -EIO;
int ret;
clear_extent_buffer_reading(eb);
- ret = btrfs_buffer_uptodate(eb, 0, true, check);
+ ret = btrfs_buffer_uptodate(eb, 0, check);
if (unlikely(ret <= 0)) {
if (ret == 0)
ret = -EIO;
if (IS_ERR(eb))
return;
- if (btrfs_buffer_uptodate(eb, gen, true, NULL)) {
+ if (btrfs_buffer_uptodate(eb, gen, NULL)) {
free_extent_buffer(eb);
return;
}
return ret;
}
- if (btrfs_buffer_uptodate(eb, gen, false, NULL) && level == 0) {
+ if (btrfs_buffer_uptodate(eb, gen, NULL) && level == 0) {
ret = btrfs_exclude_logged_extents(eb);
if (ret)
btrfs_abort_transaction(trans, ret);