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: 990403 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="tsLTlPgp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42kKwM0DkZz9s3l for ; Tue, 30 Oct 2018 03:35:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727941AbeJ3BZF (ORCPT ); Mon, 29 Oct 2018 21:25:05 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:45149 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727783AbeJ3BZE (ORCPT ); Mon, 29 Oct 2018 21:25:04 -0400 Received: by mail-io1-f65.google.com with SMTP id p83-v6so5346300iod.12 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=ooEj/53/7o1Edr35L25KzSNyp08lpdsiqMosvRicp+L+jK8Dsdp4/rKCvnTJkx1KSz pKOR4PihtNgLOn6+1pElvX0Bd4ZEEPKuhAYW96FuX2eAtaOhAddw5iWITdUu/XsmJE6O dSAqARElL6FOt9IUPyXRNivzT6nYiONHs2AhBddj06eI9cHRHAQltK4mHm6ZrKUFXFrS CJuMpc1Xt0FDJfOiL+d7PIkaFxQYEYpJO38eEFsBtLLA0SWj5JAD6NldvrGxO078cfO/ +OyeNz1bA9qmDjoS4gT3HuU2baqkhUwHJnKE/FL+GgXt5BCCIWuTfIGIf4ZHoUMkaPz4 e4jA== X-Gm-Message-State: AGRZ1gKA16GPZxOi/LQ7SEUlxXZAGGkXAnTIJjbI6kf/E0kbIJoxB9Z3 IudKoR+rZ+ILzXiKlPtDVvs+IMLAuGo= 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-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org 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 */