]> 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)
commit7e3285ba2f4b3b54092946ef650337a7405aea67
tree6ef2b2cb582a6331e30175ce0d4da7503059f88f
parentcaf689312c4b7d6d5a49e0327616e58b21f7f009
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