Skip to contentSkip to conversation

query regarding command conversion

DISCUSSION Prashant Bhole 2 participants 2 messages Dec 15, 2009 SCSI

lore
Share & tools
lore
#0 lore raw

Hi,
I have a SATA disk which is represented by node /dev/sdb.
I opened that device using open_blk_excl() to perform IO from a kernel module. IO request is submitted using generic_make_request() which is in terms of struct bio.
As per my knowledge LLDs do not deal with struct bio.

My question is, where does the struct bio to struct scatterlist conversion takes place
before SCSI layer calls hostt->queuecommand()?

Thanks,

Signature · 1 line
~p~r~a~s~h~a~n~t~
#1 lore raw
Quoted 7 lines · Prashant Bhole

Hi,
I have a SATA disk which is represented by node /dev/sdb.
I opened that device using open_blk_excl() to perform IO from a kernel module. IO request is submitted using generic_make_request() which is in terms of struct bio.
As per my knowledge LLDs do not deal with struct bio.

Quoted 5 lines

My question is, where does the struct bio to struct scatterlist conversion takes place
before SCSI layer calls hostt->queuecommand()?

Thanks,

It is done in scsi_init_sgtable() scsi_lib.c. As part of scsi's prep_fn

Boaz