Add setters and getters for host data of scsi_device and scsi_target in spirit of dev_set/get_drvdata Cc: Christoph Hellwig <hch@xxxxxx> Cc: Douglas Gilbert <dgilbert@xxxxxxxxxxxx> Signed-off-by: Tomas Winkler <tomas.winkler@xxxxxxxxx> --- include/scsi/scsi_device.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index a4c9336811d1..fdf407e8bbed 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -532,6 +532,27 @@ static inline int scsi_device_tpgs(struct scsi_device *sdev) return sdev->inquiry ? (sdev->inquiry[5] >> 4) & 0x3 : 0; } +static inline void *scsi_device_get_hdata(struct scsi_device *sdev) +{ + return sdev->hostdata; +} + +static inline void scsi_device_set_hdata(struct scsi_device *sdev, void *hdata) +{ + sdev->hostdata = hdata; +} + +static inline void *scsi_target_get_hdata(struct scsi_target *starget) +{ + return starget->hostdata; +} + +static inline void scsi_target_set_hdata(struct scsi_target *starget, + void *hdata) +{ + starget->hostdata = hdata; +} + #define MODULE_ALIAS_SCSI_DEVICE(type) \ MODULE_ALIAS("scsi:t-" __stringify(type) "*") #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html