diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 01:33:32 -0500 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 01:33:38 -0500 |
commit | 33879d4512c021ae65be9706608dacb36b4687b1 (patch) | |
tree | 40b8e604aaa7138685a41778bebb4901a1b2610c /fs/hfsplus/wrapper.c | |
parent | 6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (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>
Diffstat (limited to 'fs/hfsplus/wrapper.c')
-rw-r--r-- | fs/hfsplus/wrapper.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c index b51a6079108d..e9a97a0d4314 100644 --- a/fs/hfsplus/wrapper.c +++ b/fs/hfsplus/wrapper.c | |||
@@ -24,13 +24,6 @@ struct hfsplus_wd { | |||
24 | u16 embed_count; | 24 | u16 embed_count; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | static void hfsplus_end_io_sync(struct bio *bio, int err) | ||
28 | { | ||
29 | if (err) | ||
30 | clear_bit(BIO_UPTODATE, &bio->bi_flags); | ||
31 | complete(bio->bi_private); | ||
32 | } | ||
33 | |||
34 | /* | 27 | /* |
35 | * hfsplus_submit_bio - Perfrom block I/O | 28 | * hfsplus_submit_bio - Perfrom block I/O |
36 | * @sb: super block of volume for I/O | 29 | * @sb: super block of volume for I/O |
@@ -53,7 +46,6 @@ static void hfsplus_end_io_sync(struct bio *bio, int err) | |||
53 | int hfsplus_submit_bio(struct super_block *sb, sector_t sector, | 46 | int hfsplus_submit_bio(struct super_block *sb, sector_t sector, |
54 | void *buf, void **data, int rw) | 47 | void *buf, void **data, int rw) |
55 | { | 48 | { |
56 | DECLARE_COMPLETION_ONSTACK(wait); | ||
57 | struct bio *bio; | 49 | struct bio *bio; |
58 | int ret = 0; | 50 | int ret = 0; |
59 | u64 io_size; | 51 | u64 io_size; |
@@ -73,8 +65,6 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector, | |||
73 | bio = bio_alloc(GFP_NOIO, 1); | 65 | bio = bio_alloc(GFP_NOIO, 1); |
74 | bio->bi_sector = sector; | 66 | bio->bi_sector = sector; |
75 | bio->bi_bdev = sb->s_bdev; | 67 | bio->bi_bdev = sb->s_bdev; |
76 | bio->bi_end_io = hfsplus_end_io_sync; | ||
77 | bio->bi_private = &wait; | ||
78 | 68 | ||
79 | if (!(rw & WRITE) && data) | 69 | if (!(rw & WRITE) && data) |
80 | *data = (u8 *)buf + offset; | 70 | *data = (u8 *)buf + offset; |
@@ -93,12 +83,7 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector, | |||
93 | buf = (u8 *)buf + len; | 83 | buf = (u8 *)buf + len; |
94 | } | 84 | } |
95 | 85 | ||
96 | submit_bio(rw, bio); | 86 | ret = submit_bio_wait(rw, bio); |
97 | wait_for_completion(&wait); | ||
98 | |||
99 | if (!bio_flagged(bio, BIO_UPTODATE)) | ||
100 | ret = -EIO; | ||
101 | |||
102 | out: | 87 | out: |
103 | bio_put(bio); | 88 | bio_put(bio); |
104 | return ret < 0 ? ret : 0; | 89 | return ret < 0 ? ret : 0; |