From patchwork Wed Oct 31 17:59:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10663133 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 B40621751 for ; Wed, 31 Oct 2018 18:00:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6B542B507 for ; Wed, 31 Oct 2018 18:00:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B5D32B525; Wed, 31 Oct 2018 18:00:24 +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=unavailable 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 A564A2B517 for ; Wed, 31 Oct 2018 18:00:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730212AbeKAC7Z (ORCPT ); Wed, 31 Oct 2018 22:59:25 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:35613 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730213AbeKAC7Z (ORCPT ); Wed, 31 Oct 2018 22:59:25 -0400 Received: by mail-io1-f67.google.com with SMTP id 79-v6so10352762iou.2 for ; Wed, 31 Oct 2018 11:00:21 -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=txVJQ2S/C+MNrq+6R8pbmqS15SGzqYTSBDoZX1SWd4VeJsadXGygkkauKcJUJJuaWN +nvyN8q/U2LH4u60bh/SaF6kXzTYJo1otLRKZIBewjGgUriaolGIsUHGQjZfp9rhPZNO X5SHbnB6s3J1lpZ7MvKLhGgCmABsh9pQX1dbIG4PNsz0yBmTnTAyudhOTA5VHHbijrE1 8URv/mmghzvr5LVdIq9Mtb1r7Mi0yfu6XPWCXHGAEFjD5NKsZX/TZaJVw9GN34yYNnNN 2qIwZsokPezzav7gvpcCxH4a2qFuP4ydF/VtJ2iS6+sSiB4V4ExCnu3Fi4EVu48gTX03 1y2Q== 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=LO8gW0WzgCPJf9jz3kQQSYhwBHHMMFQD1tig3wAuJ2D47r6ieWrQENCQeFOICzVBZ/ bFcga/7mmHCRc9ZcHIqzpgfGJ+jgWdqpkQAE1SQbjfB7E3yXCdPFNp+jjS2jPdaiG36P EMXIiqkvtX7s0GoJkcmXYujo/S+IZ5dt6iCi9SSRbKQE/mzBdrmmmcCDytrQ+q1aGr/t l+vDnnZoRTyDJoMUqjcEs8Nuxk+6u33cYBpIzBDaTDimclfU46OvxwaW2Lu9Q//mTQ1P rUpJyCKFUScphEN3zx3bfySO3nfuvVXZIpnq6khzMRTQ8czkLXBGPz0zfkeBVWxQIutv 9c2g== X-Gm-Message-State: AGRZ1gLAiGZAvpNRMDrkclIAbhVhkKx+OWPlYPb1IKK1jHY9ykf93SXJ yoS1qnvPG4t04B9ZMZwzDlmbZKLMUOQ= X-Google-Smtp-Source: AJdET5d4Z2J5PAo6/1x5OdRpuH2IhgVG+aL3a8ILwcpNLv2LqL9gDadknX+yrL3799EllQcCqXbosg== X-Received: by 2002:a6b:3989:: with SMTP id g131-v6mr2808738ioa.67.1541008820474; Wed, 31 Oct 2018 11:00:20 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id 197-v6sm10982947iou.87.2018.10.31.11.00.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 11:00:19 -0700 (PDT) From: Jens Axboe To: linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 27/30] block: remove req_no_special_merge() from merging code Date: Wed, 31 Oct 2018 11:59:19 -0600 Message-Id: <20181031175922.8849-28-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031175922.8849-1-axboe@kernel.dk> References: <20181031175922.8849-1-axboe@kernel.dk> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@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 */