lkml.org 
[lkml]   [2012]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 07/26] block: Use bio_sectors() more consistently
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 <koverstreet@google.com>
> CC: Jens Axboe <axboe@kernel.dk>
> CC: "Ed L. Cashin" <ecashin@coraid.com>
> CC: Nick Piggin <npiggin@kernel.dk>
> CC: Jiri Kosina <jkosina@suse.cz>
> CC: Jim Paris <jim@jtan.com>
> CC: Geoff Levand <geoff@infradead.org>
> CC: Alasdair Kergon <agk@redhat.com>
> CC: dm-devel@redhat.com
> CC: Neil Brown <neilb@suse.de>
> CC: Steven Rostedt <rostedt@goodmis.org>
> ---
> 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



\
 
 \ /
  Last update: 2012-09-25 01:41    [from the cache]
©2003-2011 Jasper Spaans