Re: [PATCH 1/5] block: add bio_map_sg

From: Christoph Hellwig
Date: Thu Oct 06 2011 - 09:40:52 EST


On Thu, Oct 06, 2011 at 12:51:39AM +0200, Boaz Harrosh wrote:
> I have some questions.
>
> - Could we later use this bio_map_sg() to implement blk_rq_map_sg() and
> remove some duplicated code?

I didn't even think about that, but it actually looks very possible
to factor the "meat" in the for each bvec loop into a common helper
used by both.

> - Don't you need to support a chained bio (bio->next != NULL)? Because
> I did not see any looping in the last patch
> [PATCH 5/5] virtio-blk: implement ->make_request
> Or is it that ->make_request() is a single bio at a time?
> If so could we benefit from both bio-chaining and sg-chaning to
> make bigger IOs?

At this point ->make_request is a single bio interface. I have some
WIP patches to do the onstack plugging per bio, at which point it would
change to take a list. For this to work we'd need major changes to
all ->make_request drivers.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/