Skip to content

Commit b25de9d

Browse files
Christoph Hellwigaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Jeff Moyer <[email protected]> Acked-by: Tejun Heo <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 4ecd4fe commit b25de9d

File tree

7 files changed

+2
-38
lines changed

7 files changed

+2
-38
lines changed

block/bounce.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool, int err)
128128
struct bio_vec *bvec, *org_vec;
129129
int i;
130130

131-
if (test_bit(BIO_EOPNOTSUPP, &bio->bi_flags))
132-
set_bit(BIO_EOPNOTSUPP, &bio_orig->bi_flags);
133-
134131
/*
135132
* free up bounce indirect pages used
136133
*/

fs/btrfs/disk-io.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,11 +3269,8 @@ static int write_dev_supers(struct btrfs_device *device,
32693269
*/
32703270
static void btrfs_end_empty_barrier(struct bio *bio, int err)
32713271
{
3272-
if (err) {
3273-
if (err == -EOPNOTSUPP)
3274-
set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
3272+
if (err)
32753273
clear_bit(BIO_UPTODATE, &bio->bi_flags);
3276-
}
32773274
if (bio->bi_private)
32783275
complete(bio->bi_private);
32793276
bio_put(bio);
@@ -3301,11 +3298,7 @@ static int write_dev_flush(struct btrfs_device *device, int wait)
33013298

33023299
wait_for_completion(&device->flush_wait);
33033300

3304-
if (bio_flagged(bio, BIO_EOPNOTSUPP)) {
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)) {
3301+
if (!bio_flagged(bio, BIO_UPTODATE)) {
33093302
ret = -EIO;
33103303
btrfs_dev_stat_inc_and_print(device,
33113304
BTRFS_DEV_STAT_FLUSH_ERRS);

fs/btrfs/extent_io.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,8 +2767,6 @@ static int __must_check submit_one_bio(int rw, struct bio *bio,
27672767
else
27682768
btrfsic_submit_bio(rw, bio);
27692769

2770-
if (bio_flagged(bio, BIO_EOPNOTSUPP))
2771-
ret = -EOPNOTSUPP;
27722770
bio_put(bio);
27732771
return ret;
27742772
}

fs/buffer.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,10 +2938,6 @@ static void end_bio_bh_io_sync(struct bio *bio, int err)
29382938
{
29392939
struct buffer_head *bh = bio->bi_private;
29402940

2941-
if (err == -EOPNOTSUPP) {
2942-
set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
2943-
}
2944-
29452941
if (unlikely (test_bit(BIO_QUIET,&bio->bi_flags)))
29462942
set_bit(BH_Quiet, &bh->b_state);
29472943

@@ -3041,13 +3037,7 @@ int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags)
30413037
if (buffer_prio(bh))
30423038
rw |= REQ_PRIO;
30433039

3044-
bio_get(bio);
30453040
submit_bio(rw, bio);
3046-
3047-
if (bio_flagged(bio, BIO_EOPNOTSUPP))
3048-
ret = -EOPNOTSUPP;
3049-
3050-
bio_put(bio);
30513041
return ret;
30523042
}
30533043
EXPORT_SYMBOL_GPL(_submit_bh);

fs/ext4/page-io.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ void ext4_io_submit(struct ext4_io_submit *io)
359359
if (bio) {
360360
bio_get(io->io_bio);
361361
submit_bio(io->io_op, io->io_bio);
362-
BUG_ON(bio_flagged(io->io_bio, BIO_EOPNOTSUPP));
363362
bio_put(io->io_bio);
364363
}
365364
io->io_bio = NULL;

fs/nilfs2/segbuf.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,6 @@ static void nilfs_end_bio_write(struct bio *bio, int err)
343343
const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
344344
struct nilfs_segment_buffer *segbuf = bio->bi_private;
345345

346-
if (err == -EOPNOTSUPP) {
347-
set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
348-
/* to be detected by nilfs_segbuf_submit_bio() */
349-
}
350-
351346
if (!uptodate)
352347
atomic_inc(&segbuf->sb_err);
353348

@@ -374,15 +369,8 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
374369

375370
bio->bi_end_io = nilfs_end_bio_write;
376371
bio->bi_private = segbuf;
377-
bio_get(bio);
378372
submit_bio(mode, bio);
379373
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);
386374

387375
wi->bio = NULL;
388376
wi->rest_blocks -= wi->end - wi->start;

include/linux/blk_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ struct bio {
118118
#define BIO_CLONED 4 /* doesn't own data */
119119
#define BIO_BOUNCED 5 /* bio is a bounce bio */
120120
#define BIO_USER_MAPPED 6 /* contains user pages */
121-
#define BIO_EOPNOTSUPP 7 /* not supported */
122121
#define BIO_NULL_MAPPED 8 /* contains invalid user pages */
123122
#define BIO_QUIET 9 /* Make BIO Quiet */
124123
#define BIO_SNAP_STABLE 10 /* bio data must be snapshotted during write */

0 commit comments

Comments
 (0)