diff options
Diffstat (limited to 'drivers/target/target_core_tpg.c')
-rw-r--r-- | drivers/target/target_core_tpg.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index 0163309e2aba..5192ac0337f7 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c | |||
@@ -616,6 +616,29 @@ int core_tpg_set_initiator_node_queue_depth( | |||
616 | } | 616 | } |
617 | EXPORT_SYMBOL(core_tpg_set_initiator_node_queue_depth); | 617 | EXPORT_SYMBOL(core_tpg_set_initiator_node_queue_depth); |
618 | 618 | ||
619 | /* core_tpg_set_initiator_node_tag(): | ||
620 | * | ||
621 | * Initiator nodeacl tags are not used internally, but may be used by | ||
622 | * userspace to emulate aliases or groups. | ||
623 | * Returns length of newly-set tag or -EINVAL. | ||
624 | */ | ||
625 | int core_tpg_set_initiator_node_tag( | ||
626 | struct se_portal_group *tpg, | ||
627 | struct se_node_acl *acl, | ||
628 | const char *new_tag) | ||
629 | { | ||
630 | if (strlen(new_tag) >= MAX_ACL_TAG_SIZE) | ||
631 | return -EINVAL; | ||
632 | |||
633 | if (!strncmp("NULL", new_tag, 4)) { | ||
634 | acl->acl_tag[0] = '\0'; | ||
635 | return 0; | ||
636 | } | ||
637 | |||
638 | return snprintf(acl->acl_tag, MAX_ACL_TAG_SIZE, "%s", new_tag); | ||
639 | } | ||
640 | EXPORT_SYMBOL(core_tpg_set_initiator_node_tag); | ||
641 | |||
619 | static int core_tpg_setup_virtual_lun0(struct se_portal_group *se_tpg) | 642 | static int core_tpg_setup_virtual_lun0(struct se_portal_group *se_tpg) |
620 | { | 643 | { |
621 | /* Set in core_dev_setup_virtual_lun0() */ | 644 | /* Set in core_dev_setup_virtual_lun0() */ |