From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Paris Subject: Re: [PATCH v3 07/26] block: Use bio_sectors() more consistently Date: Mon, 24 Sep 2012 19:04:50 -0400 Message-ID: <20120924230449.GA2040@psychosis.jim.sh> References: <1348526106-17074-1-git-send-email-koverstreet@google.com> <1348526106-17074-8-git-send-email-koverstreet@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1348526106-17074-8-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> Sender: linux-bcache-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Kent Overstreet Cc: linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org, neilb-l3A5Bk7waGM@public.gmane.org, vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, "Ed L. Cashin" , Nick Piggin , Jiri Kosina , Geoff Levand , Alasdair Kergon , Steven Rostedt List-Id: dm-devel.ids Kent Overstreet wrote: > Bunch of places in the code weren't using it where they could be - > this'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx > into a struct bvec_iter. > > Signed-off-by: Kent Overstreet > CC: Jens Axboe > CC: "Ed L. Cashin" > CC: Nick Piggin > CC: Jiri Kosina > CC: Jim Paris > CC: Geoff Levand > CC: Alasdair Kergon > CC: dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org > CC: Neil Brown > CC: Steven Rostedt > --- > drivers/block/aoe/aoecmd.c | 2 +- > drivers/block/brd.c | 3 +-- > drivers/block/pktcdvd.c | 2 +- > drivers/block/ps3vram.c | 2 +- > drivers/md/dm-raid1.c | 2 +- > drivers/md/raid0.c | 6 +++--- > drivers/md/raid1.c | 17 ++++++++--------- > drivers/md/raid10.c | 24 +++++++++++------------- > drivers/md/raid5.c | 8 ++++---- > include/trace/events/block.h | 10 +++++----- > 10 files changed, 36 insertions(+), 40 deletions(-) ... > diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c > index f58cdcf..1ff38e8 100644 > --- a/drivers/block/ps3vram.c > +++ b/drivers/block/ps3vram.c > @@ -553,7 +553,7 @@ static struct bio *ps3vram_do_bio(struct ps3_system_bus_device *dev, > struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev); > int write = bio_data_dir(bio) == WRITE; > const char *op = write ? "write" : "read"; > - loff_t offset = bio->bi_sector << 9; > + loff_t offset = bio_sectors(bio); This doesn't look right to me: bio_sectors(bio) is (bio->bi_size>>9), not (bio->bi_sector<<9~)? -jim