From: jeffm@suse.com
To: btrfs list <linux-btrfs@vger.kernel.org>
Cc: Chris Mason <chris.mason@oracle.com>
Subject: [patch v3 12/23] btrfs: extent_io.c: Make functions with no error conditions return void
Date: Thu, 08 Sep 2011 20:22:52 -0400 [thread overview]
Message-ID: <20110909002732.013387483@suse.com> (raw)
In-Reply-To: 20110909002240.141223014@suse.com
wait_on_state, wait_extent_bit, __unlock_for_delalloc, check_page_uptodate,
check_page_locked, check_page_writeback, and clear_extent_buffer_dirty
have no error conditions and should return void.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
fs/btrfs/extent_io.c | 29 ++++++++++-------------------
fs/btrfs/extent_io.h | 6 +++---
2 files changed, 13 insertions(+), 22 deletions(-)
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -613,8 +613,8 @@ search_again:
goto again;
}
-static int wait_on_state(struct extent_io_tree *tree,
- struct extent_state *state)
+static void wait_on_state(struct extent_io_tree *tree,
+ struct extent_state *state)
__releases(tree->lock)
__acquires(tree->lock)
{
@@ -624,7 +624,6 @@ static int wait_on_state(struct extent_i
schedule();
spin_lock(&tree->lock);
finish_wait(&state->wq, &wait);
- return 0;
}
/*
@@ -632,7 +631,7 @@ static int wait_on_state(struct extent_i
* The range [start, end] is inclusive.
* The tree lock is taken by this function
*/
-int wait_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, int bits)
+void wait_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, int bits)
{
struct extent_state *state;
struct rb_node *node;
@@ -669,7 +668,6 @@ again:
}
out:
spin_unlock(&tree->lock);
- return 0;
}
static void set_state_bits(struct extent_io_tree *tree,
@@ -1197,7 +1195,7 @@ out:
return found;
}
-static noinline int __unlock_for_delalloc(struct inode *inode,
+static noinline void __unlock_for_delalloc(struct inode *inode,
struct page *locked_page,
u64 start, u64 end)
{
@@ -1209,7 +1207,7 @@ static noinline int __unlock_for_delallo
int i;
if (index == locked_page->index && end_index == index)
- return 0;
+ return;
while (nr_pages > 0) {
ret = find_get_pages_contig(inode->i_mapping, index,
@@ -1224,7 +1222,6 @@ static noinline int __unlock_for_delallo
index += ret;
cond_resched();
}
- return 0;
}
static noinline int lock_delalloc_pages(struct inode *inode,
@@ -1619,39 +1616,34 @@ int test_range_bit(struct extent_io_tree
* helper function to set a given page up to date if all the
* extents in the tree for that page are up to date
*/
-static int check_page_uptodate(struct extent_io_tree *tree,
- struct page *page)
+static void check_page_uptodate(struct extent_io_tree *tree, struct page *page)
{
u64 start = (u64)page->index << PAGE_CACHE_SHIFT;
u64 end = start + PAGE_CACHE_SIZE - 1;
if (test_range_bit(tree, start, end, EXTENT_UPTODATE, 1, NULL))
SetPageUptodate(page);
- return 0;
}
/*
* helper function to unlock a page if all the extents in the tree
* for that page are unlocked
*/
-static int check_page_locked(struct extent_io_tree *tree,
- struct page *page)
+static void check_page_locked(struct extent_io_tree *tree, struct page *page)
{
u64 start = (u64)page->index << PAGE_CACHE_SHIFT;
u64 end = start + PAGE_CACHE_SIZE - 1;
if (!test_range_bit(tree, start, end, EXTENT_LOCKED, 0, NULL))
unlock_page(page);
- return 0;
}
/*
* helper function to end page writeback if all the extents
* in the tree for that page are done with writeback
*/
-static int check_page_writeback(struct extent_io_tree *tree,
- struct page *page)
+static void check_page_writeback(struct extent_io_tree *tree,
+ struct page *page)
{
end_page_writeback(page);
- return 0;
}
/* lots and lots of room for performance fixes in the end_bio funcs */
@@ -3251,7 +3243,7 @@ void free_extent_buffer(struct extent_bu
WARN_ON(1);
}
-int clear_extent_buffer_dirty(struct extent_io_tree *tree,
+void clear_extent_buffer_dirty(struct extent_io_tree *tree,
struct extent_buffer *eb)
{
unsigned long i;
@@ -3282,7 +3274,6 @@ int clear_extent_buffer_dirty(struct ext
spin_unlock_irq(&page->mapping->tree_lock);
unlock_page(page);
}
- return 0;
}
int set_extent_buffer_dirty(struct extent_io_tree *tree,
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -274,9 +274,9 @@ void memmove_extent_buffer(struct extent
unsigned long src_offset, unsigned long len);
void memset_extent_buffer(struct extent_buffer *eb, char c,
unsigned long start, unsigned long len);
-int wait_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, int bits);
-int clear_extent_buffer_dirty(struct extent_io_tree *tree,
- struct extent_buffer *eb);
+void wait_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, int bits);
+void clear_extent_buffer_dirty(struct extent_io_tree *tree,
+ struct extent_buffer *eb);
int set_extent_buffer_dirty(struct extent_io_tree *tree,
struct extent_buffer *eb);
int set_extent_buffer_uptodate(struct extent_io_tree *tree,
next prev parent reply other threads:[~2011-09-09 0:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-09 0:22 [patch v3 00/23] More error handling fixes jeffm
2011-09-09 0:22 ` [patch v3 01/23] btrfs: Add btrfs_panic() jeffm
2011-09-09 0:22 ` [patch v3 02/23] btrfs: Catch locking failures in {set,clear}_extent_bit jeffm
2011-09-09 0:22 ` [patch v3 03/23] btrfs: Push up set_extent_bit errors to callers jeffm
2011-09-09 0:22 ` [patch v3 04/23] btrfs: Push up lock_extent " jeffm
2011-09-09 0:22 ` [patch v3 05/23] btrfs: Push up clear_extent_bit " jeffm
2011-09-09 0:22 ` [patch v3 06/23] btrfs: Push up unlock_extent " jeffm
2011-09-09 0:22 ` [patch v3 07/23] btrfs: Make pin_down_extent return void jeffm
2011-09-09 0:22 ` [patch v3 08/23] btrfs: Push up btrfs_pin_extent failures jeffm
2011-09-09 0:22 ` [patch v3 09/23] btrfs: btrfs_drop_snapshot should return int jeffm
2011-09-09 0:22 ` [patch v3 10/23] btrfs: Push up non-looped btrfs_start_transaction failures jeffm
2011-09-09 0:22 ` [patch v3 11/23] btrfs: Make set_range_writeback return void jeffm
2011-09-09 0:22 ` jeffm [this message]
2011-09-09 0:22 ` [patch v3 13/23] btrfs: volumes.c: Make functions with no error conditions " jeffm
2011-09-09 0:22 ` [patch v3 14/23] btrfs: async-thread.c: " jeffm
2011-09-09 0:22 ` [patch v3 15/23] btrfs: tree-log.c: " jeffm
2011-09-09 0:22 ` [patch v3 16/23] btrfs: Make btrfs_init_compress " jeffm
2011-09-09 0:22 ` [patch v3 17/23] btrfs: Make btrfs_invalidate_inodes " jeffm
2011-09-09 0:22 ` [patch v3 18/23] btrfs: disk-io.c: Make functions with no error conditions " jeffm
2011-09-09 0:22 ` [patch v3 19/23] btrfs: extent-tree.c: " jeffm
2011-09-09 0:23 ` [patch v3 20/23] btrfs: file.c: " jeffm
2011-09-09 0:23 ` [patch v3 21/23] btrfs: simplify btrfs_submit_bio_hook jeffm
2011-09-09 0:23 ` [patch v3 22/23] btrfs: Factor out tree->ops->merge_bio_hook call jeffm
2011-09-09 0:23 ` [patch v3 23/23] btrfs: Push up ->submit_bio_hook failures jeffm
2011-09-09 0:35 ` [patch v3 00/23] More error handling fixes Jeff Mahoney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110909002732.013387483@suse.com \
--to=jeffm@suse.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).