From patchwork Fri Apr 21 01:46:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9691663 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 541746037F for ; Fri, 21 Apr 2017 01:46:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 389602848D for ; Fri, 21 Apr 2017 01:46:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A57226E4D; Fri, 21 Apr 2017 01:46:31 +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 9602A26E4D for ; Fri, 21 Apr 2017 01:46:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034324AbdDUBqa (ORCPT ); Thu, 20 Apr 2017 21:46:30 -0400 Received: from mail-io0-f172.google.com ([209.85.223.172]:35182 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034301AbdDUBq3 (ORCPT ); Thu, 20 Apr 2017 21:46:29 -0400 Received: by mail-io0-f172.google.com with SMTP id r16so92648933ioi.2 for ; Thu, 20 Apr 2017 18:46:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=CIny2Jn24hOqNXusUYXNR5qlOqG+7iRUJgvPSeq61CU=; b=hEPDPPg8PfQQKiJ/FmZrBIHro8QPbNtv0sST+/9t/1wjdAjo5694QHUsz6DNIsTPOe P68P8fIo3ikCgpbgcbZjAJJC1+2I0Bn9UoPOC3tPOl2rN6AXSPhPcIrv4RNeS0WHvz+R kGTvOwLYRLI1fcC9TW1hqM0rRDuB8I1dfNeblOslWrLGQr2a5Y84WIaJmxbeMBugerO+ ic027XkGV0rARV2n0+VeSFWKxkTjFRKxAjTi4usSgQoCo4bmgk6Y18Fpoj8qB0ASI+rZ 8IvCrS5JinC+hTCss8/pEWBT44+ZLfquSP2TWgLXmTdCO4DzBxj15/a4sCHVCRY1AKOC ryWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=CIny2Jn24hOqNXusUYXNR5qlOqG+7iRUJgvPSeq61CU=; b=pjoV/i5G3gyQsTmVr7sfyafi4ulx0h3PeJWj+QmnbrjvjXXsMo/sDbgkUsTiJ6XMr8 oBor7xsDmBZCRMWEIMIxNsJT3XepFvNga+V1sQLkp2cUikVWzz4MLfjHE7BO/0j8AD5E opxthZuW4/cfzZu6e3G3LkBhD7QH7hWIWlDlhdY6XKS+KWxwrs46uen6L6bXrb7fHxnf m5m39umXKNh1P+F4xmyC/tD51W7F0Sh9TImhEHX31uL2QVgo08imra9+/Pj6ztSMoIaR DIJ9qz9XTNtweBB66gNGip/nKlLp5RRn2E9NEm1Y8obfmcq8jmrsknmIT/PdYzFww+B8 Ok9g== X-Gm-Message-State: AN3rC/56pj7MTD0VBxjEq4JVtYYQId51oIfP8HpiM3NdWy9lw2U4ZJDg 4jXJLCvmGVKc9w== X-Received: by 10.99.114.22 with SMTP id n22mr10065203pgc.163.1492739187621; Thu, 20 Apr 2017 18:46:27 -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 i15sm12547655pfj.51.2017.04.20.18.46.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Apr 2017 18:46:26 -0700 (PDT) To: "linux-block@vger.kernel.org" Cc: Stephen Bates From: Jens Axboe Subject: [PATCH] blk-stat: kill blk_stat_rq_ddir() Message-ID: Date: Thu, 20 Apr 2017 19:46:25 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 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 No point in providing and exporting this helper. There's just one (real) user of it, just use rq_data_dir(). Signed-off-by: Jens Axboe 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; 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;