From patchwork Wed Nov 27 00:45:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 3242521 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1B181C045B for ; Wed, 27 Nov 2013 00:49:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58C3C20553 for ; Wed, 27 Nov 2013 00:49:22 +0000 (UTC) Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mail.kernel.org (Postfix) with ESMTP id 7C41020166 for ; Wed, 27 Nov 2013 00:49:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rAR0jpu4015201; Tue, 26 Nov 2013 19:45:53 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rAR0jocD017915 for ; Tue, 26 Nov 2013 19:45:50 -0500 Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.21]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rAR0joRD018120 for ; Tue, 26 Nov 2013 19:45:50 -0500 Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAR0jm5Y015907 for ; Tue, 26 Nov 2013 19:45:48 -0500 Received: by mail-pd0-f170.google.com with SMTP id g10so8862849pdj.1 for ; Tue, 26 Nov 2013 16:45:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FN3PhHKXRLfatf4qk7Ag1+uO/lr2cr5Y+k3ymo3AeTM=; b=V66IauVUH83fXMpLUs3/hkC6AWpKq7aoNdB23CvxfTxvKfgcUbKFAFaOh0ueoPbigw pN3yGaCJFomlaOoQDTHobCmG+MvRxnIT+ceeu5pegEhCidSYWBIQ8tfXoKL4uMmyB1X7 nVyCKYC4L4+5ovItbkXK3XAX7RldjAARiKJkArlgg8weHDUVNJ0pVE+AVCxyqKqN5+/p 0/K3FDF0iUw0Se9r7abMVVOfSqOM5947PQFH7gSYHHqXMWMw//Spz8hbBxLM1F3xDo/r b9mEW3cxz8PAJBEhKsbAKSo7N9eTl2VbNoQvsViBctycAq3fv1Cz3RLscfdcaxf88pl2 jnvA== X-Gm-Message-State: ALoCoQnQTAVEsgqyL4BcxEFgKlYmOu8uP74AJPrBCo3BU7rhJ33njp0ehcSWFUPKvAqkvbgNIRLo X-Received: by 10.68.88.161 with SMTP id bh1mr2247652pbb.49.1385513147851; Tue, 26 Nov 2013 16:45:47 -0800 (PST) Received: from kmo.daterainc.com ([157.22.22.146]) by mx.google.com with ESMTPSA id dq3sm83554293pbc.35.2013.11.26.16.45.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Nov 2013 16:45:46 -0800 (PST) From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, hch@infradead.org Date: Tue, 26 Nov 2013 16:45:08 -0800 Message-Id: <1385513128-5035-5-git-send-email-kmo@daterainc.com> In-Reply-To: <1385513128-5035-1-git-send-email-kmo@daterainc.com> References: <20131127004422.GB21305@kmo> <1385513128-5035-1-git-send-email-kmo@daterainc.com> X-RedHat-Spam-Score: -2.009 (BAYES_00, DCC_REPUT_13_19, RCVD_IN_DNSWL_NONE, URIBL_BLOCKED) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.21 X-loop: dm-devel@redhat.com Cc: Kent Overstreet , dm-devel@redhat.com, Alasdair Kergon Subject: [dm-devel] [PATCH 05/25] 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 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Mike Snitzer --- 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;