blk-merge.c (efef739d5f37dc998b113fb965aea68d42a9eddc) blk-merge.c (6deacb3bfac2b720e707c566549a7041f17db9c8)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Functions related to segment and merge handling
4 */
5#include <linux/kernel.h>
6#include <linux/module.h>
7#include <linux/bio.h>
8#include <linux/blkdev.h>

--- 1037 unchanged lines hidden (view full) ---

1046 * Caller must ensure !blk_queue_nomerges(q) beforehand.
1047 */
1048bool blk_attempt_plug_merge(struct request_queue *q, struct bio *bio,
1049 unsigned int nr_segs)
1050{
1051 struct blk_plug *plug;
1052 struct request *rq;
1053
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Functions related to segment and merge handling
4 */
5#include <linux/kernel.h>
6#include <linux/module.h>
7#include <linux/bio.h>
8#include <linux/blkdev.h>

--- 1037 unchanged lines hidden (view full) ---

1046 * Caller must ensure !blk_queue_nomerges(q) beforehand.
1047 */
1048bool blk_attempt_plug_merge(struct request_queue *q, struct bio *bio,
1049 unsigned int nr_segs)
1050{
1051 struct blk_plug *plug;
1052 struct request *rq;
1053
1054 plug = blk_mq_plug(q, bio);
1054 plug = blk_mq_plug(bio);
1055 if (!plug || rq_list_empty(plug->mq_list))
1056 return false;
1057
1058 rq_list_for_each(&plug->mq_list, rq) {
1059 if (rq->q == q) {
1060 if (blk_attempt_bio_merge(q, rq, bio, nr_segs, false) ==
1061 BIO_MERGE_OK)
1062 return true;

--- 73 unchanged lines hidden ---
1055 if (!plug || rq_list_empty(plug->mq_list))
1056 return false;
1057
1058 rq_list_for_each(&plug->mq_list, rq) {
1059 if (rq->q == q) {
1060 if (blk_attempt_bio_merge(q, rq, bio, nr_segs, false) ==
1061 BIO_MERGE_OK)
1062 return true;

--- 73 unchanged lines hidden ---