Skip to contentSkip to conversation

: Updates for v2.6.31-rc

PATCH New Nicholas A. Bellinger 1 participant 1 message Aug 8, 2009 SCSI

lore
Share & tools
lore
#0 lore raw

cover : Updates for v2.6.31-rc

Greetings,

The following are patches for v2.6.31-rc5 to get the TCM/pSCSI subsystem plugin running again.

The first patch converts TCM/pSCSI to use the new blk_make_request() (Thanks Boaz!) to map physical memory (struct page) -> struct bio -> struct request for SCF_SCSI_DATA_SG_IO_CDB type I/O. This is done by using bio_kmalloc() to obtain struct bio, and each struct page is set using bio_add_pg_page() in pscsi_map_task_SG(). If the received CDB's payload exceeds BIO_MAX_PAGES, bio_kmalloc() will be called again and the bios will be chained together before calling blk_make_request() and pscsi_blk_init_request() to complete initialization of the struct request.

The second patch removes a call to dev_get_drvdata() for TYPE_ROM that previously had been obtaining struct scsi_cd to access struct gendisk for passing into blk_execute_rq_nowait(). This had been causing an OOPs on v2.6.31-rc5 with physical TYPE_ROM, so it has been removed and blk_execute_rq_nowait() seems to work fine w/o the struct gendisk pointer for TYPE_ROM.

Boaz and co, any comments you can make on the blk_make_request() usage in Patch 1 is greatly apperciated.

--nab

[PATCH 1/2] [Target_Core_Mod/pSCSI]: Use blk_make_request() in v2.6.31-rc
[PATCH 2/2] [Target_Core_Mod/pSCSI]: Fix bug with struct scsi_cd access for blk_execute_rq_nowait()

 drivers/target/target_core_pscsi.c |  134 ++++++++++++++++++++++-------------
 1 files changed, 84 insertions(+), 50 deletions(-)