From patchwork Fri Apr 21 01:49:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9691665 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 6B86A6037F for ; Fri, 21 Apr 2017 01:52:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B0A626E3A for ; Fri, 21 Apr 2017 01:52:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F63B2841F; Fri, 21 Apr 2017 01:52:07 +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.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 DDA7726E3A for ; Fri, 21 Apr 2017 01:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034402AbdDUBum (ORCPT ); Thu, 20 Apr 2017 21:50:42 -0400 Received: from mail-io0-f175.google.com ([209.85.223.175]:33294 "EHLO mail-io0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034324AbdDUBtq (ORCPT ); Thu, 20 Apr 2017 21:49:46 -0400 Received: by mail-io0-f175.google.com with SMTP id k87so97112366ioi.0 for ; Thu, 20 Apr 2017 18:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=iz3YfUQON1n/i/44dj54lmW1pCxfrYOTiNvVirGzMw0=; b=EUDzbTdffjakXB2iojjVEnUuNYpfJru9N492HHVYXDfyX45ALdfxf2kCUeunWb+Bv1 2i9FqhiKAG6ebIO7G+K0y6Ea/7OUGruXaq3PXF26vuurA1M6r8AcwgHPbP8RkyW1X6AG pcGaXIFzjeEQi8QB9Zj3EuORcG/Ydse8fFqzG0M5J5e89SiWtHzDJjMV/uiGnhee+LqE wWS9NqwBXgiQjOcwoOF8yyhn1YiklwNN1h7aPlgKwL9jYiIMkIoIpW/w5mzdWqQqCqPf NY8+KSDJj92erw/b2JpbNvjyWUH1deLGR9eiTsg0yroZlD9XbjYVVAr2YKJR34ZEcbf0 d1PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=iz3YfUQON1n/i/44dj54lmW1pCxfrYOTiNvVirGzMw0=; b=l4uNvCmiyXDNhaLPfcXlzOl0WgkVY3cCyzpqhG1FT9gGKdaGPeTqhzSm5KYMDr3w// eXRwBE+VDFr338TcoTiPE0V0U4aH3zUK0U/Yw2/pXg+fy8KKZbbH/4oSDmhDn/erSPvb W6hwmnhgpROe8w8Uf+fI5PwXMumF50mdYXIEj5RLdSPOejjATfjvX5NdwHrxu0gT2ONq //5NkOfTFJrB10circob84dIaWBImV0an8xWbQrGTk+p3JP4Gm2FmikvTcTqq+3OupYK bmRdyCjAJKDpcFLVOVJnxf6SYg+BZjqHDMut7s57JOcENH2+h9Ifqfq1Qz6fsLPMZ1NO /nFQ== X-Gm-Message-State: AN3rC/46wvtY6qsjExsSEA/rdKyuwW4RpDcCRup4TnXob4A972bLhfUC 7r8+3ApH82siNQ== X-Received: by 10.99.231.17 with SMTP id b17mr10039660pgi.55.1492739385573; Thu, 20 Apr 2017 18:49:45 -0700 (PDT) Received: from [192.168.1.176] (66.29.164.166.static.utbb.net. [66.29.164.166]) by smtp.gmail.com with ESMTPSA id v128sm12561910pgb.20.2017.04.20.18.49.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Apr 2017 18:49:44 -0700 (PDT) Subject: Re: [PATCH] blk-stat: kill blk_stat_rq_ddir() To: "linux-block@vger.kernel.org" References: Cc: Stephen Bates From: Jens Axboe Message-ID: <422d7605-6ef5-bfa1-a699-f8c23e2efe1f@kernel.dk> Date: Thu, 20 Apr 2017 19:49:43 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: 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 On 04/20/2017 07:46 PM, Jens Axboe wrote: > No point in providing and exporting this helper. There's just > one (real) user of it, just use rq_data_dir(). Not sure what happened there, it doubled up the patch. I probably fat fingered the :r in vim. We just need one of them... Reviewed-by: Christoph Hellwig Reviewed-By: Stephen Bates diff --git a/block/blk-mq.c b/block/blk-mq.c index 766ae052f98a..f07156018bc9 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -46,7 +46,7 @@ static int blk_mq_poll_stats_bkt(const struct request *rq) { int ddir, bytes, bucket; - ddir = blk_stat_rq_ddir(rq); + ddir = rq_data_dir(rq); bytes = blk_rq_bytes(rq); bucket = ddir + 2*(ilog2(bytes) - 9); diff --git a/block/blk-stat.c b/block/blk-stat.c index dde9d399f707..6c2f40940439 100644 --- a/block/blk-stat.c +++ b/block/blk-stat.c @@ -19,12 +19,6 @@ struct blk_queue_stats { bool enable_accounting; }; -int blk_stat_rq_ddir(const struct request *rq) -{ - return rq_data_dir(rq); -} -EXPORT_SYMBOL_GPL(blk_stat_rq_ddir); - static void blk_stat_init(struct blk_rq_stat *stat) { stat->min = -1ULL; diff --git a/block/blk-stat.h b/block/blk-stat.h index 622a62ce6213..2fb20d1a341a 100644 --- a/block/blk-stat.h +++ b/block/blk-stat.h @@ -112,17 +112,6 @@ static inline void blk_stat_set_issue(struct blk_issue_stat *stat, /* record time/size info in request but not add a callback */ void blk_stat_enable_accounting(struct request_queue *q); -/* - * blk_stat_rq_ddir() - Bucket callback function for the request data direction. - * @rq: Request. - * - * This is the same as rq_data_dir() but as a function so it can be used as - * @bucket_fn for blk_stat_alloc_callback(). - * - * Return: Data direction of the request, either READ or WRITE. - */ -int blk_stat_rq_ddir(const struct request *rq); - /** * blk_stat_alloc_callback() - Allocate a block statistics callback. * @timer_fn: Timer callback function. diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 26e1bb617877..17676f4d7fd1 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -696,6 +696,11 @@ u64 wbt_default_latency_nsec(struct request_queue *q) return 75000000ULL; } +static int wbt_data_dir(const struct request *rq) +{ + return rq_data_dir(rq); +} + int wbt_init(struct request_queue *q) { struct rq_wb *rwb; @@ -707,7 +712,7 @@ int wbt_init(struct request_queue *q) if (!rwb) return -ENOMEM; - rwb->cb = blk_stat_alloc_callback(wb_timer_fn, blk_stat_rq_ddir, 2, rwb); + rwb->cb = blk_stat_alloc_callback(wb_timer_fn, wbt_data_dir, 2, rwb); if (!rwb->cb) { kfree(rwb); return -ENOMEM;