From patchwork Tue Apr 18 15:52:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9685655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 21EBE602C9 for ; Tue, 18 Apr 2017 15:53:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13B7227D4D for ; Tue, 18 Apr 2017 15:53:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 086AE2835B; Tue, 18 Apr 2017 15:53:06 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 AAD4C27D4D for ; Tue, 18 Apr 2017 15:53:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757442AbdDRPxD (ORCPT ); Tue, 18 Apr 2017 11:53:03 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:45362 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757372AbdDRPwp (ORCPT ); Tue, 18 Apr 2017 11:52:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rH0ZG84WyLgtgFr5ozARZ0Gv4cpibYKNKwGdct+YQ/M=; b=B/5qfkM5pjMf4eB/aPQJOagMW eg3glp7JVTfNQ3sTmsLIEk856LqvUrqtVQCYVMghHdl9vzucZ4/NzsHfNz5TM1Mu+Rsx9C4/qGPpp RKnxMLFHjaKBzgmp9bCHluY8EhQNgC3/0FR0yXo/PHJRRvCl/kGTTwuQisQXY3MGT4OZH5Gl7q7DY JMEhyIMSipWC6B7sQYzWkYWXFRN02e7mx5vkvdJTLSvVNV6uluVPs57RWhhIrJnXMDjuB92/PEeWg /FTRgTLXrKpzDA/jX/aeVEzh4oykPQgd7p6FT6rpCQCmEldic6MYq3FAkq2NKE8cA8pw1/YWulCur 3rovp5IWA==; Received: from hch by bombadil.infradead.org with local (Exim 4.87 #1 (Red Hat Linux)) id 1d0VQf-0001aL-DT; Tue, 18 Apr 2017 15:52:33 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Josef Bacik , James Smart , Konrad Rzeszutek Wilk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, dm-devel@redhat.com, Christoph Hellwig Subject: blk-mq: simplify __blk_mq_complete_request Date: Tue, 18 Apr 2017 08:52:22 -0700 Message-Id: <20170418155229.5977-17-hch@bombadil.infradead.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170418155229.5977-1-hch@bombadil.infradead.org> References: <20170418155229.5977-1-hch@bombadil.infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 From: Christoph Hellwig Merge blk_mq_ipi_complete_request and blk_mq_stat_add into their only caller. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 0c19df66f5a0..1f98db082da3 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -406,12 +406,19 @@ static void __blk_mq_complete_request_remote(void *data) rq->q->softirq_done_fn(rq); } -static void blk_mq_ipi_complete_request(struct request *rq) +static void __blk_mq_complete_request(struct request *rq) { struct blk_mq_ctx *ctx = rq->mq_ctx; bool shared = false; int cpu; + if (rq->internal_tag != -1) + blk_mq_sched_completed_request(rq); + if (rq->rq_flags & RQF_STATS) { + blk_mq_poll_stats_start(rq->q); + blk_stat_add(rq); + } + if (!test_bit(QUEUE_FLAG_SAME_COMP, &rq->q->queue_flags)) { rq->q->softirq_done_fn(rq); return; @@ -432,22 +439,6 @@ static void blk_mq_ipi_complete_request(struct request *rq) put_cpu(); } -static void blk_mq_stat_add(struct request *rq) -{ - if (rq->rq_flags & RQF_STATS) { - blk_mq_poll_stats_start(rq->q); - blk_stat_add(rq); - } -} - -static void __blk_mq_complete_request(struct request *rq) -{ - if (rq->internal_tag != -1) - blk_mq_sched_completed_request(rq); - blk_mq_stat_add(rq); - blk_mq_ipi_complete_request(rq); -} - /** * blk_mq_complete_request - end I/O on a request * @rq: the request being processed