diff options
author | Christoph Hellwig <hch@lst.de> | 2015-04-24 15:41:01 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-05-19 11:17:03 -0400 |
commit | b25de9d6da49b1a8760a89672283128aa8c78345 (patch) | |
tree | 446d9186aebfbdb2156e438b6c85d84d44dd51a2 | |
parent | 4ecd4fef3a074c8bb43c391a57742c422469ebbd (diff) |
block: remove BIO_EOPNOTSUPP
Since the big barrier rewrite/removal in 2007 we never fail FLUSH or
FUA requests, which means we can remove the magic BIO_EOPNOTSUPP flag
to help propagating those to the buffer_head layer.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | block/bounce.c | 3 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 11 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 2 | ||||
-rw-r--r-- | fs/buffer.c | 10 | ||||
-rw-r--r-- | fs/ext4/page-io.c | 1 | ||||
-rw-r--r-- | fs/nilfs2/segbuf.c | 12 | ||||
-rw-r--r-- | include/linux/blk_types.h | 1 |
7 files changed, 2 insertions, 38 deletions
diff --git a/block/bounce.c b/block/bounce.c index ab21ba203d5c..4bac72579c1f 100644 --- a/block/bounce.c +++ b/block/bounce.c | |||
@@ -128,9 +128,6 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool, int err) | |||
128 | struct bio_vec *bvec, *org_vec; | 128 | struct bio_vec *bvec, *org_vec; |
129 | int i; | 129 | int i; |
130 | 130 | ||
131 | if (test_bit(BIO_EOPNOTSUPP, &bio->bi_flags)) | ||
132 | set_bit(BIO_EOPNOTSUPP, &bio_orig->bi_flags); | ||
133 | |||
134 | /* | 131 | /* |
135 | * free up bounce indirect pages used | 132 | * free up bounce indirect pages used |
136 | */ | 133 | */ |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 2ef9a4b72d06..e08a926fe12c 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -3269,11 +3269,8 @@ static int write_dev_supers(struct btrfs_device *device, | |||
3269 | */ | 3269 | */ |
3270 | static void btrfs_end_empty_barrier(struct bio *bio, int err) | 3270 | static void btrfs_end_empty_barrier(struct bio *bio, int err) |
3271 | { | 3271 | { |
3272 | if (err) { | 3272 | if (err) |
3273 | if (err == -EOPNOTSUPP) | ||
3274 | set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); | ||
3275 | clear_bit(BIO_UPTODATE, &bio->bi_flags); | 3273 | clear_bit(BIO_UPTODATE, &bio->bi_flags); |
3276 | } | ||
3277 | if (bio->bi_private) | 3274 | if (bio->bi_private) |
3278 | complete(bio->bi_private); | 3275 | complete(bio->bi_private); |
3279 | bio_put(bio); | 3276 | bio_put(bio); |
@@ -3301,11 +3298,7 @@ static int write_dev_flush(struct btrfs_device *device, int wait) | |||
3301 | 3298 | ||
3302 | wait_for_completion(&device->flush_wait); | 3299 | wait_for_completion(&device->flush_wait); |
3303 | 3300 | ||
3304 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) { | 3301 | if (!bio_flagged(bio, BIO_UPTODATE)) { |
3305 | printk_in_rcu("BTRFS: disabling barriers on dev %s\n", | ||
3306 | rcu_str_deref(device->name)); | ||
3307 | device->nobarriers = 1; | ||
3308 | } else if (!bio_flagged(bio, BIO_UPTODATE)) { | ||
3309 | ret = -EIO; | 3302 | ret = -EIO; |
3310 | btrfs_dev_stat_inc_and_print(device, | 3303 | btrfs_dev_stat_inc_and_print(device, |
3311 | BTRFS_DEV_STAT_FLUSH_ERRS); | 3304 | BTRFS_DEV_STAT_FLUSH_ERRS); |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 43af5a61ad25..1e155299abc0 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2767,8 +2767,6 @@ static int __must_check submit_one_bio(int rw, struct bio *bio, | |||
2767 | else | 2767 | else |
2768 | btrfsic_submit_bio(rw, bio); | 2768 | btrfsic_submit_bio(rw, bio); |
2769 | 2769 | ||
2770 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) | ||
2771 | ret = -EOPNOTSUPP; | ||
2772 | bio_put(bio); | 2770 | bio_put(bio); |
2773 | return ret; | 2771 | return ret; |
2774 | } | 2772 | } |
diff --git a/fs/buffer.c b/fs/buffer.c index c7a5602d01ee..efd85e0e8660 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -2938,10 +2938,6 @@ static void end_bio_bh_io_sync(struct bio *bio, int err) | |||
2938 | { | 2938 | { |
2939 | struct buffer_head *bh = bio->bi_private; | 2939 | struct buffer_head *bh = bio->bi_private; |
2940 | 2940 | ||
2941 | if (err == -EOPNOTSUPP) { | ||
2942 | set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); | ||
2943 | } | ||
2944 | |||
2945 | if (unlikely (test_bit(BIO_QUIET,&bio->bi_flags))) | 2941 | if (unlikely (test_bit(BIO_QUIET,&bio->bi_flags))) |
2946 | set_bit(BH_Quiet, &bh->b_state); | 2942 | set_bit(BH_Quiet, &bh->b_state); |
2947 | 2943 | ||
@@ -3041,13 +3037,7 @@ int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags) | |||
3041 | if (buffer_prio(bh)) | 3037 | if (buffer_prio(bh)) |
3042 | rw |= REQ_PRIO; | 3038 | rw |= REQ_PRIO; |
3043 | 3039 | ||
3044 | bio_get(bio); | ||
3045 | submit_bio(rw, bio); | 3040 | submit_bio(rw, bio); |
3046 | |||
3047 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) | ||
3048 | ret = -EOPNOTSUPP; | ||
3049 | |||
3050 | bio_put(bio); | ||
3051 | return ret; | 3041 | return ret; |
3052 | } | 3042 | } |
3053 | EXPORT_SYMBOL_GPL(_submit_bh); | 3043 | EXPORT_SYMBOL_GPL(_submit_bh); |
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 5765f88b3904..c5d81e8d84c3 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c | |||
@@ -359,7 +359,6 @@ void ext4_io_submit(struct ext4_io_submit *io) | |||
359 | if (bio) { | 359 | if (bio) { |
360 | bio_get(io->io_bio); | 360 | bio_get(io->io_bio); |
361 | submit_bio(io->io_op, io->io_bio); | 361 | submit_bio(io->io_op, io->io_bio); |
362 | BUG_ON(bio_flagged(io->io_bio, BIO_EOPNOTSUPP)); | ||
363 | bio_put(io->io_bio); | 362 | bio_put(io->io_bio); |
364 | } | 363 | } |
365 | io->io_bio = NULL; | 364 | io->io_bio = NULL; |
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c index dc3a9efdaab8..42468e5ab3e7 100644 --- a/fs/nilfs2/segbuf.c +++ b/fs/nilfs2/segbuf.c | |||
@@ -343,11 +343,6 @@ static void nilfs_end_bio_write(struct bio *bio, int err) | |||
343 | const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 343 | const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
344 | struct nilfs_segment_buffer *segbuf = bio->bi_private; | 344 | struct nilfs_segment_buffer *segbuf = bio->bi_private; |
345 | 345 | ||
346 | if (err == -EOPNOTSUPP) { | ||
347 | set_bit(BIO_EOPNOTSUPP, &bio->bi_flags); | ||
348 | /* to be detected by nilfs_segbuf_submit_bio() */ | ||
349 | } | ||
350 | |||
351 | if (!uptodate) | 346 | if (!uptodate) |
352 | atomic_inc(&segbuf->sb_err); | 347 | atomic_inc(&segbuf->sb_err); |
353 | 348 | ||
@@ -374,15 +369,8 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf, | |||
374 | 369 | ||
375 | bio->bi_end_io = nilfs_end_bio_write; | 370 | bio->bi_end_io = nilfs_end_bio_write; |
376 | bio->bi_private = segbuf; | 371 | bio->bi_private = segbuf; |
377 | bio_get(bio); | ||
378 | submit_bio(mode, bio); | 372 | submit_bio(mode, bio); |
379 | segbuf->sb_nbio++; | 373 | segbuf->sb_nbio++; |
380 | if (bio_flagged(bio, BIO_EOPNOTSUPP)) { | ||
381 | bio_put(bio); | ||
382 | err = -EOPNOTSUPP; | ||
383 | goto failed; | ||
384 | } | ||
385 | bio_put(bio); | ||
386 | 374 | ||
387 | wi->bio = NULL; | 375 | wi->bio = NULL; |
388 | wi->rest_blocks -= wi->end - wi->start; | 376 | wi->rest_blocks -= wi->end - wi->start; |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 93d2e7153816..daf95915d104 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -118,7 +118,6 @@ struct bio { | |||
118 | #define BIO_CLONED 4 /* doesn't own data */ | 118 | #define BIO_CLONED 4 /* doesn't own data */ |
119 | #define BIO_BOUNCED 5 /* bio is a bounce bio */ | 119 | #define BIO_BOUNCED 5 /* bio is a bounce bio */ |
120 | #define BIO_USER_MAPPED 6 /* contains user pages */ | 120 | #define BIO_USER_MAPPED 6 /* contains user pages */ |
121 | #define BIO_EOPNOTSUPP 7 /* not supported */ | ||
122 | #define BIO_NULL_MAPPED 8 /* contains invalid user pages */ | 121 | #define BIO_NULL_MAPPED 8 /* contains invalid user pages */ |
123 | #define BIO_QUIET 9 /* Make BIO Quiet */ | 122 | #define BIO_QUIET 9 /* Make BIO Quiet */ |
124 | #define BIO_SNAP_STABLE 10 /* bio data must be snapshotted during write */ | 123 | #define BIO_SNAP_STABLE 10 /* bio data must be snapshotted during write */ |