bio->bi_io_vec = bio_src->bi_io_vec;
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);
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;
switch (bio_op(bio)) {
case REQ_OP_DISCARD:
!blk_write_same_mergeable(req->bio, next->bio))
return NULL;
+ if (!blk_crypt_mergeable(req->bio, next->bio))
+ return NULL;
+
/*
* Don't allow merge of different write hints, or for a hint with
* non-hint IO.
!blk_write_same_mergeable(rq->bio, bio))
return false;
+ if (!blk_crypt_mergeable(rq->bio, bio))
+ return false;
/*
* Don't allow merge of different write hints, or for a hint with
* non-hint IO.
return NULL;
}
+static inline bool bio_has_crypt(struct bio *bio)
+{
+ if (bio && (bio->bi_opf & REQ_CRYPT))
+ return true;
+ else
+ return false;
+}
+
/*
* will die
*/
bio_end_io_t *bi_end_io;
void *bi_private;
+ void *bi_aux_private;
+
#ifdef CONFIG_BLK_CGROUP
/*
* Optional ioc and css associated with this bio. Put on bio
__REQ_INTEGRITY, /* I/O includes block integrity payload */
__REQ_FUA, /* forced unit access */
__REQ_PREFLUSH, /* request for cache flush */
+ __REQ_AUX_PRIV, /* use bi_aux_private */
+ __REQ_CRYPT, /* request inline crypt */
__REQ_RAHEAD, /* read ahead, can fail anytime */
__REQ_BACKGROUND, /* background IO */
#define REQ_NOMERGE (1ULL << __REQ_NOMERGE)
#define REQ_IDLE (1ULL << __REQ_IDLE)
#define REQ_INTEGRITY (1ULL << __REQ_INTEGRITY)
+#define REQ_AUX_PRIV (1ULL << __REQ_AUX_PRIV)
+#define REQ_CRYPT (1ULL << __REQ_CRYPT)
#define REQ_FUA (1ULL << __REQ_FUA)
#define REQ_PREFLUSH (1ULL << __REQ_PREFLUSH)
#define REQ_RAHEAD (1ULL << __REQ_RAHEAD)
return q->nr_requests;
}
+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;
+
+ return true;
+}
+
/*
* q->prep_rq_fn return values
*/