[COMMON] bio: update diskcipher merge
authorBoojin Kim <boojin.kim@samsung.com>
Tue, 15 May 2018 15:10:16 +0000 (00:10 +0900)
committerJunho Choi <junhosj.choi@samsung.com>
Thu, 24 May 2018 00:02:05 +0000 (09:02 +0900)
Change-Id: I2477d73096105517e0c40cc21b3bfa83c7941dd4
Signed-off-by: Boojin Kim <boojin.kim@samsung.com>
block/bio.c
include/linux/bio.h
include/linux/blkdev.h

index 01a037c1d3f4bef3219e50b730540024dfe80c93..fbbc0f7f46fb1473812630fd6db62dd826623c9b 100644 (file)
@@ -605,11 +605,9 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src)
        bio->bi_write_hint = bio_src->bi_write_hint;
        bio->bi_iter = bio_src->bi_iter;
        bio->bi_io_vec = bio_src->bi_io_vec;
+       bio->bi_aux_private = bio_src->bi_aux_private;
 
        bio_clone_blkcg_association(bio, bio_src);
-
-       if (bio->bi_opf & REQ_AUX_PRIV)
-               bio->bi_aux_private = bio_src->bi_aux_private;
 }
 EXPORT_SYMBOL(__bio_clone_fast);
 
@@ -692,8 +690,7 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask,
        bio->bi_write_hint      = bio_src->bi_write_hint;
        bio->bi_iter.bi_sector  = bio_src->bi_iter.bi_sector;
        bio->bi_iter.bi_size    = bio_src->bi_iter.bi_size;
-       if (bio->bi_opf & REQ_AUX_PRIV)
-               bio->bi_aux_private = bio_src->bi_aux_private;
+       bio->bi_aux_private = bio_src->bi_aux_private;
 
        switch (bio_op(bio)) {
        case REQ_OP_DISCARD:
index 52cb51456ce2d310de3448f945f4f54fdcbdc187..216f94f3c5aa2f05c92b3bc0d69487361d64d0ee 100644 (file)
@@ -123,12 +123,12 @@ static inline void *bio_data(struct bio *bio)
        return NULL;
 }
 
-static inline bool bio_has_crypt(struct bio *bio)
+static inline void *bio_has_crypt(struct bio *bio)
 {
        if (bio && (bio->bi_opf & REQ_CRYPT))
-               return true;
-       else
-               return false;
+               return bio->bi_aux_private;
+
+       return NULL;
 }
 
 /*
index c280518d8f8f1d300aa01920d25d2a82bd30e920..903b6c719fd4ebe0f28eb80027f352c848ccbc1f 100644 (file)
@@ -868,11 +868,10 @@ static inline unsigned int blk_queue_depth(struct request_queue *q)
 
 static inline bool blk_crypt_mergeable(struct bio *a, struct bio *b)
 {
-       if (bio_has_crypt(a) && bio_has_crypt(b))
-               if (a->bi_aux_private != b->bi_aux_private)
-                       return false;
+       if (bio_has_crypt(a) == bio_has_crypt(b))
+               return true;
 
-       return true;
+       return false;
 }
 
 /*