Merge tag 'staging-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[sfrench/cifs-2.6.git] / block / bio-integrity.c
index f70cc3bdfd012949d9b89bc62645b13e98210ed1..5384713d48bc9929e2a4dc8b1b9f22b2e1c5bcd3 100644 (file)
@@ -86,7 +86,7 @@ struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio,
 
        bip->bip_bio = bio;
        bio->bi_integrity = bip;
-       bio->bi_rw |= REQ_INTEGRITY;
+       bio->bi_opf |= REQ_INTEGRITY;
 
        return bip;
 err:
@@ -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? */