diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 18:32:22 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-11-24 18:33:41 -0500 |
commit | c170bbb45febc03ac4d34ba2b8bb55e06104b7e7 (patch) | |
tree | ab1d6878c379b0eb59e58a1999e7c2d8c11ae303 /fs/btrfs/extent_io.c | |
parent | 2c575026fae6e63771bd2a4c1d407214a8096a89 (diff) |
block: submit_bio_wait() conversions
It was being open coded in a few places.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Joern Engel <joern@logfs.org>
Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
Cc: Neil Brown <neilb@suse.de>
Cc: Chris Mason <chris.mason@fusionio.com>
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 856bc2b2192c..014beaa9458c 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -1952,11 +1952,6 @@ static int free_io_failure(struct inode *inode, struct io_failure_record *rec, | |||
1952 | return err; | 1952 | return err; |
1953 | } | 1953 | } |
1954 | 1954 | ||
1955 | static void repair_io_failure_callback(struct bio *bio, int err) | ||
1956 | { | ||
1957 | complete(bio->bi_private); | ||
1958 | } | ||
1959 | |||
1960 | /* | 1955 | /* |
1961 | * this bypasses the standard btrfs submit functions deliberately, as | 1956 | * this bypasses the standard btrfs submit functions deliberately, as |
1962 | * the standard behavior is to write all copies in a raid setup. here we only | 1957 | * the standard behavior is to write all copies in a raid setup. here we only |
@@ -1973,7 +1968,6 @@ int repair_io_failure(struct btrfs_fs_info *fs_info, u64 start, | |||
1973 | { | 1968 | { |
1974 | struct bio *bio; | 1969 | struct bio *bio; |
1975 | struct btrfs_device *dev; | 1970 | struct btrfs_device *dev; |
1976 | DECLARE_COMPLETION_ONSTACK(compl); | ||
1977 | u64 map_length = 0; | 1971 | u64 map_length = 0; |
1978 | u64 sector; | 1972 | u64 sector; |
1979 | struct btrfs_bio *bbio = NULL; | 1973 | struct btrfs_bio *bbio = NULL; |
@@ -1989,8 +1983,6 @@ int repair_io_failure(struct btrfs_fs_info *fs_info, u64 start, | |||
1989 | bio = btrfs_io_bio_alloc(GFP_NOFS, 1); | 1983 | bio = btrfs_io_bio_alloc(GFP_NOFS, 1); |
1990 | if (!bio) | 1984 | if (!bio) |
1991 | return -EIO; | 1985 | return -EIO; |
1992 | bio->bi_private = &compl; | ||
1993 | bio->bi_end_io = repair_io_failure_callback; | ||
1994 | bio->bi_size = 0; | 1986 | bio->bi_size = 0; |
1995 | map_length = length; | 1987 | map_length = length; |
1996 | 1988 | ||
@@ -2011,10 +2003,8 @@ int repair_io_failure(struct btrfs_fs_info *fs_info, u64 start, | |||
2011 | } | 2003 | } |
2012 | bio->bi_bdev = dev->bdev; | 2004 | bio->bi_bdev = dev->bdev; |
2013 | bio_add_page(bio, page, length, start - page_offset(page)); | 2005 | bio_add_page(bio, page, length, start - page_offset(page)); |
2014 | btrfsic_submit_bio(WRITE_SYNC, bio); | ||
2015 | wait_for_completion(&compl); | ||
2016 | 2006 | ||
2017 | if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) { | 2007 | if (btrfsic_submit_bio_wait(WRITE_SYNC, bio)) { |
2018 | /* try to remap that extent elsewhere? */ | 2008 | /* try to remap that extent elsewhere? */ |
2019 | bio_put(bio); | 2009 | bio_put(bio); |
2020 | btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS); | 2010 | btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS); |