I think sd_prep_fn is a generic function for any SCSI device while
scsi_prep_fn specifically SCSI Disks or LUN's, so if you have a filesystem
created on top of SCSI Disk scsi_prep_fn function will be called. In case
you have any other SCSI device then you will have sd_prep_fn will be called.
The comment on top of sd_probe mentions this:
/**
* sd_probe - called during driver initialization and whenever a
* new scsi device is attached to the system. It is called once
* for each scsi device (not just disks) present.
* @dev: pointer to device object
Similarly argument to scsi_alloc_sdev ( while internally calls
scsi_alloc_queue ---> blk_queue_prep_rq(q, scsi_prep_fn) ) accepts lun id
which I think is specific to SCSI LUN.
For understanding linux SCSI Subsystem you can also refer to kernel SCSI
documentation and also the below mentioned link:
http://www.andante.org/scsidoc/SCSI-1.htmlRegards,
Piyush Moghe