diff options
author | Mike Christie | 2018-07-23 14:07:45 -0500 |
---|---|---|
committer | Martin K. Petersen | 2018-07-30 23:17:53 -0400 |
commit | cb0f32e12cded06e12ff19104eaf90c6f8310558 (patch) | |
tree | 132ce615f2e4130c54d6d12d6269c59d64264cce /include/target | |
parent | ff07e4a414d963d5b1ee1446f05a451e591256de (diff) |
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')
-rw-r--r-- | include/target/target_core_backend.h | 4 |
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) |