> +/* > + * Returns a negative value if @_a has a lower LBA than @_b, zero if > + * both have the same LBA and a positive value otherwise. > + */ > +static int scsi_cmp_lba(void *priv, const struct list_head *_a, > + const struct list_head *_b) > +{ > + struct scsi_cmnd *a = list_entry(_a, typeof(*a), eh_entry); > + struct scsi_cmnd *b = list_entry(_b, typeof(*b), eh_entry); > + const sector_t pos_a = blk_rq_pos(scsi_cmd_to_rq(a)); > + const sector_t pos_b = blk_rq_pos(scsi_cmd_to_rq(b)); The SCSI core has no concept of LBAs. Even assuming something like this is a good idea (and I'm very doubtful) it would have to live in sd.c.