Skip to content

RFC use scatter lists for all block pc requests and simplify hw handlers

Mike Christie dm-devel linux-scsi 1 version In review

Get series with b4
b4 am 1117847972.23638.62.camel@mina

Versions newest first

  1. v1 RFC Latest4 patches 40 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4add blk_rq_map_kern functiondrivers/block/ll_rw_blk.c fs/bio.c include/linux/bio.h +1 more+125 -00 replies
2/4convert dm-emc to usr blk_rq_map_kerndrivers/md/dm-emc.c+56 -980 replies
3/4convert scsi-ioctl to use blk_rq_map_kerndrivers/block/scsi_ioctl.c+18 -100 replies
4/4update scsi-ml's scsi_init_iodrivers/scsi/scsi_lib.c+8 -130 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH RFC 0/4] use scatter lists for all block pc requests and simplify hw handlers

The following patches should enable the use of scatter lists for all REQ_BLOCK_PC requests and cleanup some code duplication or dangerous memory allocations in the dm-multipath hw handlers and block/scsi_ioctl.c.

REQ_BLOCK_PC scatter list usage only required converting the old sg_scsi_ioctl code to do bio backed requests since the current block layer SG_IO code will always use requests with bios. But while converting the old ioctl and removing some dangerous (GFP_KERNEL in failover path) memory allocations from a dm-multipath hw_handler (and while updating the LSI one) I was able to seperate some common code into two new functions: blk_rq_map_kern() and bio_map_kern. These functions are similar to their blk/bio*user cousins where they allocate requests and bios and setup the data pointers except they work on kernel buffers.

The goal is next convert the scsi 'special' requests to use these functions, so scsi will be able to use block layer functions for scatter lists setup for all requests. And then hopefully one day we will not need those stinking "if (sc->use_sg)" paths all over our scsi drivers.