提交 91166212 编写于 作者: D David Sterba

btrfs: sink gfp parameter to clear_extent_bits

Callers pass GFP_NOFS and GFP_KERNEL. No need to pass the flags around.
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 ceeb0ae7
...@@ -4357,7 +4357,7 @@ static int btrfs_destroy_marked_extents(struct btrfs_root *root, ...@@ -4357,7 +4357,7 @@ static int btrfs_destroy_marked_extents(struct btrfs_root *root,
if (ret) if (ret)
break; break;
clear_extent_bits(dirty_pages, start, end, mark, GFP_NOFS); clear_extent_bits(dirty_pages, start, end, mark);
while (start <= end) { while (start <= end) {
eb = btrfs_find_tree_block(root->fs_info, start); eb = btrfs_find_tree_block(root->fs_info, start);
start += root->nodesize; start += root->nodesize;
......
...@@ -246,9 +246,9 @@ static void free_excluded_extents(struct btrfs_root *root, ...@@ -246,9 +246,9 @@ static void free_excluded_extents(struct btrfs_root *root,
end = start + cache->key.offset - 1; end = start + cache->key.offset - 1;
clear_extent_bits(&root->fs_info->freed_extents[0], clear_extent_bits(&root->fs_info->freed_extents[0],
start, end, EXTENT_UPTODATE, GFP_NOFS); start, end, EXTENT_UPTODATE);
clear_extent_bits(&root->fs_info->freed_extents[1], clear_extent_bits(&root->fs_info->freed_extents[1],
start, end, EXTENT_UPTODATE, GFP_NOFS); start, end, EXTENT_UPTODATE);
} }
static int exclude_super_stripes(struct btrfs_root *root, static int exclude_super_stripes(struct btrfs_root *root,
...@@ -10526,14 +10526,14 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info) ...@@ -10526,14 +10526,14 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
*/ */
mutex_lock(&fs_info->unused_bg_unpin_mutex); mutex_lock(&fs_info->unused_bg_unpin_mutex);
ret = clear_extent_bits(&fs_info->freed_extents[0], start, end, ret = clear_extent_bits(&fs_info->freed_extents[0], start, end,
EXTENT_DIRTY, GFP_NOFS); EXTENT_DIRTY);
if (ret) { if (ret) {
mutex_unlock(&fs_info->unused_bg_unpin_mutex); mutex_unlock(&fs_info->unused_bg_unpin_mutex);
btrfs_dec_block_group_ro(root, block_group); btrfs_dec_block_group_ro(root, block_group);
goto end_trans; goto end_trans;
} }
ret = clear_extent_bits(&fs_info->freed_extents[1], start, end, ret = clear_extent_bits(&fs_info->freed_extents[1], start, end,
EXTENT_DIRTY, GFP_NOFS); EXTENT_DIRTY);
if (ret) { if (ret) {
mutex_unlock(&fs_info->unused_bg_unpin_mutex); mutex_unlock(&fs_info->unused_bg_unpin_mutex);
btrfs_dec_block_group_ro(root, block_group); btrfs_dec_block_group_ro(root, block_group);
......
...@@ -1975,13 +1975,13 @@ int free_io_failure(struct inode *inode, struct io_failure_record *rec) ...@@ -1975,13 +1975,13 @@ int free_io_failure(struct inode *inode, struct io_failure_record *rec)
set_state_failrec(failure_tree, rec->start, NULL); set_state_failrec(failure_tree, rec->start, NULL);
ret = clear_extent_bits(failure_tree, rec->start, ret = clear_extent_bits(failure_tree, rec->start,
rec->start + rec->len - 1, rec->start + rec->len - 1,
EXTENT_LOCKED | EXTENT_DIRTY, GFP_NOFS); EXTENT_LOCKED | EXTENT_DIRTY);
if (ret) if (ret)
err = ret; err = ret;
ret = clear_extent_bits(&BTRFS_I(inode)->io_tree, rec->start, ret = clear_extent_bits(&BTRFS_I(inode)->io_tree, rec->start,
rec->start + rec->len - 1, rec->start + rec->len - 1,
EXTENT_DAMAGED, GFP_NOFS); EXTENT_DAMAGED);
if (ret && !err) if (ret && !err)
err = ret; err = ret;
......
...@@ -241,14 +241,15 @@ static inline int unlock_extent_cached(struct extent_io_tree *tree, u64 start, ...@@ -241,14 +241,15 @@ static inline int unlock_extent_cached(struct extent_io_tree *tree, u64 start,
} }
static inline int clear_extent_bits(struct extent_io_tree *tree, u64 start, static inline int clear_extent_bits(struct extent_io_tree *tree, u64 start,
u64 end, unsigned bits, gfp_t mask) u64 end, unsigned bits)
{ {
int wake = 0; int wake = 0;
if (bits & EXTENT_LOCKED) if (bits & EXTENT_LOCKED)
wake = 1; wake = 1;
return clear_extent_bit(tree, start, end, bits, wake, 0, NULL, mask); return clear_extent_bit(tree, start, end, bits, wake, 0, NULL,
GFP_NOFS);
} }
int set_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, int set_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
......
...@@ -3103,8 +3103,7 @@ static int btrfs_readpage_end_io_hook(struct btrfs_io_bio *io_bio, ...@@ -3103,8 +3103,7 @@ static int btrfs_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID && if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID &&
test_range_bit(io_tree, start, end, EXTENT_NODATASUM, 1, NULL)) { test_range_bit(io_tree, start, end, EXTENT_NODATASUM, 1, NULL)) {
clear_extent_bits(io_tree, start, end, EXTENT_NODATASUM, clear_extent_bits(io_tree, start, end, EXTENT_NODATASUM);
GFP_NOFS);
return 0; return 0;
} }
......
...@@ -4059,8 +4059,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) ...@@ -4059,8 +4059,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
} }
btrfs_release_path(path); btrfs_release_path(path);
clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY, clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY);
GFP_NOFS);
if (trans) { if (trans) {
btrfs_end_transaction_throttle(trans, rc->extent_root); btrfs_end_transaction_throttle(trans, rc->extent_root);
......
...@@ -763,7 +763,7 @@ static int scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *fixup_ctx) ...@@ -763,7 +763,7 @@ static int scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *fixup_ctx)
end, EXTENT_DAMAGED, 0, NULL); end, EXTENT_DAMAGED, 0, NULL);
if (!corrected) if (!corrected)
clear_extent_bits(&BTRFS_I(inode)->io_tree, offset, end, clear_extent_bits(&BTRFS_I(inode)->io_tree, offset, end,
EXTENT_DAMAGED, GFP_NOFS); EXTENT_DAMAGED);
} }
out: out:
......
...@@ -262,7 +262,7 @@ static int test_find_delalloc(void) ...@@ -262,7 +262,7 @@ static int test_find_delalloc(void)
} }
ret = 0; ret = 0;
out_bits: out_bits:
clear_extent_bits(&tmp, 0, total_dirty - 1, (unsigned)-1, GFP_KERNEL); clear_extent_bits(&tmp, 0, total_dirty - 1, (unsigned)-1);
out: out:
if (locked_page) if (locked_page)
put_page(locked_page); put_page(locked_page);
......
...@@ -3001,7 +3001,7 @@ static void free_log_tree(struct btrfs_trans_handle *trans, ...@@ -3001,7 +3001,7 @@ static void free_log_tree(struct btrfs_trans_handle *trans,
break; break;
clear_extent_bits(&log->dirty_log_pages, start, end, clear_extent_bits(&log->dirty_log_pages, start, end,
EXTENT_DIRTY | EXTENT_NEW, GFP_NOFS); EXTENT_DIRTY | EXTENT_NEW);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册