From patchwork Mon Oct 15 20:09:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 1595691 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 49DF5DFB34 for ; Mon, 15 Oct 2012 20:13:46 +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 q9FKBM41006900; Mon, 15 Oct 2012 16:11:22 -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 q9FKAj7B027207 for ; Mon, 15 Oct 2012 16:10: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 q9FKAef0026739 for ; Mon, 15 Oct 2012 16:10:40 -0400 Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9FKAQZB021993 for ; Mon, 15 Oct 2012 16:10:39 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr4so5285168pbb.33 for ; Mon, 15 Oct 2012 13:10:38 -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=1IguwoKmFLi9pM5rWNXkJhNurTnF24Jh2y2UNrZJ7Yk=; b=fQf2BU+UuBH7bEmXRCbqyGtm97DpYTaWFK05iUfXKE989sm4WLhvv7B5TbnrmG8/Bh nYQhFSvMKEf1K+HnuTOsQh9Pb22BPzqPp9WaFC5dAv71HoZC0pKhcwPw5oMV5x/Pi9G8 8JyC1jBo9V/qU8mwKDO2k/RjOSD3AxrbuLcuge6sAWwGDuKL9icERCOG+6vooE6R6AGN 7ayMtSLo5NRyY0LdKHGqGCpHD5RLWEvmsv29kBGRwU7vNESNbNPaEr7Zy93fJke6/MTq fYJZISsuy04XXtCeFza2IhhJETS2Xe+Djl2iATxNC3ApR964MlXirrke6sUKHYtD6ozn GISQ== 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=1IguwoKmFLi9pM5rWNXkJhNurTnF24Jh2y2UNrZJ7Yk=; b=K+xYNyyhEZrSxLvwBPqsETVq+CeEJLpyFlkDiIL7q2k3ShyMqTnDqXMYeNMstsgIJM OodNv33KJqwtjJXjdPEVo3J/8L5OuMvk2mlQV5cLY4aJqqdTtiL8znkgCULpxBBhUH7+ EjCaQFCKSR+8of/jk4NmHZjc4Jenxghmg8zvzOdvSpT0ui1KQMQ/aKtZJbJFGd6IdzcA spKfwORhdFfumlxpvi2h+zh0MtoET4j8NRX13kNDntbOwXDmP49n69SEL1O0G3Mv9O7u z/QXolkXIxdBkeAXO/EF2VieevO2YYvt3lDg7tk0YD3VqoD8affwaypCt84k+akfrftT Tkwg== Received: by 10.68.189.233 with SMTP id gl9mr72412pbc.166.1350331838866; Mon, 15 Oct 2012 13:10:38 -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 k9sm3021703paz.22.2012.10.15.13.10.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 13:10:38 -0700 (PDT) From: Kent Overstreet To: linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com Date: Mon, 15 Oct 2012 13:09:11 -0700 Message-Id: <1350331769-14856-38-git-send-email-koverstreet@google.com> In-Reply-To: <1350331769-14856-1-git-send-email-koverstreet@google.com> References: <1350331769-14856-1-git-send-email-koverstreet@google.com> X-Gm-Message-State: ALoCoQnVoyBK+uuhFFVYgAkaquj0G8EZM0WyOh77NjbeeVCqKuU/ClPe4idBif5UFnBU5gGnOdLIRih1BZNS8EnZXHzF3EGv/iGGm02h+VLJjSMnjXulvlboXLD+OWffRObO62RY+ncOsc1kaAQ+i2gQ83rlZc5Y6Ojx/hDIQTYXIaCQLXYGtCCePMQt8wOt16NLL66q60rQ X-RedHat-Spam-Score: -3.072 (BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, 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: tj@kernel.org, axboe@kernel.dk, Kent Overstreet Subject: [dm-devel] [PATCH v2 08/26] block: Remove bi_idx references 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 These were harmless but uneccessary,andt getting rid of them makes the code easier to audit since most of them need to be removed. Signed-off-by: Kent Overstreet CC: Jens Axboe --- drivers/block/floppy.c | 1 - drivers/md/dm-verity.c | 2 +- drivers/md/raid10.c | 1 - fs/buffer.c | 1 - fs/jfs/jfs_logmgr.c | 2 -- fs/logfs/dev_bdev.c | 5 ----- mm/page_io.c | 1 - 7 files changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 95e52879..24e5cef 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -3778,7 +3778,6 @@ static int __floppy_read_block_0(struct block_device *bdev) bio_vec.bv_len = size; bio_vec.bv_offset = 0; bio.bi_vcnt = 1; - bio.bi_idx = 0; bio.bi_size = size; bio.bi_bdev = bdev; bio.bi_sector = 0; diff --git a/drivers/md/dm-verity.c b/drivers/md/dm-verity.c index 18ef6c5..6956626 100644 --- a/drivers/md/dm-verity.c +++ b/drivers/md/dm-verity.c @@ -496,7 +496,7 @@ static int verity_map(struct dm_target *ti, struct bio *bio, bio->bi_end_io = verity_end_io; bio->bi_private = io; - io->io_vec_size = bio->bi_vcnt - bio->bi_idx; + io->io_vec_size = bio_segments(bio); if (io->io_vec_size < DM_VERITY_IO_VEC_INLINE) io->io_vec = io->io_vec_inline; else diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index bbd08f5..6d06d83 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -4249,7 +4249,6 @@ read_more: read_bio->bi_flags &= ~(BIO_POOL_MASK - 1); read_bio->bi_flags |= 1 << BIO_UPTODATE; read_bio->bi_vcnt = 0; - read_bio->bi_idx = 0; read_bio->bi_size = 0; r10_bio->master_bio = read_bio; r10_bio->read_slot = r10_bio->devs[r10_bio->read_slot].devnum; diff --git a/fs/buffer.c b/fs/buffer.c index 58e2e7b..38d8793 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2893,7 +2893,6 @@ int submit_bh(int rw, struct buffer_head * bh) bio->bi_io_vec[0].bv_offset = bh_offset(bh); bio->bi_vcnt = 1; - bio->bi_idx = 0; bio->bi_size = bh->b_size; bio->bi_end_io = end_bio_bh_io_sync; diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 2eb952c..8ae5e35 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -2004,7 +2004,6 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp) bio->bi_io_vec[0].bv_offset = bp->l_offset; bio->bi_vcnt = 1; - bio->bi_idx = 0; bio->bi_size = LOGPSIZE; bio->bi_end_io = lbmIODone; @@ -2145,7 +2144,6 @@ static void lbmStartIO(struct lbuf * bp) bio->bi_io_vec[0].bv_offset = bp->l_offset; bio->bi_vcnt = 1; - bio->bi_idx = 0; bio->bi_size = LOGPSIZE; bio->bi_end_io = lbmIODone; diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c index e784a21..550475c 100644 --- a/fs/logfs/dev_bdev.c +++ b/fs/logfs/dev_bdev.c @@ -32,7 +32,6 @@ static int sync_request(struct page *page, struct block_device *bdev, int rw) bio_vec.bv_len = PAGE_SIZE; bio_vec.bv_offset = 0; bio.bi_vcnt = 1; - bio.bi_idx = 0; bio.bi_size = PAGE_SIZE; bio.bi_bdev = bdev; bio.bi_sector = page->index * (PAGE_SIZE >> 9); @@ -108,7 +107,6 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index, if (i >= max_pages) { /* Block layer cannot split bios :( */ bio->bi_vcnt = i; - bio->bi_idx = 0; bio->bi_size = i * PAGE_SIZE; bio->bi_bdev = super->s_bdev; bio->bi_sector = ofs >> 9; @@ -136,7 +134,6 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index, unlock_page(page); } bio->bi_vcnt = nr_pages; - bio->bi_idx = 0; bio->bi_size = nr_pages * PAGE_SIZE; bio->bi_bdev = super->s_bdev; bio->bi_sector = ofs >> 9; @@ -202,7 +199,6 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index, if (i >= max_pages) { /* Block layer cannot split bios :( */ bio->bi_vcnt = i; - bio->bi_idx = 0; bio->bi_size = i * PAGE_SIZE; bio->bi_bdev = super->s_bdev; bio->bi_sector = ofs >> 9; @@ -224,7 +220,6 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index, bio->bi_io_vec[i].bv_offset = 0; } bio->bi_vcnt = nr_pages; - bio->bi_idx = 0; bio->bi_size = nr_pages * PAGE_SIZE; bio->bi_bdev = super->s_bdev; bio->bi_sector = ofs >> 9; diff --git a/mm/page_io.c b/mm/page_io.c index 78eee32..8d3c0c0 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -35,7 +35,6 @@ static struct bio *get_swap_bio(gfp_t gfp_flags, bio->bi_io_vec[0].bv_len = PAGE_SIZE; bio->bi_io_vec[0].bv_offset = 0; bio->bi_vcnt = 1; - bio->bi_idx = 0; bio->bi_size = PAGE_SIZE; bio->bi_end_io = end_io; }