Skip to content

Commit

Permalink
block: remove bio_is_rw
Browse files Browse the repository at this point in the history
With the addition of the zoned operations the tests in this function
became incorrect.  But I think it's much better to just open code the
allow operations in the only caller anyway.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Shaun Tancheff <shaun.tancheff@seagate.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Christoph Hellwig authored and axboe committed Oct 28, 2016
1 parent 2552e3f commit c4aebd0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion block/bio-integrity.c
Expand Up @@ -172,7 +172,7 @@ bool bio_integrity_enabled(struct bio *bio)
{
struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev);

if (!bio_is_rw(bio))
if (bio_op(bio) != REQ_OP_READ && bio_op(bio) != REQ_OP_WRITE)
return false;

/* Already protected? */
Expand Down
11 changes: 0 additions & 11 deletions include/linux/bio.h
Expand Up @@ -83,17 +83,6 @@ static inline bool bio_no_advance_iter(struct bio *bio)
bio_op(bio) == REQ_OP_WRITE_SAME;
}

static inline bool bio_is_rw(struct bio *bio)
{
if (!bio_has_data(bio))
return false;

if (bio_no_advance_iter(bio))
return false;

return true;
}

static inline bool bio_mergeable(struct bio *bio)
{
if (bio->bi_opf & REQ_NOMERGE_FLAGS)
Expand Down

0 comments on commit c4aebd0

Please sign in to comment.