From patchwork Mon Oct 29 16:34:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10659663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62D923CF1 for ; Mon, 29 Oct 2018 16:35:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4806329C43 for ; Mon, 29 Oct 2018 16:35:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C73B29C45; Mon, 29 Oct 2018 16:35:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D035829C4A for ; Mon, 29 Oct 2018 16:35:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727945AbeJ3BZF (ORCPT ); Mon, 29 Oct 2018 21:25:05 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:37048 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727461AbeJ3BZE (ORCPT ); Mon, 29 Oct 2018 21:25:04 -0400 Received: by mail-io1-f66.google.com with SMTP id k17-v6so5366157ioc.4 for ; Mon, 29 Oct 2018 09:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9rhf6+fpZjO/bVVLCyuy9ac9MsEUV0k6QtdcTBlC4Y8=; b=tsLTlPgp3L3RHGWgLsZNUColPr3J1Tz5+nA/vMkDaGjB0wT46sQ8e8Lf6JvHXdkAVR CsBjoojWrsdERbMJmOqg1mD4zUguLLZ4aH+///y3arD0CgFFqG4TNlAKAdVVMqKBvFyc BOD0Hzk65QZnqY1iYKtYTLT5/QP/B1LSMseW2yQUcRnjMGWPx9POyhHJ8frXoEjY4MLy ftyDEPqzyE2dstPhXZVPhhIXgx6VvMmcszHJ+sa+OlgZ5d9tzSZSpHal53cDhQkvayil QZ9Z9Rd4qTv3qm6ei33vuO0Qm8XSCFiFb/DV0js5Mqhs3NAbuxZCcOihiTL4z4FFr9gn qxIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9rhf6+fpZjO/bVVLCyuy9ac9MsEUV0k6QtdcTBlC4Y8=; b=VLKK++R3bA56E3N+T8b5b62NvQb0vFg7giEUVlYYmWuqgjSdXjmS8S5pcdYzlK7QF7 7s7cULwm1BX0DwznftzSVCarm/XqugArQcO9hEH4dVusZ5GQdJU1pr1zJZTGdsx1/S7j YjpBzB8rXmqV4nuWWn0CR++194OMDZWRGwXS8m5ZZtfZy1zF/O7Ku2eFWIUaicdjAOQF 6eimdZvlTsJf81xXOpFCdmvu7xXYYk4zJORvuV23Geh+ykp/6FP3n5u4MDxPkzScxDHo 1i6PzXpXNonuffIDZbU+yshddo4rTFl6cM5VfPXjHgJZ8I0jF3mNTWjGvj35XywxEJIB r3bQ== X-Gm-Message-State: AGRZ1gLxh11nE60bQyIgPusalktJT8244XGjZ4yfVIo77advUnlZ8ib6 XP609Sen8bxi3o/OmbMsDjckmQ== X-Google-Smtp-Source: AJdET5fdfTo5L6ygtT6As7ptgCH4GINl36sgzRCr9ThrEnqQrmMts6bgGAtERGxSdEkwJqqX/edrYg== X-Received: by 2002:a6b:c385:: with SMTP id t127-v6mr942028iof.92.1540830943259; Mon, 29 Oct 2018 09:35:43 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id n7-v6sm6464500itb.22.2018.10.29.09.35.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 09:35:41 -0700 (PDT) From: Jens Axboe To: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 27/29] block: remove req_no_special_merge() from merging code Date: Mon, 29 Oct 2018 10:34:42 -0600 Message-Id: <20181029163444.9940-28-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181029163444.9940-1-axboe@kernel.dk> References: <20181029163444.9940-1-axboe@kernel.dk> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It'll always be false at this point, just remove it. Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe --- block/blk-merge.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 7fedc0391610..3561dcce2260 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -595,17 +595,6 @@ int ll_front_merge_fn(struct request_queue *q, struct request *req, return ll_new_hw_segment(q, req, bio); } -/* - * blk-mq uses req->special to carry normal driver per-request payload, it - * does not indicate a prepared command that we cannot merge with. - */ -static bool req_no_special_merge(struct request *req) -{ - struct request_queue *q = req->q; - - return !q->mq_ops && req->special; -} - static bool req_attempt_discard_merge(struct request_queue *q, struct request *req, struct request *next) { @@ -631,13 +620,6 @@ static int ll_merge_requests_fn(struct request_queue *q, struct request *req, unsigned int seg_size = req->biotail->bi_seg_back_size + next->bio->bi_seg_front_size; - /* - * First check if the either of the requests are re-queued - * requests. Can't merge them if they are. - */ - if (req_no_special_merge(req) || req_no_special_merge(next)) - return 0; - if (req_gap_back_merge(req, next->bio)) return 0; @@ -738,8 +720,7 @@ static struct request *attempt_merge(struct request_queue *q, return NULL; if (rq_data_dir(req) != rq_data_dir(next) - || req->rq_disk != next->rq_disk - || req_no_special_merge(next)) + || req->rq_disk != next->rq_disk) return NULL; if (req_op(req) == REQ_OP_WRITE_SAME && @@ -858,8 +839,8 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio) if (bio_data_dir(bio) != rq_data_dir(rq)) return false; - /* must be same device and not a special request */ - if (rq->rq_disk != bio->bi_disk || req_no_special_merge(rq)) + /* must be same device */ + if (rq->rq_disk != bio->bi_disk) return false; /* only merge integrity protected bio into ditto rq */