From patchwork Sun Jun 9 02:18:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 2693411 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by patchwork2.kernel.org (Postfix) with ESMTP id 8E3DDDF24C for ; Sun, 9 Jun 2013 02:23:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r592JlsT024703; Sat, 8 Jun 2013 22:19:49 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r592JjIk019747 for ; Sat, 8 Jun 2013 22:19:45 -0400 Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.20]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r592Ji12022131 for ; Sat, 8 Jun 2013 22:19:44 -0400 Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r592JhBu021721 for ; Sat, 8 Jun 2013 22:19:43 -0400 Received: by mail-pd0-f171.google.com with SMTP id y14so3307441pdi.30 for ; Sat, 08 Jun 2013 19:19:43 -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:in-reply-to:references; bh=T4nCqeJ2WqzsHjRfM8zU941R7frkwEj42kxhuGbHLXc=; b=puQVqbxEWUXFoaozkYtP0+GsL/qVi3a0W1BksxINmnKKHzkqyXr+4WLfjB9iAztDUP BUjhEp2DBneP+zwFEA8kUqauFg6MLMgGmAquaJ/NDZGxXYhh729Y7PekFEuSsyEJ5wb1 vykSxcgtxia1LWOouIcUxCRLK0aZhn49lVpRv954ywVVmaaQfB7TOdkP0tQJJ22mi/0g rElpIsihvXwBKZpI7Zb9YzZWzWxQAM4wRQ2mRVDr4mPG0CV8dfnkQdnWLNkbK+UbOIIY nXyF25IDOFPe5s9IsgXvuYUGO/AfhoCXlhruLdbfbfdBwKoSFje2nJ2n2u2ngzpwD2Ws Z5Eg== 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:in-reply-to:references :x-gm-message-state; bh=T4nCqeJ2WqzsHjRfM8zU941R7frkwEj42kxhuGbHLXc=; b=cEW6iOyrzDwaH9B30CBeVoOx9AAm+I4Tdlv6tNZ4EM9UcS8LCLmp/ZrDXwS3N2YM91 /7XG91dVM2g46I0J2dB/sU1zBM8mFqNe9i0qLVKdmS1DYvMfkOlJyJ/1Nywo3YxqHCOZ 17KKtlIsyjm8x12OuQqPWUq9y3dyHg/8vWofp9ffGxhSWG20bi52odGkoJcgIOrsvOI6 8pn2xiCdRCaewnuVUbiBlYDs8HQXdPj329uoHFX8Fgx4Rw6ifcQxcE4CB3LEz5jB0zP2 J7vJLTUqlBX8QHdTdxghlbupA1N7rPb2ziJgwArgCrw6gZoyV/aaUaVm2TolNaHHuP+2 xPtA== X-Received: by 10.66.139.198 with SMTP id ra6mr8699360pab.140.1370744383093; Sat, 08 Jun 2013 19:19:43 -0700 (PDT) Received: from moria.home.lan (c-107-3-149-94.hsd1.ca.comcast.net. [107.3.149.94]) by mx.google.com with ESMTPSA id un15sm9511110pab.7.2013.06.08.19.19.41 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 08 Jun 2013 19:19:42 -0700 (PDT) From: Kent Overstreet To: axboe@kernel.dk, tytso@mit.edu, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Date: Sat, 8 Jun 2013 19:18:46 -0700 Message-Id: <1370744348-15407-5-git-send-email-koverstreet@google.com> In-Reply-To: <1370744348-15407-1-git-send-email-koverstreet@google.com> References: <1370744348-15407-1-git-send-email-koverstreet@google.com> X-Gm-Message-State: ALoCoQnJEHtWPHdtr1UeIua2IUYj1jQZoU/+to2wJdeSia1Zs1qRxOcWQ1Q5deC23/46n/ObCqID6HCrWL11YRVaWy0tPAlD9QG0wQXzMvFG2SO3DgehJ8BryOLkvY+qosZDPEn+gWn6MUWLKQ4RjiLqvFZxtcrxh53rp8WPf8j2cTSnOR1nerF1z4ODJX5DUO5msdcXGzXX X-RedHat-Spam-Score: -2.547 (BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.20 X-loop: dm-devel@redhat.com Cc: Kent Overstreet , dm-devel@redhat.com, Alasdair Kergon Subject: [dm-devel] [PATCH 04/26] dm: Use bvec_iter for dm_bio_record() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com This patch doesn't itself have any functional changes, but immutable biovecs are going to add a bi_bvec_done member to bi_iter, which will need to be saved too here. Signed-off-by: Kent Overstreet Cc: Alasdair Kergon Cc: dm-devel@redhat.com --- drivers/md/dm-bio-record.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/md/dm-bio-record.h b/drivers/md/dm-bio-record.h index 5ace48e..4f46e8e 100644 --- a/drivers/md/dm-bio-record.h +++ b/drivers/md/dm-bio-record.h @@ -28,11 +28,9 @@ struct dm_bio_vec_details { }; struct dm_bio_details { - sector_t bi_sector; struct block_device *bi_bdev; - unsigned int bi_size; - unsigned short bi_idx; unsigned long bi_flags; + struct bvec_iter bi_iter; struct dm_bio_vec_details bi_io_vec[BIO_MAX_PAGES]; }; @@ -40,11 +38,9 @@ static inline void dm_bio_record(struct dm_bio_details *bd, struct bio *bio) { unsigned i; - bd->bi_sector = bio->bi_iter.bi_sector; bd->bi_bdev = bio->bi_bdev; - bd->bi_size = bio->bi_iter.bi_size; - bd->bi_idx = bio->bi_iter.bi_idx; bd->bi_flags = bio->bi_flags; + bd->bi_iter = bio->bi_iter; for (i = 0; i < bio->bi_vcnt; i++) { bd->bi_io_vec[i].bv_len = bio->bi_io_vec[i].bv_len; @@ -56,11 +52,9 @@ static inline void dm_bio_restore(struct dm_bio_details *bd, struct bio *bio) { unsigned i; - bio->bi_iter.bi_sector = bd->bi_sector; bio->bi_bdev = bd->bi_bdev; - bio->bi_iter.bi_size = bd->bi_size; - bio->bi_iter.bi_idx = bd->bi_idx; bio->bi_flags = bd->bi_flags; + bio->bi_iter = bd->bi_iter; for (i = 0; i < bio->bi_vcnt; i++) { bio->bi_io_vec[i].bv_len = bd->bi_io_vec[i].bv_len;