Skip to content

osd: Stop usage of blk_rq_append_bio

Boaz Harrosh linux-scsi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5allow blk_rq_map_kern to append to requestsblock/blk-map.c+10 -20 replies
2/5libosd: Use new blk_rq_map_kerndrivers/scsi/osd/osd_initiator.c+2 -220 replies
3/5New blk_make_request(), takes bio, returns a requestblock/blk-core.c include/linux/blkdev.h+47 -08 replies
4/5libosd: Use of new blk_make_requestdrivers/scsi/osd/osd_initiator.c+23 -250 replies
5/5Un-export blk_rq_append_bioblock/blk-map.c block/blk.h include/linux/blkdev.h+2 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patchset 0/5 version 2] osd: Stop usage of blk_rq_append_bio

[Version 2]
- Update to axboe/linux-2.6-block.git for-2.6.31 branch
- Added 5th patch that removes the export of blk_rq_append_bio()

[Version 1]
Osd library needs to submit pre-allocated bios, form several sources. osdblk exofs and pNFS-layout driver all have prepared bios for IO submission. On top of that the osd library needs to append additional segments to the IO memory, for get/set attributes and more.

All these are done today by use of a temporary hack - blk_rq_append_bio(). This is bad on few accounts.
1. blk_rq_append_bio was not meant to be exported and is very specific to its users.
2. blk_rq_append_bio does not support chained bios.
3. blk_rq_append_bio does not bounce the bio and therefore current osd implementation has a bug.

The proposed solution adds two new fixtures to the block layer, and a corresponding fixing patch to osd. These are:

[PATCH 1/5] allow blk_rq_map_kern to append to requests [PATCH 2/5] libosd: Use new blk_rq_map_kern

This is originally a James patch. It is used, to let blk_rq_map_kern append it's buffer to existing bio, and therefor is able to be called multiple times in a loop, to append multiple segments. This API can also be useful for scsi/block targets that have segment information in some other memory structure (like scatterlist) and wants to set it into a request. Until such time that they have a proper support for mapping scatterlists directly. (Above called on long lists might not be good for performance)

Here in osd it makes tons of sense.

[PATCH 3/5] New blk_make_request(), takes bio, returns a request [PATCH 4/5] libosd: Use of new blk_make_request

Here I propose a new block API, that will support proper delegation of a bio
to a full request. Please read inside the patch descriptions for details.
After this patch both osd and block layer will have the proper support for osdblk driver as well as future needs.
These patches also eliminate the last use of blk_rq_append_bio which can be finally un-exported.

[PATCH 5/5] Un-export blk_rq_append_bio

Thank you
Boaz