summaryrefslogtreecommitdiff
path: root/include/target/target_core_backend.h
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2018-07-23 22:07:45 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2018-07-31 06:17:53 +0300
commitcb0f32e12cded06e12ff19104eaf90c6f8310558 (patch)
tree132ce615f2e4130c54d6d12d6269c59d64264cce /include/target/target_core_backend.h
parentff07e4a414d963d5b1ee1446f05a451e591256de (diff)
downloadlinux-cb0f32e12cded06e12ff19104eaf90c6f8310558.tar.xz
scsi: target: add helper to check if dev is configured
This just adds a helper function to check if a device is configured and it converts the target users to use it. The next patch will add a backend module user so those types of modules do not have to know the lio core details. Signed-off-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/target/target_core_backend.h')
-rw-r--r--include/target/target_core_backend.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index c3ac47255218..51b6f50eabee 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -111,6 +111,10 @@ sector_t target_to_linux_sector(struct se_device *dev, sector_t lb);
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
struct request_queue *q);
+static inline bool target_dev_configured(struct se_device *se_dev)
+{
+ return !!(se_dev->dev_flags & DF_CONFIGURED);
+}
/* Only use get_unaligned_be24() if reading p - 1 is allowed. */
static inline uint32_t get_unaligned_be24(const uint8_t *const p)