From patchwork Tue Oct 29 20:17:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 3111401 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1CF119F431 for ; Tue, 29 Oct 2013 20:22:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 417DC20144 for ; Tue, 29 Oct 2013 20:22:14 +0000 (UTC) Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mail.kernel.org (Postfix) with ESMTP id 54B2920121 for ; Tue, 29 Oct 2013 20:22:13 +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 r9TKIh4d027704; Tue, 29 Oct 2013 16:18:45 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9TKIh84000684 for ; Tue, 29 Oct 2013 16:18:43 -0400 Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.21]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9TKIgoE018950 for ; Tue, 29 Oct 2013 16:18:43 -0400 Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9TKIVrG011810 for ; Tue, 29 Oct 2013 16:18:32 -0400 Received: by mail-pb0-f48.google.com with SMTP id mc17so351410pbc.21 for ; Tue, 29 Oct 2013 13:18:31 -0700 (PDT) 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=9MOxebVb5WmUT1WBW+g4JAsobJ3ovlOnwTuJKEpe/QA=; b=a/O0f742O7j0EM3OzB0miPEz2NXI8CB2pcMKls5lPb14O9ohELf+L0JjzKoeXsZO3P FB6k3PmhYUV2yKyr9xJBwhuUVZ84nZ30akJeQlxwW7KDT8UUJ9RLfQaBUNt4s/lnP3ZU BS00yFAxKQy38OJPGfm+IjD+r679J92mnn+KA71IJ+ZqQoMqhnFWA/f9cUQROxEkgdaZ A3DwPWAR7gaF1wXRbH9mxjLbTBmxTCflpb7Y8WOCixE4cy0AkBBRZD3qzRmGEk3gSiA0 9CTw9gXPkESVbGQsQRP/p8V408N+mU3HjUCBOQSYfxTBVddxl7ppd2cwx5B4QIyrNPx1 XZng== X-Gm-Message-State: ALoCoQkh85ciH3+Tyic5n1Q/3fBNt+2hiCLM1LZNEtfRKs7Bl/9B7awz1Hz0+GcBoDQolLi1mx8x X-Received: by 10.66.19.137 with SMTP id f9mr2263179pae.138.1383077911523; Tue, 29 Oct 2013 13:18:31 -0700 (PDT) Received: from kmo.daterainc.com ([157.22.22.146]) by mx.google.com with ESMTPSA id n10sm1205230pbg.28.2013.10.29.13.18.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Oct 2013 13:18:31 -0700 (PDT) From: Kent Overstreet To: axboe@kernel.dk Date: Tue, 29 Oct 2013 13:17:58 -0700 Message-Id: <1383077896-4132-6-git-send-email-kmo@daterainc.com> In-Reply-To: <1383077896-4132-1-git-send-email-kmo@daterainc.com> References: <1383077896-4132-1-git-send-email-kmo@daterainc.com> X-RedHat-Spam-Score: -2.999 (BAYES_00, DCC_REPUT_00_12, RCVD_IN_DNSWL_LOW, URIBL_BLOCKED) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.21 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, linux-kernel@vger.kernel.org, hch@infradead.org, Kent Overstreet , tj@kernel.org, Alasdair Kergon Subject: [dm-devel] [PATCH 05/23] 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=-7.4 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 --- 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;