aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2013-04-25 16:41:01 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-05-06 15:55:23 -0400
commit48a3b6366f6913683563d934eb16fea67dead9c1 (patch)
treeeb26170d3a5ddb6f81ae612db21fb8fba14e655d /fs/btrfs/extent_io.c
parent634554dc0acfc8753c05e432b2fdb34b0be89c78 (diff)
btrfs: make static code static & remove dead code
Big patch, but all it does is add statics to functions which are in fact static, then remove the associated dead-code fallout. removed functions: btrfs_iref_to_path() __btrfs_lookup_delayed_deletion_item() __btrfs_search_delayed_insertion_item() __btrfs_search_delayed_deletion_item() find_eb_for_page() btrfs_find_block_group() range_straddles_pages() extent_range_uptodate() btrfs_file_extent_length() btrfs_scrub_cancel_devid() btrfs_start_transaction_lflush() btrfs_print_tree() is left because it is used for debugging. btrfs_start_transaction_lflush() and btrfs_reada_detach() are left for symmetry. ulist.c functions are left, another patch will take care of those. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c61
1 files changed, 11 insertions, 50 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index f110d12de2d5..77c5914f6090 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -477,7 +477,7 @@ alloc_extent_state_atomic(struct extent_state *prealloc)
477 return prealloc; 477 return prealloc;
478} 478}
479 479
480void extent_io_tree_panic(struct extent_io_tree *tree, int err) 480static void extent_io_tree_panic(struct extent_io_tree *tree, int err)
481{ 481{
482 btrfs_panic(tree_fs_info(tree), err, "Locking error: " 482 btrfs_panic(tree_fs_info(tree), err, "Locking error: "
483 "Extent tree was modified by another " 483 "Extent tree was modified by another "
@@ -658,7 +658,8 @@ static void wait_on_state(struct extent_io_tree *tree,
658 * The range [start, end] is inclusive. 658 * The range [start, end] is inclusive.
659 * The tree lock is taken by this function 659 * The tree lock is taken by this function
660 */ 660 */
661void wait_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, int bits) 661static void wait_extent_bit(struct extent_io_tree *tree, u64 start,
662 u64 end, int bits)
662{ 663{
663 struct extent_state *state; 664 struct extent_state *state;
664 struct rb_node *node; 665 struct rb_node *node;
@@ -1327,8 +1328,9 @@ static int set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end)
1327 * return it. tree->lock must be held. NULL will returned if 1328 * return it. tree->lock must be held. NULL will returned if
1328 * nothing was found after 'start' 1329 * nothing was found after 'start'
1329 */ 1330 */
1330struct extent_state *find_first_extent_bit_state(struct extent_io_tree *tree, 1331static struct extent_state *
1331 u64 start, int bits) 1332find_first_extent_bit_state(struct extent_io_tree *tree,
1333 u64 start, int bits)
1332{ 1334{
1333 struct rb_node *node; 1335 struct rb_node *node;
1334 struct extent_state *state; 1336 struct extent_state *state;
@@ -2668,7 +2670,8 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree,
2668 return ret; 2670 return ret;
2669} 2671}
2670 2672
2671void attach_extent_buffer_page(struct extent_buffer *eb, struct page *page) 2673static void attach_extent_buffer_page(struct extent_buffer *eb,
2674 struct page *page)
2672{ 2675{
2673 if (!PagePrivate(page)) { 2676 if (!PagePrivate(page)) {
2674 SetPagePrivate(page); 2677 SetPagePrivate(page);
@@ -3786,9 +3789,9 @@ int extent_invalidatepage(struct extent_io_tree *tree,
3786 * are locked or under IO and drops the related state bits if it is safe 3789 * are locked or under IO and drops the related state bits if it is safe
3787 * to drop the page. 3790 * to drop the page.
3788 */ 3791 */
3789int try_release_extent_state(struct extent_map_tree *map, 3792static int try_release_extent_state(struct extent_map_tree *map,
3790 struct extent_io_tree *tree, struct page *page, 3793 struct extent_io_tree *tree,
3791 gfp_t mask) 3794 struct page *page, gfp_t mask)
3792{ 3795{
3793 u64 start = page_offset(page); 3796 u64 start = page_offset(page);
3794 u64 end = start + PAGE_CACHE_SIZE - 1; 3797 u64 end = start + PAGE_CACHE_SIZE - 1;
@@ -4571,17 +4574,6 @@ int set_extent_buffer_dirty(struct extent_buffer *eb)
4571 return was_dirty; 4574 return was_dirty;
4572} 4575}
4573 4576
4574static int range_straddles_pages(u64 start, u64 len)
4575{
4576 if (len < PAGE_CACHE_SIZE)
4577 return 1;
4578 if (start & (PAGE_CACHE_SIZE - 1))
4579 return 1;
4580 if ((start + len) & (PAGE_CACHE_SIZE - 1))
4581 return 1;
4582 return 0;
4583}
4584
4585int clear_extent_buffer_uptodate(struct extent_buffer *eb) 4577int clear_extent_buffer_uptodate(struct extent_buffer *eb)
4586{ 4578{
4587 unsigned long i; 4579 unsigned long i;
@@ -4613,37 +4605,6 @@ int set_extent_buffer_uptodate(struct extent_buffer *eb)
4613 return 0; 4605 return 0;
4614} 4606}
4615 4607
4616int extent_range_uptodate(struct extent_io_tree *tree,
4617 u64 start, u64 end)
4618{
4619 struct page *page;
4620 int ret;
4621 int pg_uptodate = 1;
4622 int uptodate;
4623 unsigned long index;
4624
4625 if (range_straddles_pages(start, end - start + 1)) {
4626 ret = test_range_bit(tree, start, end,
4627 EXTENT_UPTODATE, 1, NULL);
4628 if (ret)
4629 return 1;
4630 }
4631 while (start <= end) {
4632 index = start >> PAGE_CACHE_SHIFT;
4633 page = find_get_page(tree->mapping, index);
4634 if (!page)
4635 return 1;
4636 uptodate = PageUptodate(page);
4637 page_cache_release(page);
4638 if (!uptodate) {
4639 pg_uptodate = 0;
4640 break;
4641 }
4642 start += PAGE_CACHE_SIZE;
4643 }
4644 return pg_uptodate;
4645}
4646
4647int extent_buffer_uptodate(struct extent_buffer *eb) 4608int extent_buffer_uptodate(struct extent_buffer *eb)
4648{ 4609{
4649 return test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags); 4610 return test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);