]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Factor out tree->ops->merge_bio_hook call
authorJeff Mahoney <jeffm@suse.com>
Tue, 4 Oct 2011 03:23:13 +0000 (23:23 -0400)
committerDavid Sterba <dsterba@suse.cz>
Thu, 22 Mar 2012 00:45:33 +0000 (01:45 +0100)
commit0e3c1e9b42285243478d65bf9feb72f0b536d324
tree6ef2b2cb582a6331e30175ce0d4da7503059f88f
parent97ec6af049153359432dbf3ce87743a6c30d6970
btrfs: Factor out tree->ops->merge_bio_hook call

In submit_extent_page, there's a visually noisy if statement that, in
the midst of other conditions, does the tree dependency for tree->ops
and tree->ops->merge_bio_hook before calling it, and then another
condition afterwards. If an error is returned from merge_bio_hook,
there's no way to catch it. It's considered a routine "1" return
value instead of a failure.

This patch factors out the dependency check into a new local merge_bio
routine and BUG's on an error. The if statement is less noisy as a side-
effect.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/inode.c