aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2015-12-03 08:30:40 -0500
committerDavid Sterba <dsterba@suse.com>2015-12-03 08:30:40 -0500
commitff13db41f184f8222aca0cb653347ccdd48a057a (patch)
tree779a0a54ab4b5ca2b9382546a9dd27d675df8041
parente83b1d91f872a4cf7bf0d3528044fc9e43260e2b (diff)
btrfs: drop unused parameter from lock_extent_bits
We've always passed 0. Stack usage will slightly decrease. Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/disk-io.c2
-rw-r--r--fs/btrfs/extent_io.c12
-rw-r--r--fs/btrfs/extent_io.h2
-rw-r--r--fs/btrfs/file.c8
-rw-r--r--fs/btrfs/free-space-cache.c2
-rw-r--r--fs/btrfs/inode.c20
-rw-r--r--fs/btrfs/ioctl.c6
-rw-r--r--fs/btrfs/scrub.c2
8 files changed, 27 insertions, 27 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 974be09e7556..68ceed712df2 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -362,7 +362,7 @@ static int verify_parent_transid(struct extent_io_tree *io_tree,
362 } 362 }
363 363
364 lock_extent_bits(io_tree, eb->start, eb->start + eb->len - 1, 364 lock_extent_bits(io_tree, eb->start, eb->start + eb->len - 1,
365 0, &cached_state); 365 &cached_state);
366 if (extent_buffer_uptodate(eb) && 366 if (extent_buffer_uptodate(eb) &&
367 btrfs_header_generation(eb) == parent_transid) { 367 btrfs_header_generation(eb) == parent_transid) {
368 ret = 0; 368 ret = 0;
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 3d9935e0d03e..bf9849909d46 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1328,13 +1328,13 @@ int clear_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
1328 * us if waiting is desired. 1328 * us if waiting is desired.
1329 */ 1329 */
1330int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, 1330int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
1331 unsigned bits, struct extent_state **cached_state) 1331 struct extent_state **cached_state)
1332{ 1332{
1333 int err; 1333 int err;
1334 u64 failed_start; 1334 u64 failed_start;
1335 1335
1336 while (1) { 1336 while (1) {
1337 err = __set_extent_bit(tree, start, end, EXTENT_LOCKED | bits, 1337 err = __set_extent_bit(tree, start, end, EXTENT_LOCKED,
1338 EXTENT_LOCKED, &failed_start, 1338 EXTENT_LOCKED, &failed_start,
1339 cached_state, GFP_NOFS, NULL); 1339 cached_state, GFP_NOFS, NULL);
1340 if (err == -EEXIST) { 1340 if (err == -EEXIST) {
@@ -1349,7 +1349,7 @@ int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
1349 1349
1350int lock_extent(struct extent_io_tree *tree, u64 start, u64 end) 1350int lock_extent(struct extent_io_tree *tree, u64 start, u64 end)
1351{ 1351{
1352 return lock_extent_bits(tree, start, end, 0, NULL); 1352 return lock_extent_bits(tree, start, end, NULL);
1353} 1353}
1354 1354
1355int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end) 1355int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end)
@@ -1717,7 +1717,7 @@ again:
1717 BUG_ON(ret); /* Only valid values are 0 and -EAGAIN */ 1717 BUG_ON(ret); /* Only valid values are 0 and -EAGAIN */
1718 1718
1719 /* step three, lock the state bits for the whole range */ 1719 /* step three, lock the state bits for the whole range */
1720 lock_extent_bits(tree, delalloc_start, delalloc_end, 0, &cached_state); 1720 lock_extent_bits(tree, delalloc_start, delalloc_end, &cached_state);
1721 1721
1722 /* then test to make sure it is all still delalloc */ 1722 /* then test to make sure it is all still delalloc */
1723 ret = test_range_bit(tree, delalloc_start, delalloc_end, 1723 ret = test_range_bit(tree, delalloc_start, delalloc_end,
@@ -4243,7 +4243,7 @@ int extent_invalidatepage(struct extent_io_tree *tree,
4243 if (start > end) 4243 if (start > end)
4244 return 0; 4244 return 0;
4245 4245
4246 lock_extent_bits(tree, start, end, 0, &cached_state); 4246 lock_extent_bits(tree, start, end, &cached_state);
4247 wait_on_page_writeback(page); 4247 wait_on_page_writeback(page);
4248 clear_extent_bit(tree, start, end, 4248 clear_extent_bit(tree, start, end,
4249 EXTENT_LOCKED | EXTENT_DIRTY | EXTENT_DELALLOC | 4249 EXTENT_LOCKED | EXTENT_DIRTY | EXTENT_DELALLOC |
@@ -4453,7 +4453,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
4453 last_for_get_extent = isize; 4453 last_for_get_extent = isize;
4454 } 4454 }
4455 4455
4456 lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len - 1, 0, 4456 lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len - 1,
4457 &cached_state); 4457 &cached_state);
4458 4458
4459 em = get_extent_skip_holes(inode, start, last_for_get_extent, 4459 em = get_extent_skip_holes(inode, start, last_for_get_extent,
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index 07cae0cccd43..e5726a3f9ce5 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -201,7 +201,7 @@ int try_release_extent_mapping(struct extent_map_tree *map,
201int try_release_extent_buffer(struct page *page); 201int try_release_extent_buffer(struct page *page);
202int lock_extent(struct extent_io_tree *tree, u64 start, u64 end); 202int lock_extent(struct extent_io_tree *tree, u64 start, u64 end);
203int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, 203int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
204 unsigned bits, struct extent_state **cached); 204 struct extent_state **cached);
205int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end); 205int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end);
206int extent_read_full_page(struct extent_io_tree *tree, struct page *page, 206int extent_read_full_page(struct extent_io_tree *tree, struct page *page,
207 get_extent_t *get_extent, int mirror_num); 207 get_extent_t *get_extent, int mirror_num);
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 977e715f0bf2..8a00298f8094 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1384,7 +1384,7 @@ lock_and_cleanup_extent_if_need(struct inode *inode, struct page **pages,
1384 if (start_pos < inode->i_size) { 1384 if (start_pos < inode->i_size) {
1385 struct btrfs_ordered_extent *ordered; 1385 struct btrfs_ordered_extent *ordered;
1386 lock_extent_bits(&BTRFS_I(inode)->io_tree, 1386 lock_extent_bits(&BTRFS_I(inode)->io_tree,
1387 start_pos, last_pos, 0, cached_state); 1387 start_pos, last_pos, cached_state);
1388 ordered = btrfs_lookup_ordered_range(inode, start_pos, 1388 ordered = btrfs_lookup_ordered_range(inode, start_pos,
1389 last_pos - start_pos + 1); 1389 last_pos - start_pos + 1);
1390 if (ordered && 1390 if (ordered &&
@@ -2384,7 +2384,7 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
2384 truncate_pagecache_range(inode, lockstart, lockend); 2384 truncate_pagecache_range(inode, lockstart, lockend);
2385 2385
2386 lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend, 2386 lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend,
2387 0, &cached_state); 2387 &cached_state);
2388 ordered = btrfs_lookup_first_ordered_extent(inode, lockend); 2388 ordered = btrfs_lookup_first_ordered_extent(inode, lockend);
2389 2389
2390 /* 2390 /*
@@ -2691,7 +2691,7 @@ static long btrfs_fallocate(struct file *file, int mode,
2691 * transaction 2691 * transaction
2692 */ 2692 */
2693 lock_extent_bits(&BTRFS_I(inode)->io_tree, alloc_start, 2693 lock_extent_bits(&BTRFS_I(inode)->io_tree, alloc_start,
2694 locked_end, 0, &cached_state); 2694 locked_end, &cached_state);
2695 ordered = btrfs_lookup_first_ordered_extent(inode, 2695 ordered = btrfs_lookup_first_ordered_extent(inode,
2696 alloc_end - 1); 2696 alloc_end - 1);
2697 if (ordered && 2697 if (ordered &&
@@ -2838,7 +2838,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int whence)
2838 lockend--; 2838 lockend--;
2839 len = lockend - lockstart + 1; 2839 len = lockend - lockstart + 1;
2840 2840
2841 lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend, 0, 2841 lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend,
2842 &cached_state); 2842 &cached_state);
2843 2843
2844 while (start < inode->i_size) { 2844 while (start < inode->i_size) {
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 85a1f8621b51..b68837809f1e 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -1261,7 +1261,7 @@ static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
1261 goto out; 1261 goto out;
1262 1262
1263 lock_extent_bits(&BTRFS_I(inode)->io_tree, 0, i_size_read(inode) - 1, 1263 lock_extent_bits(&BTRFS_I(inode)->io_tree, 0, i_size_read(inode) - 1,
1264 0, &cached_state); 1264 &cached_state);
1265 1265
1266 io_ctl_set_generation(io_ctl, trans->transid); 1266 io_ctl_set_generation(io_ctl, trans->transid);
1267 1267
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 994490d5fa64..827a7262a206 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1989,7 +1989,7 @@ again:
1989 page_start = page_offset(page); 1989 page_start = page_offset(page);
1990 page_end = page_offset(page) + PAGE_CACHE_SIZE - 1; 1990 page_end = page_offset(page) + PAGE_CACHE_SIZE - 1;
1991 1991
1992 lock_extent_bits(&BTRFS_I(inode)->io_tree, page_start, page_end, 0, 1992 lock_extent_bits(&BTRFS_I(inode)->io_tree, page_start, page_end,
1993 &cached_state); 1993 &cached_state);
1994 1994
1995 /* already ordered? We're done */ 1995 /* already ordered? We're done */
@@ -2482,7 +2482,7 @@ static noinline int relink_extent_backref(struct btrfs_path *path,
2482 lock_start = backref->file_pos; 2482 lock_start = backref->file_pos;
2483 lock_end = backref->file_pos + backref->num_bytes - 1; 2483 lock_end = backref->file_pos + backref->num_bytes - 1;
2484 lock_extent_bits(&BTRFS_I(inode)->io_tree, lock_start, lock_end, 2484 lock_extent_bits(&BTRFS_I(inode)->io_tree, lock_start, lock_end,
2485 0, &cached); 2485 &cached);
2486 2486
2487 ordered = btrfs_lookup_first_ordered_extent(inode, lock_end); 2487 ordered = btrfs_lookup_first_ordered_extent(inode, lock_end);
2488 if (ordered) { 2488 if (ordered) {
@@ -2874,7 +2874,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
2874 2874
2875 lock_extent_bits(io_tree, ordered_extent->file_offset, 2875 lock_extent_bits(io_tree, ordered_extent->file_offset,
2876 ordered_extent->file_offset + ordered_extent->len - 1, 2876 ordered_extent->file_offset + ordered_extent->len - 1,
2877 0, &cached_state); 2877 &cached_state);
2878 2878
2879 ret = test_range_bit(io_tree, ordered_extent->file_offset, 2879 ret = test_range_bit(io_tree, ordered_extent->file_offset,
2880 ordered_extent->file_offset + ordered_extent->len - 1, 2880 ordered_extent->file_offset + ordered_extent->len - 1,
@@ -4690,7 +4690,7 @@ again:
4690 } 4690 }
4691 wait_on_page_writeback(page); 4691 wait_on_page_writeback(page);
4692 4692
4693 lock_extent_bits(io_tree, page_start, page_end, 0, &cached_state); 4693 lock_extent_bits(io_tree, page_start, page_end, &cached_state);
4694 set_page_extent_mapped(page); 4694 set_page_extent_mapped(page);
4695 4695
4696 ordered = btrfs_lookup_ordered_extent(inode, page_start); 4696 ordered = btrfs_lookup_ordered_extent(inode, page_start);
@@ -4821,7 +4821,7 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size)
4821 while (1) { 4821 while (1) {
4822 struct btrfs_ordered_extent *ordered; 4822 struct btrfs_ordered_extent *ordered;
4823 4823
4824 lock_extent_bits(io_tree, hole_start, block_end - 1, 0, 4824 lock_extent_bits(io_tree, hole_start, block_end - 1,
4825 &cached_state); 4825 &cached_state);
4826 ordered = btrfs_lookup_ordered_range(inode, hole_start, 4826 ordered = btrfs_lookup_ordered_range(inode, hole_start,
4827 block_end - hole_start); 4827 block_end - hole_start);
@@ -5133,7 +5133,7 @@ static void evict_inode_truncate_pages(struct inode *inode)
5133 end = state->end; 5133 end = state->end;
5134 spin_unlock(&io_tree->lock); 5134 spin_unlock(&io_tree->lock);
5135 5135
5136 lock_extent_bits(io_tree, start, end, 0, &cached_state); 5136 lock_extent_bits(io_tree, start, end, &cached_state);
5137 5137
5138 /* 5138 /*
5139 * If still has DELALLOC flag, the extent didn't reach disk, 5139 * If still has DELALLOC flag, the extent didn't reach disk,
@@ -7402,7 +7402,7 @@ static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend,
7402 7402
7403 while (1) { 7403 while (1) {
7404 lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend, 7404 lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend,
7405 0, cached_state); 7405 cached_state);
7406 /* 7406 /*
7407 * We're concerned with the entire range that we're going to be 7407 * We're concerned with the entire range that we're going to be
7408 * doing DIO to, so we need to make sure theres no ordered 7408 * doing DIO to, so we need to make sure theres no ordered
@@ -8636,7 +8636,7 @@ static void btrfs_invalidatepage(struct page *page, unsigned int offset,
8636 } 8636 }
8637 8637
8638 if (!inode_evicting) 8638 if (!inode_evicting)
8639 lock_extent_bits(tree, page_start, page_end, 0, &cached_state); 8639 lock_extent_bits(tree, page_start, page_end, &cached_state);
8640 ordered = btrfs_lookup_ordered_extent(inode, page_start); 8640 ordered = btrfs_lookup_ordered_extent(inode, page_start);
8641 if (ordered) { 8641 if (ordered) {
8642 /* 8642 /*
@@ -8674,7 +8674,7 @@ static void btrfs_invalidatepage(struct page *page, unsigned int offset,
8674 btrfs_put_ordered_extent(ordered); 8674 btrfs_put_ordered_extent(ordered);
8675 if (!inode_evicting) { 8675 if (!inode_evicting) {
8676 cached_state = NULL; 8676 cached_state = NULL;
8677 lock_extent_bits(tree, page_start, page_end, 0, 8677 lock_extent_bits(tree, page_start, page_end,
8678 &cached_state); 8678 &cached_state);
8679 } 8679 }
8680 } 8680 }
@@ -8772,7 +8772,7 @@ again:
8772 } 8772 }
8773 wait_on_page_writeback(page); 8773 wait_on_page_writeback(page);
8774 8774
8775 lock_extent_bits(io_tree, page_start, page_end, 0, &cached_state); 8775 lock_extent_bits(io_tree, page_start, page_end, &cached_state);
8776 set_page_extent_mapped(page); 8776 set_page_extent_mapped(page);
8777 8777
8778 /* 8778 /*
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index da94138eb85e..164320648d26 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -992,7 +992,7 @@ static struct extent_map *defrag_lookup_extent(struct inode *inode, u64 start)
992 u64 end = start + len - 1; 992 u64 end = start + len - 1;
993 993
994 /* get the big lock and read metadata off disk */ 994 /* get the big lock and read metadata off disk */
995 lock_extent_bits(io_tree, start, end, 0, &cached); 995 lock_extent_bits(io_tree, start, end, &cached);
996 em = btrfs_get_extent(inode, NULL, 0, start, len, 0); 996 em = btrfs_get_extent(inode, NULL, 0, start, len, 0);
997 unlock_extent_cached(io_tree, start, end, &cached, GFP_NOFS); 997 unlock_extent_cached(io_tree, start, end, &cached, GFP_NOFS);
998 998
@@ -1140,7 +1140,7 @@ again:
1140 page_end = page_start + PAGE_CACHE_SIZE - 1; 1140 page_end = page_start + PAGE_CACHE_SIZE - 1;
1141 while (1) { 1141 while (1) {
1142 lock_extent_bits(tree, page_start, page_end, 1142 lock_extent_bits(tree, page_start, page_end,
1143 0, &cached_state); 1143 &cached_state);
1144 ordered = btrfs_lookup_ordered_extent(inode, 1144 ordered = btrfs_lookup_ordered_extent(inode,
1145 page_start); 1145 page_start);
1146 unlock_extent_cached(tree, page_start, page_end, 1146 unlock_extent_cached(tree, page_start, page_end,
@@ -1200,7 +1200,7 @@ again:
1200 page_end = page_offset(pages[i_done - 1]) + PAGE_CACHE_SIZE; 1200 page_end = page_offset(pages[i_done - 1]) + PAGE_CACHE_SIZE;
1201 1201
1202 lock_extent_bits(&BTRFS_I(inode)->io_tree, 1202 lock_extent_bits(&BTRFS_I(inode)->io_tree,
1203 page_start, page_end - 1, 0, &cached_state); 1203 page_start, page_end - 1, &cached_state);
1204 clear_extent_bit(&BTRFS_I(inode)->io_tree, page_start, 1204 clear_extent_bit(&BTRFS_I(inode)->io_tree, page_start,
1205 page_end - 1, EXTENT_DIRTY | EXTENT_DELALLOC | 1205 page_end - 1, EXTENT_DIRTY | EXTENT_DELALLOC |
1206 EXTENT_DO_ACCOUNTING | EXTENT_DEFRAG, 0, 0, 1206 EXTENT_DO_ACCOUNTING | EXTENT_DEFRAG, 0, 0,
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 2907a77fb1f6..23f396a1b2a8 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -4161,7 +4161,7 @@ static int check_extent_to_block(struct inode *inode, u64 start, u64 len,
4161 4161
4162 io_tree = &BTRFS_I(inode)->io_tree; 4162 io_tree = &BTRFS_I(inode)->io_tree;
4163 4163
4164 lock_extent_bits(io_tree, lockstart, lockend, 0, &cached_state); 4164 lock_extent_bits(io_tree, lockstart, lockend, &cached_state);
4165 ordered = btrfs_lookup_ordered_range(inode, lockstart, len); 4165 ordered = btrfs_lookup_ordered_range(inode, lockstart, len);
4166 if (ordered) { 4166 if (ordered) {
4167 btrfs_put_ordered_extent(ordered); 4167 btrfs_put_ordered_extent(ordered);