* [PATCH 1/2] block: remove BIO_EOPNOTSUPP
@ 2015-04-24 19:41 Christoph Hellwig
2015-04-24 19:41 ` [PATCH 2/2] block: remove unused BIO_RW_BLOCK and BIO_EOF flags Christoph Hellwig
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Christoph Hellwig @ 2015-04-24 19:41 UTC (permalink / raw)
To: Jens Axboe; +Cc: Tejun Heo, Ming Lin, linux-fsdevel, linux-kernel
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>
---
block/bounce.c | 3 ---
fs/btrfs/disk-io.c | 11 ++---------
fs/btrfs/extent_io.c | 2 --
fs/buffer.c | 10 ----------
fs/ext4/page-io.c | 1 -
fs/nilfs2/segbuf.c | 12 ------------
include/linux/blk_types.h | 1 -
7 files changed, 2 insertions(+), 38 deletions(-)
diff --git a/block/bounce.c b/block/bounce.c
index ab21ba2..4bac725 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)
struct bio_vec *bvec, *org_vec;
int i;
- if (test_bit(BIO_EOPNOTSUPP, &bio->bi_flags))
- set_bit(BIO_EOPNOTSUPP, &bio_orig->bi_flags);
-
/*
* free up bounce indirect pages used
*/
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 639f266..e8d7670 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3225,11 +3225,8 @@ static int write_dev_supers(struct btrfs_device *device,
*/
static void btrfs_end_empty_barrier(struct bio *bio, int err)
{
- if (err) {
- if (err == -EOPNOTSUPP)
- set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
+ if (err)
clear_bit(BIO_UPTODATE, &bio->bi_flags);
- }
if (bio->bi_private)
complete(bio->bi_private);
bio_put(bio);
@@ -3257,11 +3254,7 @@ static int write_dev_flush(struct btrfs_device *device, int wait)
wait_for_completion(&device->flush_wait);
- if (bio_flagged(bio, BIO_EOPNOTSUPP)) {
- printk_in_rcu("BTRFS: disabling barriers on dev %s\n",
- rcu_str_deref(device->name));
- device->nobarriers = 1;
- } else if (!bio_flagged(bio, BIO_UPTODATE)) {
+ if (!bio_flagged(bio, BIO_UPTODATE)) {
ret = -EIO;
btrfs_dev_stat_inc_and_print(device,
BTRFS_DEV_STAT_FLUSH_ERRS);
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index d688cfe..6a44bea 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,
else
btrfsic_submit_bio(rw, bio);
- if (bio_flagged(bio, BIO_EOPNOTSUPP))
- ret = -EOPNOTSUPP;
bio_put(bio);
return ret;
}
diff --git a/fs/buffer.c b/fs/buffer.c
index c7a5602..efd85e0 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)
{
struct buffer_head *bh = bio->bi_private;
- if (err == -EOPNOTSUPP) {
- set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
- }
-
if (unlikely (test_bit(BIO_QUIET,&bio->bi_flags)))
set_bit(BH_Quiet, &bh->b_state);
@@ -3041,13 +3037,7 @@ int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags)
if (buffer_prio(bh))
rw |= REQ_PRIO;
- bio_get(bio);
submit_bio(rw, bio);
-
- if (bio_flagged(bio, BIO_EOPNOTSUPP))
- ret = -EOPNOTSUPP;
-
- bio_put(bio);
return ret;
}
EXPORT_SYMBOL_GPL(_submit_bh);
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index 4649842..36f0eaa 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -343,7 +343,6 @@ void ext4_io_submit(struct ext4_io_submit *io)
if (bio) {
bio_get(io->io_bio);
submit_bio(io->io_op, io->io_bio);
- BUG_ON(bio_flagged(io->io_bio, BIO_EOPNOTSUPP));
bio_put(io->io_bio);
}
io->io_bio = NULL;
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index dc3a9efd..42468e5 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)
const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct nilfs_segment_buffer *segbuf = bio->bi_private;
- if (err == -EOPNOTSUPP) {
- set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
- /* to be detected by nilfs_segbuf_submit_bio() */
- }
-
if (!uptodate)
atomic_inc(&segbuf->sb_err);
@@ -374,15 +369,8 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf,
bio->bi_end_io = nilfs_end_bio_write;
bio->bi_private = segbuf;
- bio_get(bio);
submit_bio(mode, bio);
segbuf->sb_nbio++;
- if (bio_flagged(bio, BIO_EOPNOTSUPP)) {
- bio_put(bio);
- err = -EOPNOTSUPP;
- goto failed;
- }
- bio_put(bio);
wi->bio = NULL;
wi->rest_blocks -= wi->end - wi->start;
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 992ef58..c2ee937 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -118,7 +118,6 @@ struct bio {
#define BIO_CLONED 4 /* doesn't own data */
#define BIO_BOUNCED 5 /* bio is a bounce bio */
#define BIO_USER_MAPPED 6 /* contains user pages */
-#define BIO_EOPNOTSUPP 7 /* not supported */
#define BIO_NULL_MAPPED 8 /* contains invalid user pages */
#define BIO_QUIET 9 /* Make BIO Quiet */
#define BIO_SNAP_STABLE 10 /* bio data must be snapshotted during write */
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] block: remove unused BIO_RW_BLOCK and BIO_EOF flags
2015-04-24 19:41 [PATCH 1/2] block: remove BIO_EOPNOTSUPP Christoph Hellwig
@ 2015-04-24 19:41 ` Christoph Hellwig
2015-04-24 19:47 ` Jeff Moyer
2015-04-24 21:32 ` Tejun Heo
2015-04-24 20:31 ` [PATCH 1/2] block: remove BIO_EOPNOTSUPP Jeff Moyer
` (2 subsequent siblings)
3 siblings, 2 replies; 10+ messages in thread
From: Christoph Hellwig @ 2015-04-24 19:41 UTC (permalink / raw)
To: Jens Axboe; +Cc: Tejun Heo, Ming Lin, linux-fsdevel, linux-kernel
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-core.c | 2 --
include/linux/blk_types.h | 2 --
2 files changed, 4 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 57da507..4085265 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1716,8 +1716,6 @@ static void handle_bad_sector(struct bio *bio)
bio->bi_rw,
(unsigned long long)bio_end_sector(bio),
(long long)(i_size_read(bio->bi_bdev->bd_inode) >> 9));
-
- set_bit(BIO_EOF, &bio->bi_flags);
}
#ifdef CONFIG_FAIL_MAKE_REQUEST
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index c2ee937..b0a5bff 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -112,8 +112,6 @@ struct bio {
* bio flags
*/
#define BIO_UPTODATE 0 /* ok after I/O completion */
-#define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */
-#define BIO_EOF 2 /* out-out-bounds error */
#define BIO_SEG_VALID 3 /* bi_phys_segments valid */
#define BIO_CLONED 4 /* doesn't own data */
#define BIO_BOUNCED 5 /* bio is a bounce bio */
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] block: remove unused BIO_RW_BLOCK and BIO_EOF flags
2015-04-24 19:41 ` [PATCH 2/2] block: remove unused BIO_RW_BLOCK and BIO_EOF flags Christoph Hellwig
@ 2015-04-24 19:47 ` Jeff Moyer
2015-04-24 19:53 ` Christoph Hellwig
2015-04-24 21:32 ` Tejun Heo
1 sibling, 1 reply; 10+ messages in thread
From: Jeff Moyer @ 2015-04-24 19:47 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, Tejun Heo, Ming Lin, linux-fsdevel, linux-kernel
Christoph Hellwig <hch@lst.de> writes:
> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
> index c2ee937..b0a5bff 100644
> --- a/include/linux/blk_types.h
> +++ b/include/linux/blk_types.h
> @@ -112,8 +112,6 @@ struct bio {
> * bio flags
> */
> #define BIO_UPTODATE 0 /* ok after I/O completion */
> -#define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */
> -#define BIO_EOF 2 /* out-out-bounds error */
> #define BIO_SEG_VALID 3 /* bi_phys_segments valid */
> #define BIO_CLONED 4 /* doesn't own data */
> #define BIO_BOUNCED 5 /* bio is a bounce bio */
Any particular reason you elected to leave a hole in the numbering? I
don't have a preference either way, but I don't think there's any harm
in compressing it.
-Jeff
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] block: remove unused BIO_RW_BLOCK and BIO_EOF flags
2015-04-24 19:47 ` Jeff Moyer
@ 2015-04-24 19:53 ` Christoph Hellwig
2015-04-24 20:33 ` Jeff Moyer
0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2015-04-24 19:53 UTC (permalink / raw)
To: Jeff Moyer
Cc: Christoph Hellwig, Jens Axboe, Tejun Heo, Ming Lin,
linux-fsdevel, linux-kernel
On Fri, Apr 24, 2015 at 03:47:37PM -0400, Jeff Moyer wrote:
> Any particular reason you elected to leave a hole in the numbering? I
> don't have a preference either way, but I don't think there's any harm
> in compressing it.
This was the simplest way to do it and I'm a lazy bastard.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] block: remove BIO_EOPNOTSUPP
2015-04-24 19:41 [PATCH 1/2] block: remove BIO_EOPNOTSUPP Christoph Hellwig
2015-04-24 19:41 ` [PATCH 2/2] block: remove unused BIO_RW_BLOCK and BIO_EOF flags Christoph Hellwig
@ 2015-04-24 20:31 ` Jeff Moyer
2015-04-24 21:31 ` Tejun Heo
2015-05-19 6:39 ` Christoph Hellwig
3 siblings, 0 replies; 10+ messages in thread
From: Jeff Moyer @ 2015-04-24 20:31 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, Tejun Heo, Ming Lin, linux-fsdevel, linux-kernel
Christoph Hellwig <hch@lst.de> writes:
> 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.
I had a look through the kernel, checking for places where maybe we were
relying on an EOPNOTSUPP from REQ_DISCARD, just to ensure you weren't
pulling out an error path that could still be used. I think everything
checks out.
> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
> index 992ef58..c2ee937 100644
> --- a/include/linux/blk_types.h
> +++ b/include/linux/blk_types.h
> @@ -118,7 +118,6 @@ struct bio {
> #define BIO_CLONED 4 /* doesn't own data */
> #define BIO_BOUNCED 5 /* bio is a bounce bio */
> #define BIO_USER_MAPPED 6 /* contains user pages */
> -#define BIO_EOPNOTSUPP 7 /* not supported */
> #define BIO_NULL_MAPPED 8 /* contains invalid user pages */
> #define BIO_QUIET 9 /* Make BIO Quiet */
> #define BIO_SNAP_STABLE 10 /* bio data must be snapshotted during write */
Should we leave a hole in the numbering scheme?
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] block: remove unused BIO_RW_BLOCK and BIO_EOF flags
2015-04-24 19:53 ` Christoph Hellwig
@ 2015-04-24 20:33 ` Jeff Moyer
0 siblings, 0 replies; 10+ messages in thread
From: Jeff Moyer @ 2015-04-24 20:33 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, Tejun Heo, Ming Lin, linux-fsdevel, linux-kernel
Christoph Hellwig <hch@lst.de> writes:
> On Fri, Apr 24, 2015 at 03:47:37PM -0400, Jeff Moyer wrote:
>> Any particular reason you elected to leave a hole in the numbering? I
>> don't have a preference either way, but I don't think there's any harm
>> in compressing it.
>
> This was the simplest way to do it and I'm a lazy bastard.
Heh. /me looks at hch's contributions... You have a rather broad
definition of lazy. :-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] block: remove BIO_EOPNOTSUPP
2015-04-24 19:41 [PATCH 1/2] block: remove BIO_EOPNOTSUPP Christoph Hellwig
2015-04-24 19:41 ` [PATCH 2/2] block: remove unused BIO_RW_BLOCK and BIO_EOF flags Christoph Hellwig
2015-04-24 20:31 ` [PATCH 1/2] block: remove BIO_EOPNOTSUPP Jeff Moyer
@ 2015-04-24 21:31 ` Tejun Heo
2015-05-19 6:39 ` Christoph Hellwig
3 siblings, 0 replies; 10+ messages in thread
From: Tejun Heo @ 2015-04-24 21:31 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jens Axboe, Ming Lin, linux-fsdevel, linux-kernel
On Fri, Apr 24, 2015 at 09:41:01PM +0200, Christoph Hellwig wrote:
> 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>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] block: remove unused BIO_RW_BLOCK and BIO_EOF flags
2015-04-24 19:41 ` [PATCH 2/2] block: remove unused BIO_RW_BLOCK and BIO_EOF flags Christoph Hellwig
2015-04-24 19:47 ` Jeff Moyer
@ 2015-04-24 21:32 ` Tejun Heo
1 sibling, 0 replies; 10+ messages in thread
From: Tejun Heo @ 2015-04-24 21:32 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Jens Axboe, Ming Lin, linux-fsdevel, linux-kernel
On Fri, Apr 24, 2015 at 09:41:02PM +0200, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] block: remove BIO_EOPNOTSUPP
2015-04-24 19:41 [PATCH 1/2] block: remove BIO_EOPNOTSUPP Christoph Hellwig
` (2 preceding siblings ...)
2015-04-24 21:31 ` Tejun Heo
@ 2015-05-19 6:39 ` Christoph Hellwig
2015-05-19 15:19 ` Jens Axboe
3 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2015-05-19 6:39 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, Tejun Heo, Ming Lin, linux-fsdevel, linux-kernel
Jens, do these two patche look fine to you?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] block: remove BIO_EOPNOTSUPP
2015-05-19 6:39 ` Christoph Hellwig
@ 2015-05-19 15:19 ` Jens Axboe
0 siblings, 0 replies; 10+ messages in thread
From: Jens Axboe @ 2015-05-19 15:19 UTC (permalink / raw)
To: Christoph Hellwig, Christoph Hellwig
Cc: Tejun Heo, Ming Lin, linux-fsdevel, linux-kernel
On 05/19/2015 12:39 AM, Christoph Hellwig wrote:
> Jens, do these two patche look fine to you?
>
Yep, nice and simple, applied both.
--
Jens Axboe
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-05-19 15:19 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-24 19:41 [PATCH 1/2] block: remove BIO_EOPNOTSUPP Christoph Hellwig
2015-04-24 19:41 ` [PATCH 2/2] block: remove unused BIO_RW_BLOCK and BIO_EOF flags Christoph Hellwig
2015-04-24 19:47 ` Jeff Moyer
2015-04-24 19:53 ` Christoph Hellwig
2015-04-24 20:33 ` Jeff Moyer
2015-04-24 21:32 ` Tejun Heo
2015-04-24 20:31 ` [PATCH 1/2] block: remove BIO_EOPNOTSUPP Jeff Moyer
2015-04-24 21:31 ` Tejun Heo
2015-05-19 6:39 ` Christoph Hellwig
2015-05-19 15:19 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).