block: remove bio_is_rw
authorChristoph Hellwig <hch@lst.de>
Thu, 20 Oct 2016 13:12:09 +0000 (15:12 +0200)
committerJens Axboe <axboe@fb.com>
Fri, 28 Oct 2016 14:45:17 +0000 (08:45 -0600)
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>
block/bio-integrity.c
include/linux/bio.h

index 63f72f0..5384713 100644 (file)
@@ -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? */
index 97cb48f..87ce64d 100644 (file)
@@ -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)