From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C12C4C433E0 for ; Wed, 27 May 2020 05:25:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9FE0520776 for ; Wed, 27 May 2020 05:25:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="b9lpto70" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726393AbgE0FZB (ORCPT ); Wed, 27 May 2020 01:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729033AbgE0FYx (ORCPT ); Wed, 27 May 2020 01:24:53 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F8EEC061A0F; Tue, 26 May 2020 22:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=jAURZKlR3wABF7HVZ7jgwwb3T9+sEOkFONnpRICBtxk=; b=b9lpto70CQqiKdI3uzCEpMlbCf S0IgWN79A13NXEagh9OH9+Qh+JTDTOeMoPjVIuUNfJiAQ+P7WzUbKwDKQk3vPhbGqHsJrVSk4utl2 rE2/SU1j43BMRA/XFHmWBPxMeSz9zQ0oiXDhfvPgsGJAMrsPJXTrGLcxfBBf8qGIfJynA3Mobq3E+ mjfsUtnhu0yeIU4MY49hiV9ahnzRBQyET4zmj6BzzQpIjttHnvEwO+71DYXKl/DaMmQljzKYxd6aJ NND9YGXuZ3liozt0LHGnA/lee1fDLPc7pwEf9Q19tbT96+Z0qcD37iWSLoJ4ojAms6K5BNdcZ5fSX fU8Jbe+Q==; Received: from [2001:4bb8:18c:5da7:8164:affc:3c20:853d] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdoYb-0000s4-VW; Wed, 27 May 2020 05:24:50 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Konstantin Khlebnikov , Minchan Kim , Nitin Gupta , dm-devel@redhat.com, linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, linux-bcache@vger.kernel.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/16] block: move update_io_ticks to blk-core.c Date: Wed, 27 May 2020 07:24:13 +0200 Message-Id: <20200527052419.403583-11-hch@lst.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200527052419.403583-1-hch@lst.de> References: <20200527052419.403583-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All callers are in blk-core.c, so move update_io_ticks over. Signed-off-by: Christoph Hellwig Reviewed-by: Konstantin Khlebnikov --- block/bio.c | 16 ---------------- block/blk-core.c | 15 +++++++++++++++ block/blk.h | 1 - 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/block/bio.c b/block/bio.c index 3e89c7b37855a..5235da6434aab 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1376,22 +1376,6 @@ void bio_check_pages_dirty(struct bio *bio) schedule_work(&bio_dirty_work); } -void update_io_ticks(struct hd_struct *part, unsigned long now, bool end) -{ - unsigned long stamp; -again: - stamp = READ_ONCE(part->stamp); - if (unlikely(stamp != now)) { - if (likely(cmpxchg(&part->stamp, stamp, now) == stamp)) { - __part_stat_add(part, io_ticks, end ? now - stamp : 1); - } - } - if (part->partno) { - part = &part_to_disk(part)->part0; - goto again; - } -} - static inline bool bio_remaining_done(struct bio *bio) { /* diff --git a/block/blk-core.c b/block/blk-core.c index 8973104f88d90..c1675d43c2da0 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1381,6 +1381,21 @@ unsigned int blk_rq_err_bytes(const struct request *rq) } EXPORT_SYMBOL_GPL(blk_rq_err_bytes); +static void update_io_ticks(struct hd_struct *part, unsigned long now, bool end) +{ + unsigned long stamp; +again: + stamp = READ_ONCE(part->stamp); + if (unlikely(stamp != now)) { + if (likely(cmpxchg(&part->stamp, stamp, now) == stamp)) + __part_stat_add(part, io_ticks, end ? now - stamp : 1); + } + if (part->partno) { + part = &part_to_disk(part)->part0; + goto again; + } +} + static void blk_account_io_completion(struct request *req, unsigned int bytes) { if (req->part && blk_do_io_stat(req)) { diff --git a/block/blk.h b/block/blk.h index 5db4ec1e85f7b..bdf5e94467aa2 100644 --- a/block/blk.h +++ b/block/blk.h @@ -344,7 +344,6 @@ void blk_queue_free_zone_bitmaps(struct request_queue *q); static inline void blk_queue_free_zone_bitmaps(struct request_queue *q) {} #endif -void update_io_ticks(struct hd_struct *part, unsigned long now, bool end); struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, sector_t sector); int blk_alloc_devt(struct hd_struct *part, dev_t *devt); -- 2.26.2