@@ -913,15 +913,6 @@ static int target_devices_idr_iter(int id, void *p, void *data)
struct devices_idr_iter *iter = data;
struct se_device *dev = p;
- /*
- * We add the device early to the idr, so it can be used
- * by backend modules during configuration. We do not want
- * to allow other callers to access partially setup devices,
- * so we skip them here.
- */
- if (!(dev->dev_flags & DF_CONFIGURED))
- return 0;
-
return iter->fn(dev, iter->data);
}
@@ -947,6 +938,7 @@ int target_for_each_device(int (*fn)(struct se_device *dev, void *data),
mutex_unlock(&device_mutex);
return ret;
}
+EXPORT_SYMBOL(target_for_each_device);
int target_configure_device(struct se_device *dev)
{
@@ -89,8 +89,6 @@ void core_dev_free_initiator_node_lun_acl(struct se_portal_group *,
struct se_device *target_alloc_device(struct se_hba *hba, const char *name);
int target_configure_device(struct se_device *dev);
void target_free_device(struct se_device *);
-int target_for_each_device(int (*fn)(struct se_device *dev, void *data),
- void *data);
/* target_core_configfs.c */
extern struct configfs_item_operations target_core_dev_item_ops;
@@ -67,6 +67,9 @@ static int target_xcopy_locate_se_dev_e4_iter(struct se_device *se_dev,
unsigned char tmp_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN];
int rc;
+ if (!(se_dev->dev_flags & DF_CONFIGURED))
+ return 0;
+
if (!se_dev->dev_attrib.emulate_3pc)
return 0;
@@ -109,6 +109,9 @@ sense_reason_t passthrough_parse_cdb(struct se_cmd *cmd,
struct se_device *target_find_device(int id, bool do_depend);
+int target_for_each_device(int (*fn)(struct se_device *dev, void *data),
+ void *data);
+
bool target_sense_desc_format(struct se_device *dev);
sector_t target_to_linux_sector(struct se_device *dev, sector_t lb);
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,