[scsi 1/2] scsi device: add setters and getters for hostadat

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux