]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/target/target_core_tpg.c
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
[karo-tx-linux.git] / drivers / target / target_core_tpg.c
index 0163309e2aba811d0a1e6e241f616aef6568d7f6..5192ac0337f736b150d7459847e38d8838e55c4c 100644 (file)
@@ -616,6 +616,29 @@ int core_tpg_set_initiator_node_queue_depth(
 }
 EXPORT_SYMBOL(core_tpg_set_initiator_node_queue_depth);
 
+/*     core_tpg_set_initiator_node_tag():
+ *
+ *     Initiator nodeacl tags are not used internally, but may be used by
+ *     userspace to emulate aliases or groups.
+ *     Returns length of newly-set tag or -EINVAL.
+ */
+int core_tpg_set_initiator_node_tag(
+       struct se_portal_group *tpg,
+       struct se_node_acl *acl,
+       const char *new_tag)
+{
+       if (strlen(new_tag) >= MAX_ACL_TAG_SIZE)
+               return -EINVAL;
+
+       if (!strncmp("NULL", new_tag, 4)) {
+               acl->acl_tag[0] = '\0';
+               return 0;
+       }
+
+       return snprintf(acl->acl_tag, MAX_ACL_TAG_SIZE, "%s", new_tag);
+}
+EXPORT_SYMBOL(core_tpg_set_initiator_node_tag);
+
 static int core_tpg_setup_virtual_lun0(struct se_portal_group *se_tpg)
 {
        /* Set in core_dev_setup_virtual_lun0() */