summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorAndrey Zhizhikin <andrey.z@gmail.com>2020-08-11 08:22:03 +0000
committerAndrey Zhizhikin <andrey.z@gmail.com>2020-08-11 08:22:03 +0000
commit7da1a123ebce2005573def510c61214fc1000163 (patch)
tree5f3c8a2ab73547cc694813b7ce3c19d8d94bc0b2 /block
parent998274208bcb6fdbedeceea431848b6d0839ed36 (diff)
parentc57b1153a58a6263863667296b5f00933fc46a4f (diff)
Merge tag 'v5.4.52' into 5.4-2.1.x-imx
This is the 5.4.52 stable release Conflicts (manual resolve, NXP version kept): arch/arm/mach-imx/pm-imx6.c NXP version has a different PM vectoring scheme, where the IRAM bottom half (8k) is used to store IRAM code and pm_info. Keep this version to be compatible with NXP PM implementation. Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
Diffstat (limited to 'block')
-rw-r--r--block/bio-integrity.c23
-rw-r--r--block/blk-mq.c4
2 files changed, 16 insertions, 11 deletions
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index ae07dd78e951..c9dc2b17ce25 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -24,6 +24,18 @@ void blk_flush_integrity(void)
flush_workqueue(kintegrityd_wq);
}
+void __bio_integrity_free(struct bio_set *bs, struct bio_integrity_payload *bip)
+{
+ if (bs && mempool_initialized(&bs->bio_integrity_pool)) {
+ if (bip->bip_vec)
+ bvec_free(&bs->bvec_integrity_pool, bip->bip_vec,
+ bip->bip_slab);
+ mempool_free(bip, &bs->bio_integrity_pool);
+ } else {
+ kfree(bip);
+ }
+}
+
/**
* bio_integrity_alloc - Allocate integrity payload and attach it to bio
* @bio: bio to attach integrity metadata to
@@ -75,7 +87,7 @@ struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio,
return bip;
err:
- mempool_free(bip, &bs->bio_integrity_pool);
+ __bio_integrity_free(bs, bip);
return ERR_PTR(-ENOMEM);
}
EXPORT_SYMBOL(bio_integrity_alloc);
@@ -96,14 +108,7 @@ void bio_integrity_free(struct bio *bio)
kfree(page_address(bip->bip_vec->bv_page) +
bip->bip_vec->bv_offset);
- if (bs && mempool_initialized(&bs->bio_integrity_pool)) {
- bvec_free(&bs->bvec_integrity_pool, bip->bip_vec, bip->bip_slab);
-
- mempool_free(bip, &bs->bio_integrity_pool);
- } else {
- kfree(bip);
- }
-
+ __bio_integrity_free(bs, bip);
bio->bi_integrity = NULL;
bio->bi_opf &= ~REQ_INTEGRITY;
}
diff --git a/block/blk-mq.c b/block/blk-mq.c
index f1b930a300a3..ae7d31cb5a4e 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -829,10 +829,10 @@ static bool blk_mq_rq_inflight(struct blk_mq_hw_ctx *hctx, struct request *rq,
void *priv, bool reserved)
{
/*
- * If we find a request that is inflight and the queue matches,
+ * If we find a request that isn't idle and the queue matches,
* we know the queue is busy. Return false to stop the iteration.
*/
- if (rq->state == MQ_RQ_IN_FLIGHT && rq->q == hctx->queue) {
+ if (blk_mq_request_started(rq) && rq->q == hctx->queue) {
bool *busy = priv;
*busy = true;