Skip to content

Commit

Permalink
btrfs: Make btrfs_pin_extent_for_log_replay take transaction handle
Browse files Browse the repository at this point in the history
Preparation for refactoring pinned extents tracking.

Reviewed-by: Josef Bacik <[email protected]>
Signed-off-by: Nikolay Borisov <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
lorddoskias authored and kdave committed Mar 23, 2020
1 parent 7bfc100 commit 9fce570
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -2465,7 +2465,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
u64 offset, int metadata, u64 *refs, u64 *flags);
int btrfs_pin_extent(struct btrfs_trans_handle *trans, u64 bytenr, u64 num,
int reserved);
int btrfs_pin_extent_for_log_replay(struct btrfs_fs_info *fs_info,
int btrfs_pin_extent_for_log_replay(struct btrfs_trans_handle *trans,
u64 bytenr, u64 num_bytes);
int btrfs_exclude_logged_extents(struct extent_buffer *eb);
int btrfs_cross_ref_exist(struct btrfs_root *root,
Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2626,13 +2626,13 @@ int btrfs_pin_extent(struct btrfs_trans_handle *trans,
/*
* this function must be called within transaction
*/
int btrfs_pin_extent_for_log_replay(struct btrfs_fs_info *fs_info,
int btrfs_pin_extent_for_log_replay(struct btrfs_trans_handle *trans,
u64 bytenr, u64 num_bytes)
{
struct btrfs_block_group *cache;
int ret;

cache = btrfs_lookup_block_group(fs_info, bytenr);
cache = btrfs_lookup_block_group(trans->fs_info, bytenr);
if (!cache)
return -EINVAL;

Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/tree-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static int process_one_buffer(struct btrfs_root *log,
}

if (wc->pin)
ret = btrfs_pin_extent_for_log_replay(fs_info, eb->start,
ret = btrfs_pin_extent_for_log_replay(wc->trans, eb->start,
eb->len);

if (!ret && btrfs_buffer_uptodate(eb, gen, 0)) {
Expand Down Expand Up @@ -6189,7 +6189,7 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
* each subsequent pass.
*/
if (ret == -ENOENT)
ret = btrfs_pin_extent_for_log_replay(fs_info,
ret = btrfs_pin_extent_for_log_replay(trans,
log->node->start,
log->node->len);
free_extent_buffer(log->node);
Expand Down

0 comments on commit 9fce570

Please sign in to comment.