On 18/03/2026 08:01, Hannes Reinecke wrote:
}
+static inline
+blk_status_t scsi_alua_prep_fn(struct scsi_device *sdev, struct
request *req)
+{
+ return BLK_STS_OK;
+}
static inline int scsi_alua_sdev_init(struct scsi_device *sdev)
{
return 0;
Hmm. The 'prep_fn' thingie was implemented such that other drivers (like
scsi_dh) could intercept the scsi prep function and inject their own
stuff. But now with this patchset the functionality is in the scsi core,
so really we should do away with the prep_fn here and call the functions
directly.
ok, so I can just stop setting alua_dh.prep_fn and then have in
scsi_prepare_cmd():
if (sdev->handler && sdev->handler->prep_fn) {
blk_status_t ret = sdev->handler->prep_fn(sdev, req);
if (ret != BLK_STS_OK)
return ret;
} else if (sdev->alua) {
/* We should be able to make this common for ALUA DH as well */
blk_status_t ret = scsi_alua_prep_fn(sdev, req);
if (ret != BLK_STS_OK)
return ret;
}
Or even check sdev->alua first, as that is the most popular DH.
Thanks,
John