aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-04-26 17:54:39 -0400
committerDavid Sterba <dsterba@suse.com>2016-04-29 05:01:47 -0400
commit91166212e0ffbb4db50aa8a238548e967008b33d (patch)
tree39ddd7b777e11e65b514ea6e991d317c348179f4
parentceeb0ae7bf42a3deaaaee981d2da02e5d3ad2b0f (diff)
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: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/disk-io.c2
-rw-r--r--fs/btrfs/extent-tree.c8
-rw-r--r--fs/btrfs/extent_io.c4
-rw-r--r--fs/btrfs/extent_io.h5
-rw-r--r--fs/btrfs/inode.c3
-rw-r--r--fs/btrfs/relocation.c3
-rw-r--r--fs/btrfs/scrub.c2
-rw-r--r--fs/btrfs/tests/extent-io-tests.c2
-rw-r--r--fs/btrfs/tree-log.c2
9 files changed, 15 insertions, 16 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 4e47849d7427..3bc88b4b0032 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -4357,7 +4357,7 @@ static int btrfs_destroy_marked_extents(struct btrfs_root *root,
4357 if (ret) 4357 if (ret)
4358 break; 4358 break;
4359 4359
4360 clear_extent_bits(dirty_pages, start, end, mark, GFP_NOFS); 4360 clear_extent_bits(dirty_pages, start, end, mark);
4361 while (start <= end) { 4361 while (start <= end) {
4362 eb = btrfs_find_tree_block(root->fs_info, start); 4362 eb = btrfs_find_tree_block(root->fs_info, start);
4363 start += root->nodesize; 4363 start += root->nodesize;
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 0cfddbe8abba..b1c6d7634e88 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -246,9 +246,9 @@ static void free_excluded_extents(struct btrfs_root *root,
246 end = start + cache->key.offset - 1; 246 end = start + cache->key.offset - 1;
247 247
248 clear_extent_bits(&root->fs_info->freed_extents[0], 248 clear_extent_bits(&root->fs_info->freed_extents[0],
249 start, end, EXTENT_UPTODATE, GFP_NOFS); 249 start, end, EXTENT_UPTODATE);
250 clear_extent_bits(&root->fs_info->freed_extents[1], 250 clear_extent_bits(&root->fs_info->freed_extents[1],
251 start, end, EXTENT_UPTODATE, GFP_NOFS); 251 start, end, EXTENT_UPTODATE);
252} 252}
253 253
254static int exclude_super_stripes(struct btrfs_root *root, 254static int exclude_super_stripes(struct btrfs_root *root,
@@ -10526,14 +10526,14 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
10526 */ 10526 */
10527 mutex_lock(&fs_info->unused_bg_unpin_mutex); 10527 mutex_lock(&fs_info->unused_bg_unpin_mutex);
10528 ret = clear_extent_bits(&fs_info->freed_extents[0], start, end, 10528 ret = clear_extent_bits(&fs_info->freed_extents[0], start, end,
10529 EXTENT_DIRTY, GFP_NOFS); 10529 EXTENT_DIRTY);
10530 if (ret) { 10530 if (ret) {
10531 mutex_unlock(&fs_info->unused_bg_unpin_mutex); 10531 mutex_unlock(&fs_info->unused_bg_unpin_mutex);
10532 btrfs_dec_block_group_ro(root, block_group); 10532 btrfs_dec_block_group_ro(root, block_group);
10533 goto end_trans; 10533 goto end_trans;
10534 } 10534 }
10535 ret = clear_extent_bits(&fs_info->freed_extents[1], start, end, 10535 ret = clear_extent_bits(&fs_info->freed_extents[1], start, end,
10536 EXTENT_DIRTY, GFP_NOFS); 10536 EXTENT_DIRTY);
10537 if (ret) { 10537 if (ret) {
10538 mutex_unlock(&fs_info->unused_bg_unpin_mutex); 10538 mutex_unlock(&fs_info->unused_bg_unpin_mutex);
10539 btrfs_dec_block_group_ro(root, block_group); 10539 btrfs_dec_block_group_ro(root, block_group);
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 3b53d217066c..2946c1522870 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1975,13 +1975,13 @@ int free_io_failure(struct inode *inode, struct io_failure_record *rec)
1975 set_state_failrec(failure_tree, rec->start, NULL); 1975 set_state_failrec(failure_tree, rec->start, NULL);
1976 ret = clear_extent_bits(failure_tree, rec->start, 1976 ret = clear_extent_bits(failure_tree, rec->start,
1977 rec->start + rec->len - 1, 1977 rec->start + rec->len - 1,
1978 EXTENT_LOCKED | EXTENT_DIRTY, GFP_NOFS); 1978 EXTENT_LOCKED | EXTENT_DIRTY);
1979 if (ret) 1979 if (ret)
1980 err = ret; 1980 err = ret;
1981 1981
1982 ret = clear_extent_bits(&BTRFS_I(inode)->io_tree, rec->start, 1982 ret = clear_extent_bits(&BTRFS_I(inode)->io_tree, rec->start,
1983 rec->start + rec->len - 1, 1983 rec->start + rec->len - 1,
1984 EXTENT_DAMAGED, GFP_NOFS); 1984 EXTENT_DAMAGED);
1985 if (ret && !err) 1985 if (ret && !err)
1986 err = ret; 1986 err = ret;
1987 1987
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index 447c6e6ff88c..90c5c8176162 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -241,14 +241,15 @@ static inline int unlock_extent_cached(struct extent_io_tree *tree, u64 start,
241} 241}
242 242
243static inline int clear_extent_bits(struct extent_io_tree *tree, u64 start, 243static inline int clear_extent_bits(struct extent_io_tree *tree, u64 start,
244 u64 end, unsigned bits, gfp_t mask) 244 u64 end, unsigned bits)
245{ 245{
246 int wake = 0; 246 int wake = 0;
247 247
248 if (bits & EXTENT_LOCKED) 248 if (bits & EXTENT_LOCKED)
249 wake = 1; 249 wake = 1;
250 250
251 return clear_extent_bit(tree, start, end, bits, wake, 0, NULL, mask); 251 return clear_extent_bit(tree, start, end, bits, wake, 0, NULL,
252 GFP_NOFS);
252} 253}
253 254
254int set_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, 255int set_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 2aaba58b4856..d37997f4eb98 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3103,8 +3103,7 @@ static int btrfs_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
3103 3103
3104 if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID && 3104 if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID &&
3105 test_range_bit(io_tree, start, end, EXTENT_NODATASUM, 1, NULL)) { 3105 test_range_bit(io_tree, start, end, EXTENT_NODATASUM, 1, NULL)) {
3106 clear_extent_bits(io_tree, start, end, EXTENT_NODATASUM, 3106 clear_extent_bits(io_tree, start, end, EXTENT_NODATASUM);
3107 GFP_NOFS);
3108 return 0; 3107 return 0;
3109 } 3108 }
3110 3109
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 78cbfb530de6..bd5ea1a8a9f1 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -4059,8 +4059,7 @@ restart:
4059 } 4059 }
4060 4060
4061 btrfs_release_path(path); 4061 btrfs_release_path(path);
4062 clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY, 4062 clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY);
4063 GFP_NOFS);
4064 4063
4065 if (trans) { 4064 if (trans) {
4066 btrfs_end_transaction_throttle(trans, rc->extent_root); 4065 btrfs_end_transaction_throttle(trans, rc->extent_root);
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 9d24375eed1f..841dae874a21 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -763,7 +763,7 @@ static int scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *fixup_ctx)
763 end, EXTENT_DAMAGED, 0, NULL); 763 end, EXTENT_DAMAGED, 0, NULL);
764 if (!corrected) 764 if (!corrected)
765 clear_extent_bits(&BTRFS_I(inode)->io_tree, offset, end, 765 clear_extent_bits(&BTRFS_I(inode)->io_tree, offset, end,
766 EXTENT_DAMAGED, GFP_NOFS); 766 EXTENT_DAMAGED);
767 } 767 }
768 768
769out: 769out:
diff --git a/fs/btrfs/tests/extent-io-tests.c b/fs/btrfs/tests/extent-io-tests.c
index 70948b13bc81..88e28e5d2c38 100644
--- a/fs/btrfs/tests/extent-io-tests.c
+++ b/fs/btrfs/tests/extent-io-tests.c
@@ -262,7 +262,7 @@ static int test_find_delalloc(void)
262 } 262 }
263 ret = 0; 263 ret = 0;
264out_bits: 264out_bits:
265 clear_extent_bits(&tmp, 0, total_dirty - 1, (unsigned)-1, GFP_KERNEL); 265 clear_extent_bits(&tmp, 0, total_dirty - 1, (unsigned)-1);
266out: 266out:
267 if (locked_page) 267 if (locked_page)
268 put_page(locked_page); 268 put_page(locked_page);
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 517d0ccb351e..a111e275ab9e 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3001,7 +3001,7 @@ static void free_log_tree(struct btrfs_trans_handle *trans,
3001 break; 3001 break;
3002 3002
3003 clear_extent_bits(&log->dirty_log_pages, start, end, 3003 clear_extent_bits(&log->dirty_log_pages, start, end,
3004 EXTENT_DIRTY | EXTENT_NEW, GFP_NOFS); 3004 EXTENT_DIRTY | EXTENT_NEW);
3005 } 3005 }
3006 3006
3007 /* 3007 /*