diff options
author | Jeff Mahoney <jeffm@suse.com> | 2012-03-01 08:56:26 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2012-03-21 20:45:34 -0400 |
commit | 143bede527b054a271053f41bfaca2b57baa9408 (patch) | |
tree | 95c71d3705c73bf98e7a1547da35e70a44703c1e /fs/btrfs/extent_io.c | |
parent | ffd7b33944f4573a063af7a55f8a5199c8185665 (diff) |
btrfs: return void in functions without error conditions
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 8368baa1f372..65216fabacbb 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -142,6 +142,7 @@ static struct extent_state *alloc_extent_state(gfp_t mask) | |||
142 | #endif | 142 | #endif |
143 | atomic_set(&state->refs, 1); | 143 | atomic_set(&state->refs, 1); |
144 | init_waitqueue_head(&state->wq); | 144 | init_waitqueue_head(&state->wq); |
145 | trace_alloc_extent_state(state, mask, _RET_IP_); | ||
145 | return state; | 146 | return state; |
146 | } | 147 | } |
147 | 148 | ||
@@ -159,6 +160,7 @@ void free_extent_state(struct extent_state *state) | |||
159 | list_del(&state->leak_list); | 160 | list_del(&state->leak_list); |
160 | spin_unlock_irqrestore(&leak_lock, flags); | 161 | spin_unlock_irqrestore(&leak_lock, flags); |
161 | #endif | 162 | #endif |
163 | trace_free_extent_state(state, _RET_IP_); | ||
162 | kmem_cache_free(extent_state_cache, state); | 164 | kmem_cache_free(extent_state_cache, state); |
163 | } | 165 | } |
164 | } | 166 | } |
@@ -617,8 +619,8 @@ search_again: | |||
617 | goto again; | 619 | goto again; |
618 | } | 620 | } |
619 | 621 | ||
620 | static int wait_on_state(struct extent_io_tree *tree, | 622 | static void wait_on_state(struct extent_io_tree *tree, |
621 | struct extent_state *state) | 623 | struct extent_state *state) |
622 | __releases(tree->lock) | 624 | __releases(tree->lock) |
623 | __acquires(tree->lock) | 625 | __acquires(tree->lock) |
624 | { | 626 | { |
@@ -628,7 +630,6 @@ static int wait_on_state(struct extent_io_tree *tree, | |||
628 | schedule(); | 630 | schedule(); |
629 | spin_lock(&tree->lock); | 631 | spin_lock(&tree->lock); |
630 | finish_wait(&state->wq, &wait); | 632 | finish_wait(&state->wq, &wait); |
631 | return 0; | ||
632 | } | 633 | } |
633 | 634 | ||
634 | /* | 635 | /* |
@@ -636,7 +637,7 @@ static int wait_on_state(struct extent_io_tree *tree, | |||
636 | * The range [start, end] is inclusive. | 637 | * The range [start, end] is inclusive. |
637 | * The tree lock is taken by this function | 638 | * The tree lock is taken by this function |
638 | */ | 639 | */ |
639 | int wait_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, int bits) | 640 | void wait_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, int bits) |
640 | { | 641 | { |
641 | struct extent_state *state; | 642 | struct extent_state *state; |
642 | struct rb_node *node; | 643 | struct rb_node *node; |
@@ -673,7 +674,6 @@ again: | |||
673 | } | 674 | } |
674 | out: | 675 | out: |
675 | spin_unlock(&tree->lock); | 676 | spin_unlock(&tree->lock); |
676 | return 0; | ||
677 | } | 677 | } |
678 | 678 | ||
679 | static void set_state_bits(struct extent_io_tree *tree, | 679 | static void set_state_bits(struct extent_io_tree *tree, |
@@ -1359,9 +1359,9 @@ out: | |||
1359 | return found; | 1359 | return found; |
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | static noinline int __unlock_for_delalloc(struct inode *inode, | 1362 | static noinline void __unlock_for_delalloc(struct inode *inode, |
1363 | struct page *locked_page, | 1363 | struct page *locked_page, |
1364 | u64 start, u64 end) | 1364 | u64 start, u64 end) |
1365 | { | 1365 | { |
1366 | int ret; | 1366 | int ret; |
1367 | struct page *pages[16]; | 1367 | struct page *pages[16]; |
@@ -1371,7 +1371,7 @@ static noinline int __unlock_for_delalloc(struct inode *inode, | |||
1371 | int i; | 1371 | int i; |
1372 | 1372 | ||
1373 | if (index == locked_page->index && end_index == index) | 1373 | if (index == locked_page->index && end_index == index) |
1374 | return 0; | 1374 | return; |
1375 | 1375 | ||
1376 | while (nr_pages > 0) { | 1376 | while (nr_pages > 0) { |
1377 | ret = find_get_pages_contig(inode->i_mapping, index, | 1377 | ret = find_get_pages_contig(inode->i_mapping, index, |
@@ -1386,7 +1386,6 @@ static noinline int __unlock_for_delalloc(struct inode *inode, | |||
1386 | index += ret; | 1386 | index += ret; |
1387 | cond_resched(); | 1387 | cond_resched(); |
1388 | } | 1388 | } |
1389 | return 0; | ||
1390 | } | 1389 | } |
1391 | 1390 | ||
1392 | static noinline int lock_delalloc_pages(struct inode *inode, | 1391 | static noinline int lock_delalloc_pages(struct inode *inode, |
@@ -1777,39 +1776,34 @@ int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end, | |||
1777 | * helper function to set a given page up to date if all the | 1776 | * helper function to set a given page up to date if all the |
1778 | * extents in the tree for that page are up to date | 1777 | * extents in the tree for that page are up to date |
1779 | */ | 1778 | */ |
1780 | static int check_page_uptodate(struct extent_io_tree *tree, | 1779 | static void check_page_uptodate(struct extent_io_tree *tree, struct page *page) |
1781 | struct page *page) | ||
1782 | { | 1780 | { |
1783 | u64 start = (u64)page->index << PAGE_CACHE_SHIFT; | 1781 | u64 start = (u64)page->index << PAGE_CACHE_SHIFT; |
1784 | u64 end = start + PAGE_CACHE_SIZE - 1; | 1782 | u64 end = start + PAGE_CACHE_SIZE - 1; |
1785 | if (test_range_bit(tree, start, end, EXTENT_UPTODATE, 1, NULL)) | 1783 | if (test_range_bit(tree, start, end, EXTENT_UPTODATE, 1, NULL)) |
1786 | SetPageUptodate(page); | 1784 | SetPageUptodate(page); |
1787 | return 0; | ||
1788 | } | 1785 | } |
1789 | 1786 | ||
1790 | /* | 1787 | /* |
1791 | * helper function to unlock a page if all the extents in the tree | 1788 | * helper function to unlock a page if all the extents in the tree |
1792 | * for that page are unlocked | 1789 | * for that page are unlocked |
1793 | */ | 1790 | */ |
1794 | static int check_page_locked(struct extent_io_tree *tree, | 1791 | static void check_page_locked(struct extent_io_tree *tree, struct page *page) |
1795 | struct page *page) | ||
1796 | { | 1792 | { |
1797 | u64 start = (u64)page->index << PAGE_CACHE_SHIFT; | 1793 | u64 start = (u64)page->index << PAGE_CACHE_SHIFT; |
1798 | u64 end = start + PAGE_CACHE_SIZE - 1; | 1794 | u64 end = start + PAGE_CACHE_SIZE - 1; |
1799 | if (!test_range_bit(tree, start, end, EXTENT_LOCKED, 0, NULL)) | 1795 | if (!test_range_bit(tree, start, end, EXTENT_LOCKED, 0, NULL)) |
1800 | unlock_page(page); | 1796 | unlock_page(page); |
1801 | return 0; | ||
1802 | } | 1797 | } |
1803 | 1798 | ||
1804 | /* | 1799 | /* |
1805 | * helper function to end page writeback if all the extents | 1800 | * helper function to end page writeback if all the extents |
1806 | * in the tree for that page are done with writeback | 1801 | * in the tree for that page are done with writeback |
1807 | */ | 1802 | */ |
1808 | static int check_page_writeback(struct extent_io_tree *tree, | 1803 | static void check_page_writeback(struct extent_io_tree *tree, |
1809 | struct page *page) | 1804 | struct page *page) |
1810 | { | 1805 | { |
1811 | end_page_writeback(page); | 1806 | end_page_writeback(page); |
1812 | return 0; | ||
1813 | } | 1807 | } |
1814 | 1808 | ||
1815 | /* | 1809 | /* |
@@ -3835,7 +3829,7 @@ void free_extent_buffer(struct extent_buffer *eb) | |||
3835 | WARN_ON(1); | 3829 | WARN_ON(1); |
3836 | } | 3830 | } |
3837 | 3831 | ||
3838 | int clear_extent_buffer_dirty(struct extent_io_tree *tree, | 3832 | void clear_extent_buffer_dirty(struct extent_io_tree *tree, |
3839 | struct extent_buffer *eb) | 3833 | struct extent_buffer *eb) |
3840 | { | 3834 | { |
3841 | unsigned long i; | 3835 | unsigned long i; |
@@ -3867,7 +3861,6 @@ int clear_extent_buffer_dirty(struct extent_io_tree *tree, | |||
3867 | ClearPageError(page); | 3861 | ClearPageError(page); |
3868 | unlock_page(page); | 3862 | unlock_page(page); |
3869 | } | 3863 | } |
3870 | return 0; | ||
3871 | } | 3864 | } |
3872 | 3865 | ||
3873 | int set_extent_buffer_dirty(struct extent_io_tree *tree, | 3866 | int set_extent_buffer_dirty(struct extent_io_tree *tree, |