Merge tag 'for-linus-5.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / include / scsi / scsi_device.h
index 1a5c9a3..ac6ab16 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/blkdev.h>
 #include <scsi/scsi.h>
 #include <linux/atomic.h>
+#include <linux/sbitmap.h>
 
 struct device;
 struct request_queue;
@@ -106,7 +107,7 @@ struct scsi_device {
        struct list_head    siblings;   /* list of all devices on this host */
        struct list_head    same_target_siblings; /* just the devices sharing same target id */
 
-       atomic_t device_busy;           /* commands actually active on LLDD */
+       struct sbitmap budget_map;
        atomic_t device_blocked;        /* Device returned QUEUE_FULL. */
 
        atomic_t restarts;
@@ -145,7 +146,7 @@ struct scsi_device {
        struct scsi_vpd __rcu *vpd_pg80;
        struct scsi_vpd __rcu *vpd_pg89;
        unsigned char current_tag;      /* current tag */
-       struct scsi_target      *sdev_target;   /* used only for single_lun */
+       struct scsi_target      *sdev_target;
 
        blist_flags_t           sdev_bflags; /* black/white flags as also found in
                                 * scsi_devinfo.[hc]. For now used only to
@@ -590,6 +591,11 @@ static inline int scsi_device_supports_vpd(struct scsi_device *sdev)
        return 0;
 }
 
+static inline int scsi_device_busy(struct scsi_device *sdev)
+{
+       return sbitmap_weight(&sdev->budget_map);
+}
+
 #define MODULE_ALIAS_SCSI_DEVICE(type) \
        MODULE_ALIAS("scsi:t-" __stringify(type) "*")
 #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x"