From patchwork Tue Sep 11 20:23:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 1439811 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2F9D3DFAF3 for ; Tue, 11 Sep 2012 20:23:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289Ab2IKUXZ (ORCPT ); Tue, 11 Sep 2012 16:23:25 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:35324 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751245Ab2IKUXY (ORCPT ); Tue, 11 Sep 2012 16:23:24 -0400 Received: by pbbrr13 with SMTP id rr13so1278698pbb.19 for ; Tue, 11 Sep 2012 13:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=eMC3nY+8YzoLIr/kAd6VQf4FO9Zec9/yYje5j/qzHr8=; b=jPUKD7lR1Bc/mR0xYfocEgyHLzRuhJvtqg06oGMxOcPOnhsswmFIrFf5E6qoj8mbGB UekE4wEQjOhp6KCj737xe4aoROT9nM1682Yp1qgZWky7VPeGxbC+jaV4hvDS8t0G+E3i JaJ8FNn3+mivcWDjo3BgTe93e5lAxnhiJRpPpj3guMM8N8kbxUEaQIox+Qu9xO3T2Zie OHTybrxCrkkbIABQylpvvxfp5tpGH0w1SFhCtItOhq1p9hz4jTbQIO59Y7AOGD2WMF+z cXyIEq1wjj4ZDN98G0OKFOyn8Bt4szcbAB1VCVBfGlyASwKIn+loqOlXtnZplU6hQTYh 4p1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=eMC3nY+8YzoLIr/kAd6VQf4FO9Zec9/yYje5j/qzHr8=; b=C8gpr4PLMG/iFIIPhNdboL8hRCFao01DcN1kTfBPmYc6HZk1cftibDMNU7PpE+Nh9u HGkTRFurhms01qzgS1hiQc3sOAkfHOUbq8bzi2XlkCqJeTbOehl4c94wfDbBlSQyv0AS h0Yqh4IhAly3qCc/qUo8m4l3LnQxsxy0qW7sdbcHpIClZJ4dk9s/CidxvAGK7r72aLdZ sJQokogxraLWjCheTTWufr8pW01Fs4vZGDt9Wie2PQ8IqnM9PVtEN3HCbXnquf+NJtb1 8sF3jl6Eti7BlJgFkBdXw9tEJ5G3GAgnloYlQTRC8tmAUqLuGm3l7DevBDGl/aWEpI/M yElw== Received: by 10.66.85.4 with SMTP id d4mr28157464paz.11.1347395003826; Tue, 11 Sep 2012 13:23:23 -0700 (PDT) Received: by 10.66.85.4 with SMTP id d4mr28157452paz.11.1347395003685; Tue, 11 Sep 2012 13:23:23 -0700 (PDT) Received: from formenos.mtv.corp.google.com (formenos.mtv.corp.google.com [172.18.110.66]) by mx.google.com with ESMTPS id gj9sm4088055pbc.16.2012.09.11.13.23.22 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 13:23:23 -0700 (PDT) From: Kent Overstreet To: linux-btrfs@vger.kernel.org Cc: Kent Overstreet , Chris Mason , Stefan Behrens Subject: [PATCH] btrfs: Kill some bi_idx references Date: Tue, 11 Sep 2012 13:23:05 -0700 Message-Id: <1347394985-13396-1-git-send-email-koverstreet@google.com> X-Mailer: git-send-email 1.7.12 X-Gm-Message-State: ALoCoQltn7Klt+BVeBgjNKLKQLsvVxynW6eafJ5ocG/uHY4naFpHq7XZawk1k9dAVSI8//ZRfRtk53K3GfiSewk75I8jsO3+IDP05i0dz/L8g5be320EX3cptNe1qz5irNP4KLc7vERtL5cykU3+VC40nE88mqPmtdHw80T12W/2dOAjtxGhJEc3zSoBrAskpbw0YJAjv2qkx0faP+wUR/bJfyV2j05THivx1bmFROq133fIcEDAFIg= Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org For immutable bio vecs, I've been auditing and removing bi_idx references. These were harmless, but removing them will make auditing easier. scrub_bio_end_io_worker() was open coding a bio_reset() - but this doesn't appear to have been needed for anything as right after it does a bio_put(), and perusing the code it doesn't appear anything else was holding a reference to the bio. The other use end_bio_extent_readpage() was just for a pr_debug() - changed it to something that might be a bit more useful. Signed-off-by: Kent Overstreet CC: Chris Mason CC: Stefan Behrens --- fs/btrfs/extent_io.c | 4 ++-- fs/btrfs/scrub.c | 15 --------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 4c87847..8d7fb96 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2298,8 +2298,8 @@ static void end_bio_extent_readpage(struct bio *bio, int err) struct extent_state *cached = NULL; struct extent_state *state; - pr_debug("end_bio_extent_readpage: bi_vcnt=%d, idx=%d, err=%d, " - "mirror=%ld\n", bio->bi_vcnt, bio->bi_idx, err, + pr_debug("end_bio_extent_readpage: bi_sector=%llu, err=%d, " + "mirror=%ld\n", (u64)bio->bi_sector, err, (long int)bio->bi_bdev); tree = &BTRFS_I(page->mapping->host)->io_tree; diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index b223620..2683ea7 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -1666,21 +1666,6 @@ static void scrub_bio_end_io_worker(struct btrfs_work *work) scrub_block_put(sblock); } - if (sbio->err) { - /* what is this good for??? */ - sbio->bio->bi_flags &= ~(BIO_POOL_MASK - 1); - sbio->bio->bi_flags |= 1 << BIO_UPTODATE; - sbio->bio->bi_phys_segments = 0; - sbio->bio->bi_idx = 0; - - for (i = 0; i < sbio->page_count; i++) { - struct bio_vec *bi; - bi = &sbio->bio->bi_io_vec[i]; - bi->bv_offset = 0; - bi->bv_len = PAGE_SIZE; - } - } - bio_put(sbio->bio); sbio->bio = NULL; spin_lock(&sdev->list_lock);