Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp990776ybs; Mon, 25 May 2020 04:35:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7iQhRr5z2aD2baRFrWcFmzUWwi1p4D/4pqxgvSD+k/IySyIWU3cDDzITK5Rl7oR+Wklys X-Received: by 2002:a17:907:b13:: with SMTP id h19mr17771627ejl.488.1590406524013; Mon, 25 May 2020 04:35:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590406524; cv=none; d=google.com; s=arc-20160816; b=AkPGLCK/L407hCzjuZyKCfuDI1DQqxEyIOR5HDZBy16Z5jSZ0WohRGhifAQ/p2EsCa +aKWgGkB0vR6WRqfk8TxgmH4RYhQEKjXT9Bv40vPVlXTa6XsNvwSkJpr9oyjMjXlRXUx wR1MY4CqSwESi/NbyKNCnN5kayw6nk1qeVoay21PHOt7W7cKaE1o9mHyG57hwJcmSiT7 gF0HuTkC7Z4oQF2o0vg6RZ/9nbd5z+egVWiHW5Dy0v3GnruhwMfp3CNQA0lgpgGw0A6D xLtHpz9kA4Ct7FclqktMnJsJwiTpmJjt4nwS6MBvwKSo+P652pdmC4YKlGmsR1lwlPtf 1Ecw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Kem+Md/o9biQbHpho+JPveOv/KJgvNSOsgvRyoxBLPU=; b=ZPCmls+InIyTHHMZs5k6f90tGItj8xls09vHqb7RWwgUHSdPo0jCQYazzy0HwsZ1Nc FMltW8MOEL/p+Q8UzZb9/QEj1zUABd/wFJSOY6az/QFwNYvZMXk/vvAfIbL1CIoqmPa4 aG0RrJiMQS2ALD1dnoo27PwOALXYvBHOgMEj2UvK4TbUqv/F/vmr0qucyXhJE0lK8Q94 zh9hPzTSDLb0BztffYJoCsVYt0TcMwoz5MRCi6wPCqxRS9D2DV67+iKVOEhSdCWnYVtP hclaafgerjwH9l5gmA37MyXNE3VoQVp0ZG+A+dSqJVVHe4LXEMvVDgtoF9qDwqrGwI7f Ktzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=hlyzKgUq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si9710927edl.424.2020.05.25.04.35.01; Mon, 25 May 2020 04:35:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=hlyzKgUq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390239AbgEYLag (ORCPT + 99 others); Mon, 25 May 2020 07:30:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390223AbgEYLae (ORCPT ); Mon, 25 May 2020 07:30:34 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86F82C061A0E; Mon, 25 May 2020 04:30:34 -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=Kem+Md/o9biQbHpho+JPveOv/KJgvNSOsgvRyoxBLPU=; b=hlyzKgUqDe1/rLenQn+uC206Ho /J6TShCG77UAdZcVIY7FfB+NtnL427bJlsQYe9uxJIXV2SIz40hPLqjho+RnpL7dM0XFZDlxoMEuT UNUB8p69Xy+cFD19VHQN3q9PCyJss6xkizSNa4nDz3EctwokrVP07bSimwhL68Ks3/Q4vGD6oVDEE aM44+6Y7S7abnK5al5vSKSV3lB/RAEuhARAUwRq7RUPrie4/YnzvHyRVGW6pCE5GcM57LZ0eKKbGb NoA5c2aBaPxAuC7Dny41hYm/dVAwzuOBYph7qRXldqc4XqvgKajczFOUHJhzk3ycuoiGMRAlaa5DK HpOgujPg==; Received: from [2001:4bb8:18c:5da7:c70:4a89:bc61:2] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdBJJ-0002Nh-W9; Mon, 25 May 2020 11:30:26 +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 03/16] rsxx: use bio_{start,end}_io_acct Date: Mon, 25 May 2020 13:30:01 +0200 Message-Id: <20200525113014.345997-4-hch@lst.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200525113014.345997-1-hch@lst.de> References: <20200525113014.345997-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 Switch rsxx to use the nicer bio accounting helpers. Signed-off-by: Christoph Hellwig --- drivers/block/rsxx/dev.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/block/rsxx/dev.c b/drivers/block/rsxx/dev.c index 8ffa8260dcafe..3ba07ab30c84f 100644 --- a/drivers/block/rsxx/dev.c +++ b/drivers/block/rsxx/dev.c @@ -96,20 +96,6 @@ static const struct block_device_operations rsxx_fops = { .ioctl = rsxx_blkdev_ioctl, }; -static void disk_stats_start(struct rsxx_cardinfo *card, struct bio *bio) -{ - generic_start_io_acct(card->queue, bio_op(bio), bio_sectors(bio), - &card->gendisk->part0); -} - -static void disk_stats_complete(struct rsxx_cardinfo *card, - struct bio *bio, - unsigned long start_time) -{ - generic_end_io_acct(card->queue, bio_op(bio), - &card->gendisk->part0, start_time); -} - static void bio_dma_done_cb(struct rsxx_cardinfo *card, void *cb_data, unsigned int error) @@ -121,7 +107,7 @@ static void bio_dma_done_cb(struct rsxx_cardinfo *card, if (atomic_dec_and_test(&meta->pending_dmas)) { if (!card->eeh_state && card->gendisk) - disk_stats_complete(card, meta->bio, meta->start_time); + bio_end_io_acct(meta->bio, meta->start_time); if (atomic_read(&meta->error)) bio_io_error(meta->bio); @@ -167,10 +153,9 @@ static blk_qc_t rsxx_make_request(struct request_queue *q, struct bio *bio) bio_meta->bio = bio; atomic_set(&bio_meta->error, 0); atomic_set(&bio_meta->pending_dmas, 0); - bio_meta->start_time = jiffies; if (!unlikely(card->halt)) - disk_stats_start(card, bio); + bio_meta->start_time = bio_start_io_acct(bio); dev_dbg(CARD_TO_DEV(card), "BIO[%c]: meta: %p addr8: x%llx size: %d\n", bio_data_dir(bio) ? 'W' : 'R', bio_meta, -- 2.26.2