target: move node ACL allocation to core code
authorChristoph Hellwig <hch@lst.de>
Mon, 13 Apr 2015 17:51:16 +0000 (19:51 +0200)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sun, 31 May 2015 05:42:23 +0000 (22:42 -0700)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
18 files changed:
Documentation/target/tcm_mod_builder.py
drivers/infiniband/ulp/srpt/ib_srpt.c
drivers/infiniband/ulp/srpt/ib_srpt.h
drivers/scsi/qla2xxx/tcm_qla2xxx.c
drivers/scsi/qla2xxx/tcm_qla2xxx.h
drivers/target/iscsi/iscsi_target_configfs.c
drivers/target/loopback/tcm_loop.c
drivers/target/sbp/sbp_target.c
drivers/target/target_core_configfs.c
drivers/target/target_core_tpg.c
drivers/target/target_core_transport.c
drivers/target/tcm_fc/tcm_fc.h
drivers/target/tcm_fc/tfc_conf.c
drivers/usb/gadget/legacy/tcm_usb_gadget.c
drivers/vhost/scsi.c
drivers/xen/xen-scsiback.c
include/target/iscsi/iscsi_target_core.h
include/target/target_core_fabric.h

index 3e54809b3aa107f38c3d3cbac813598a7b61db07..07e7ef3d742999f345bf7e1b32efd4c06e9e5484 100755 (executable)
@@ -313,8 +313,6 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
        buf += "        .tpg_check_demo_mode_cache      = " + fabric_mod_name + "_check_true,\n"
        buf += "        .tpg_check_demo_mode_write_protect = " + fabric_mod_name + "_check_true,\n"
        buf += "        .tpg_check_prod_mode_write_protect = " + fabric_mod_name + "_check_false,\n"
-       buf += "        .tpg_alloc_fabric_acl           = " + fabric_mod_name + "_alloc_fabric_acl,\n"
-       buf += "        .tpg_release_fabric_acl         = " + fabric_mod_name + "_release_fabric_acl,\n"
        buf += "        .tpg_get_inst_index             = " + fabric_mod_name + "_tpg_get_inst_index,\n"
        buf += "        .release_cmd                    = " + fabric_mod_name + "_release_cmd,\n"
        buf += "        .shutdown_session               = " + fabric_mod_name + "_shutdown_session,\n"
@@ -624,31 +622,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
                        bufi += "char *" + fabric_mod_name + "_parse_pr_out_transport_id(struct se_portal_group *,\n"
                        bufi += "                       const char *, u32 *, char **);\n"
 
-               if re.search('alloc_fabric_acl\)\(', fo):
-                       buf += "struct se_node_acl *" + fabric_mod_name + "_alloc_fabric_acl(struct se_portal_group *se_tpg)\n"
-                       buf += "{\n"
-                       buf += "        struct " + fabric_mod_name + "_nacl *nacl;\n\n"
-                       buf += "        nacl = kzalloc(sizeof(struct " + fabric_mod_name + "_nacl), GFP_KERNEL);\n"
-                       buf += "        if (!nacl) {\n"
-                       buf += "                printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_nacl\\n\");\n"
-                       buf += "                return NULL;\n"
-                       buf += "        }\n\n"
-                       buf += "        return &nacl->se_node_acl;\n"
-                       buf += "}\n\n"
-                       bufi += "struct se_node_acl *" + fabric_mod_name + "_alloc_fabric_acl(struct se_portal_group *);\n"
-
-               if re.search('release_fabric_acl\)\(', fo):
-                       buf += "void " + fabric_mod_name + "_release_fabric_acl(\n"
-                       buf += "        struct se_portal_group *se_tpg,\n"
-                       buf += "        struct se_node_acl *se_nacl)\n"
-                       buf += "{\n"
-                       buf += "        struct " + fabric_mod_name + "_nacl *nacl = container_of(se_nacl,\n"
-                       buf += "                        struct " + fabric_mod_name + "_nacl, se_node_acl);\n"
-                       buf += "        kfree(nacl);\n"
-                       buf += "}\n\n"
-                       bufi += "void " + fabric_mod_name + "_release_fabric_acl(struct se_portal_group *,\n"
-                       bufi += "                       struct se_node_acl *);\n"
-
                if re.search('tpg_get_inst_index\)\(', fo):
                        buf += "u32 " + fabric_mod_name + "_tpg_get_inst_index(struct se_portal_group *se_tpg)\n"
                        buf += "{\n"
index c1f3aa52f42b16300c28af3c23dc3a07d8f3b80b..38e51f4a17de7c72508a10b36eeac9d34e241f9e 100644 (file)
@@ -3447,28 +3447,6 @@ static char *srpt_parse_pr_out_transport_id(struct se_portal_group *se_tpg,
        return (char *)tr_id->i_port_id;
 }
 
-static struct se_node_acl *srpt_alloc_fabric_acl(struct se_portal_group *se_tpg)
-{
-       struct srpt_node_acl *nacl;
-
-       nacl = kzalloc(sizeof(struct srpt_node_acl), GFP_KERNEL);
-       if (!nacl) {
-               pr_err("Unable to allocate struct srpt_node_acl\n");
-               return NULL;
-       }
-
-       return &nacl->nacl;
-}
-
-static void srpt_release_fabric_acl(struct se_portal_group *se_tpg,
-                                   struct se_node_acl *se_nacl)
-{
-       struct srpt_node_acl *nacl;
-
-       nacl = container_of(se_nacl, struct srpt_node_acl, nacl);
-       kfree(nacl);
-}
-
 static u32 srpt_tpg_get_inst_index(struct se_portal_group *se_tpg)
 {
        return 1;
@@ -3883,6 +3861,7 @@ static struct configfs_attribute *srpt_wwn_attrs[] = {
 static const struct target_core_fabric_ops srpt_template = {
        .module                         = THIS_MODULE,
        .name                           = "srpt",
+       .node_acl_size                  = sizeof(struct srpt_node_acl),
        .get_fabric_name                = srpt_get_fabric_name,
        .get_fabric_proto_ident         = srpt_get_fabric_proto_ident,
        .tpg_get_wwn                    = srpt_get_fabric_wwn,
@@ -3894,8 +3873,6 @@ static const struct target_core_fabric_ops srpt_template = {
        .tpg_check_demo_mode_cache      = srpt_check_true,
        .tpg_check_demo_mode_write_protect = srpt_check_true,
        .tpg_check_prod_mode_write_protect = srpt_check_false,
-       .tpg_alloc_fabric_acl           = srpt_alloc_fabric_acl,
-       .tpg_release_fabric_acl         = srpt_release_fabric_acl,
        .tpg_get_inst_index             = srpt_tpg_get_inst_index,
        .release_cmd                    = srpt_release_cmd,
        .check_stop_free                = srpt_check_stop_free,
index 3dae156905de53c1f9e9c5f0717f4ef4c3729803..355f6f5ce8b2a10bde55e543d842c8a065a8c995 100644 (file)
@@ -410,15 +410,15 @@ struct srpt_device {
 
 /**
  * struct srpt_node_acl - Per-initiator ACL data (managed via configfs).
+ * @nacl:      Target core node ACL information.
  * @i_port_id: 128-bit SRP initiator port ID.
  * @sport:     port information.
- * @nacl:      Target core node ACL information.
  * @list:      Element of the per-HCA ACL list.
  */
 struct srpt_node_acl {
+       struct se_node_acl      nacl;
        u8                      i_port_id[16];
        struct srpt_port        *sport;
-       struct se_node_acl      nacl;
        struct list_head        list;
 };
 
index a7ab689f552479addb0af9509d161c2a81730d9c..cb376e5198d0ca418ef792b934b3fc61239510e3 100644 (file)
@@ -338,29 +338,6 @@ static int tcm_qla2xxx_check_prot_fabric_only(struct se_portal_group *se_tpg)
        return tpg->tpg_attrib.fabric_prot_type;
 }
 
-static struct se_node_acl *tcm_qla2xxx_alloc_fabric_acl(
-       struct se_portal_group *se_tpg)
-{
-       struct tcm_qla2xxx_nacl *nacl;
-
-       nacl = kzalloc(sizeof(struct tcm_qla2xxx_nacl), GFP_KERNEL);
-       if (!nacl) {
-               pr_err("Unable to allocate struct tcm_qla2xxx_nacl\n");
-               return NULL;
-       }
-
-       return &nacl->se_node_acl;
-}
-
-static void tcm_qla2xxx_release_fabric_acl(
-       struct se_portal_group *se_tpg,
-       struct se_node_acl *se_nacl)
-{
-       struct tcm_qla2xxx_nacl *nacl = container_of(se_nacl,
-                       struct tcm_qla2xxx_nacl, se_node_acl);
-       kfree(nacl);
-}
-
 static u32 tcm_qla2xxx_tpg_get_inst_index(struct se_portal_group *se_tpg)
 {
        struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg,
@@ -1949,6 +1926,7 @@ static struct configfs_attribute *tcm_qla2xxx_wwn_attrs[] = {
 static const struct target_core_fabric_ops tcm_qla2xxx_ops = {
        .module                         = THIS_MODULE,
        .name                           = "qla2xxx",
+       .node_acl_size                  = sizeof(struct tcm_qla2xxx_nacl),
        .get_fabric_name                = tcm_qla2xxx_get_fabric_name,
        .get_fabric_proto_ident         = tcm_qla2xxx_get_fabric_proto_ident,
        .tpg_get_wwn                    = tcm_qla2xxx_get_fabric_wwn,
@@ -1964,8 +1942,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = {
                                        tcm_qla2xxx_check_prod_write_protect,
        .tpg_check_prot_fabric_only     = tcm_qla2xxx_check_prot_fabric_only,
        .tpg_check_demo_mode_login_only = tcm_qla2xxx_check_demo_mode_login_only,
-       .tpg_alloc_fabric_acl           = tcm_qla2xxx_alloc_fabric_acl,
-       .tpg_release_fabric_acl         = tcm_qla2xxx_release_fabric_acl,
        .tpg_get_inst_index             = tcm_qla2xxx_tpg_get_inst_index,
        .check_stop_free                = tcm_qla2xxx_check_stop_free,
        .release_cmd                    = tcm_qla2xxx_release_cmd,
@@ -2001,6 +1977,7 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = {
 static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = {
        .module                         = THIS_MODULE,
        .name                           = "qla2xxx_npiv",
+       .node_acl_size                  = sizeof(struct tcm_qla2xxx_nacl),
        .get_fabric_name                = tcm_qla2xxx_npiv_get_fabric_name,
        .get_fabric_proto_ident         = tcm_qla2xxx_get_fabric_proto_ident,
        .tpg_get_wwn                    = tcm_qla2xxx_get_fabric_wwn,
@@ -2014,8 +1991,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = {
        .tpg_check_prod_mode_write_protect =
            tcm_qla2xxx_check_prod_write_protect,
        .tpg_check_demo_mode_login_only = tcm_qla2xxx_check_demo_mode_login_only,
-       .tpg_alloc_fabric_acl           = tcm_qla2xxx_alloc_fabric_acl,
-       .tpg_release_fabric_acl         = tcm_qla2xxx_release_fabric_acl,
        .tpg_get_inst_index             = tcm_qla2xxx_tpg_get_inst_index,
        .check_stop_free                = tcm_qla2xxx_check_stop_free,
        .release_cmd                    = tcm_qla2xxx_release_cmd,
index 23295115c9fc60d7ece0b7448e99fe31c2acf6cc..3d805a07061c17c6488fba8d20128b3760108b86 100644 (file)
@@ -13,6 +13,8 @@
 #include "qla_target.h"
 
 struct tcm_qla2xxx_nacl {
+       struct se_node_acl se_node_acl;
+
        /* From libfc struct fc_rport->port_id */
        u32 nport_id;
        /* Binary World Wide unique Node Name for remote FC Initiator Nport */
@@ -23,8 +25,6 @@ struct tcm_qla2xxx_nacl {
        struct qla_tgt_sess *qla_tgt_sess;
        /* Pointer to TCM FC nexus */
        struct se_session *nport_nexus;
-       /* Returned by tcm_qla2xxx_make_nodeacl() */
-       struct se_node_acl se_node_acl;
 };
 
 struct tcm_qla2xxx_tpg_attrib {
index 7d9ff8cbbb5d59f790e825bbf2c6868e03be4c46..643024c1ee8dce8470f9b643cc9634e7808a750a 100644 (file)
@@ -860,20 +860,6 @@ static struct configfs_attribute *lio_target_initiator_attrs[] = {
        NULL,
 };
 
-static struct se_node_acl *lio_tpg_alloc_fabric_acl(
-       struct se_portal_group *se_tpg)
-{
-       struct iscsi_node_acl *acl;
-
-       acl = kzalloc(sizeof(struct iscsi_node_acl), GFP_KERNEL);
-       if (!acl) {
-               pr_err("Unable to allocate memory for struct iscsi_node_acl\n");
-               return NULL;
-       }
-
-       return &acl->se_node_acl;
-}
-
 static int lio_target_init_nodeacl(struct se_node_acl *se_nacl,
                const char *name)
 {
@@ -1868,15 +1854,6 @@ static int lio_tpg_check_prot_fabric_only(
        return tpg->tpg_attrib.fabric_prot_type;
 }
 
-static void lio_tpg_release_fabric_acl(
-       struct se_portal_group *se_tpg,
-       struct se_node_acl *se_acl)
-{
-       struct iscsi_node_acl *acl = container_of(se_acl,
-                               struct iscsi_node_acl, se_node_acl);
-       kfree(acl);
-}
-
 /*
  * Called with spin_lock_bh(struct se_portal_group->session_lock) held..
  *
@@ -1952,6 +1929,7 @@ static void lio_release_cmd(struct se_cmd *se_cmd)
 const struct target_core_fabric_ops iscsi_ops = {
        .module                         = THIS_MODULE,
        .name                           = "iscsi",
+       .node_acl_size                  = sizeof(struct iscsi_node_acl),
        .get_fabric_name                = iscsi_get_fabric_name,
        .get_fabric_proto_ident         = iscsi_get_fabric_proto_ident,
        .tpg_get_wwn                    = lio_tpg_get_endpoint_wwn,
@@ -1967,8 +1945,6 @@ const struct target_core_fabric_ops iscsi_ops = {
        .tpg_check_prod_mode_write_protect =
                        lio_tpg_check_prod_mode_write_protect,
        .tpg_check_prot_fabric_only     = &lio_tpg_check_prot_fabric_only,
-       .tpg_alloc_fabric_acl           = lio_tpg_alloc_fabric_acl,
-       .tpg_release_fabric_acl         = lio_tpg_release_fabric_acl,
        .tpg_get_inst_index             = lio_tpg_get_inst_index,
        .check_stop_free                = lio_check_stop_free,
        .release_cmd                    = lio_release_cmd,
index 12b85b03e9ae0b0a78afb6e52e86d8968e5b3948..5a71c9f2ee66bd1a785715ff197fdd7e85ec3ba5 100644 (file)
@@ -698,19 +698,6 @@ static int tcm_loop_check_prot_fabric_only(struct se_portal_group *se_tpg)
        return tl_tpg->tl_fabric_prot_type;
 }
 
-static struct se_node_acl *tcm_loop_tpg_alloc_fabric_acl(
-       struct se_portal_group *se_tpg)
-{
-       return kzalloc(sizeof(struct se_node_acl), GFP_KERNEL);
-}
-
-static void tcm_loop_tpg_release_fabric_acl(
-       struct se_portal_group *se_tpg,
-       struct se_node_acl *se_nacl)
-{
-       kfree(se_nacl);
-}
-
 static u32 tcm_loop_get_inst_index(struct se_portal_group *se_tpg)
 {
        return 1;
@@ -1383,8 +1370,6 @@ static const struct target_core_fabric_ops loop_ops = {
        .tpg_check_prod_mode_write_protect =
                                tcm_loop_check_prod_mode_write_protect,
        .tpg_check_prot_fabric_only     = tcm_loop_check_prot_fabric_only,
-       .tpg_alloc_fabric_acl           = tcm_loop_tpg_alloc_fabric_acl,
-       .tpg_release_fabric_acl         = tcm_loop_tpg_release_fabric_acl,
        .tpg_get_inst_index             = tcm_loop_get_inst_index,
        .check_stop_free                = tcm_loop_check_stop_free,
        .release_cmd                    = tcm_loop_release_cmd,
index 3a47fe46fbca332af5be56ab4fa82de7f4096aaa..5df2a61714fb196cc4d0bc78d05a4edce0ae148d 100644 (file)
@@ -1707,18 +1707,6 @@ static u16 sbp_get_tag(struct se_portal_group *se_tpg)
        return tpg->tport_tpgt;
 }
 
-static struct se_node_acl *sbp_alloc_fabric_acl(struct se_portal_group *se_tpg)
-{
-       return kzalloc(sizeof(struct se_node_acl), GFP_KERNEL);
-}
-
-static void sbp_release_fabric_acl(
-       struct se_portal_group *se_tpg,
-       struct se_node_acl *se_nacl)
-{
-       kfree(se_nacl);
-}
-
 static u32 sbp_tpg_get_inst_index(struct se_portal_group *se_tpg)
 {
        return 1;
@@ -2465,8 +2453,6 @@ static const struct target_core_fabric_ops sbp_ops = {
        .tpg_check_demo_mode_cache      = sbp_check_true,
        .tpg_check_demo_mode_write_protect = sbp_check_false,
        .tpg_check_prod_mode_write_protect = sbp_check_false,
-       .tpg_alloc_fabric_acl           = sbp_alloc_fabric_acl,
-       .tpg_release_fabric_acl         = sbp_release_fabric_acl,
        .tpg_get_inst_index             = sbp_tpg_get_inst_index,
        .release_cmd                    = sbp_release_cmd,
        .shutdown_session               = sbp_shutdown_session,
index c87ca0c50545e03de35bd8e1e3084648d3aa70dc..2b10499264d3fce391c722d7eefe251b0383c3b8 100644 (file)
@@ -354,14 +354,6 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo)
                pr_err("Missing tfo->tpg_check_prod_mode_write_protect()\n");
                return -EINVAL;
        }
-       if (!tfo->tpg_alloc_fabric_acl) {
-               pr_err("Missing tfo->tpg_alloc_fabric_acl()\n");
-               return -EINVAL;
-       }
-       if (!tfo->tpg_release_fabric_acl) {
-               pr_err("Missing tfo->tpg_release_fabric_acl()\n");
-               return -EINVAL;
-       }
        if (!tfo->tpg_get_inst_index) {
                pr_err("Missing tfo->tpg_get_inst_index()\n");
                return -EINVAL;
index 0cd86ff9a7924553af1bc87bae94f7b28d81ff94..42f3bd9561c8c96864de5786a888283051d96e3b 100644 (file)
@@ -259,7 +259,8 @@ static struct se_node_acl *target_alloc_node_acl(struct se_portal_group *tpg,
 {
        struct se_node_acl *acl;
 
-       acl = tpg->se_tpg_tfo->tpg_alloc_fabric_acl(tpg);
+       acl = kzalloc(max(sizeof(*acl), tpg->se_tpg_tfo->node_acl_size),
+                       GFP_KERNEL);
        if (!acl)
                return NULL;
 
@@ -290,7 +291,7 @@ static struct se_node_acl *target_alloc_node_acl(struct se_portal_group *tpg,
 out_free_device_list:
        core_free_device_list_for_node(acl, tpg);
 out_free_acl:
-       tpg->se_tpg_tfo->tpg_release_fabric_acl(tpg, acl);
+       kfree(acl);
        return NULL;
 }
 
@@ -461,7 +462,7 @@ void core_tpg_del_initiator_node_acl(struct se_node_acl *acl)
                tpg->se_tpg_tfo->tpg_get_tag(tpg), acl->queue_depth,
                tpg->se_tpg_tfo->get_fabric_name(), acl->initiatorname);
 
-       tpg->se_tpg_tfo->tpg_release_fabric_acl(tpg, acl);
+       kfree(acl);
 }
 
 /*     core_tpg_set_initiator_node_queue_depth():
@@ -725,7 +726,7 @@ int core_tpg_deregister(struct se_portal_group *se_tpg)
 
                core_tpg_wait_for_nacl_pr_ref(nacl);
                core_free_device_list_for_node(nacl, se_tpg);
-               se_tpg->se_tpg_tfo->tpg_release_fabric_acl(se_tpg, nacl);
+               kfree(nacl);
 
                spin_lock_irq(&se_tpg->acl_node_lock);
        }
index 9dc1bd5f0e6b9ca63fbc164c8a9df76fb521465e..0fc4f5cb4bea920c15a4bec1a93cebb18d6fd496 100644 (file)
@@ -533,7 +533,7 @@ void transport_deregister_session(struct se_session *se_sess)
                        spin_unlock_irqrestore(&se_tpg->acl_node_lock, flags);
                        core_tpg_wait_for_nacl_pr_ref(se_nacl);
                        core_free_device_list_for_node(se_nacl, se_tpg);
-                       se_tfo->tpg_release_fabric_acl(se_tpg, se_nacl);
+                       kfree(se_nacl);
 
                        comp_nacl = false;
                        spin_lock_irqsave(&se_tpg->acl_node_lock, flags);
index 881deb3d499adc57e578ce9af9890953f9281f2a..4ceaeb9a4b93130e4de2939b4b8011efb10af517 100644 (file)
@@ -80,8 +80,8 @@ struct ft_node_auth {
  * Node ACL for FC remote port session.
  */
 struct ft_node_acl {
-       struct ft_node_auth node_auth;
        struct se_node_acl se_node_acl;
+       struct ft_node_auth node_auth;
 };
 
 struct ft_lun {
index e179fdf76ddb1e9fba8df638e9deb4e79be18d57..8da159352315f1f455aadbc53c1c394ff6d66871 100644 (file)
@@ -236,29 +236,6 @@ struct ft_node_acl *ft_acl_get(struct ft_tpg *tpg, struct fc_rport_priv *rdata)
        return found;
 }
 
-static struct se_node_acl *ft_tpg_alloc_fabric_acl(struct se_portal_group *se_tpg)
-{
-       struct ft_node_acl *acl;
-
-       acl = kzalloc(sizeof(*acl), GFP_KERNEL);
-       if (!acl) {
-               pr_err("Unable to allocate struct ft_node_acl\n");
-               return NULL;
-       }
-       pr_debug("acl %p\n", acl);
-       return &acl->se_node_acl;
-}
-
-static void ft_tpg_release_fabric_acl(struct se_portal_group *se_tpg,
-                                     struct se_node_acl *se_acl)
-{
-       struct ft_node_acl *acl = container_of(se_acl,
-                               struct ft_node_acl, se_node_acl);
-
-       pr_debug("acl %p\n", acl);
-       kfree(acl);
-}
-
 /*
  * local_port port_group (tpg) ops.
  */
@@ -474,6 +451,7 @@ static u32 ft_tpg_get_inst_index(struct se_portal_group *se_tpg)
 static const struct target_core_fabric_ops ft_fabric_ops = {
        .module =                       THIS_MODULE,
        .name =                         "fc",
+       .node_acl_size =                sizeof(struct ft_node_acl),
        .get_fabric_name =              ft_get_fabric_name,
        .get_fabric_proto_ident =       fc_get_fabric_proto_ident,
        .tpg_get_wwn =                  ft_get_fabric_wwn,
@@ -485,8 +463,6 @@ static const struct target_core_fabric_ops ft_fabric_ops = {
        .tpg_check_demo_mode_cache =    ft_check_false,
        .tpg_check_demo_mode_write_protect = ft_check_false,
        .tpg_check_prod_mode_write_protect = ft_check_false,
-       .tpg_alloc_fabric_acl =         ft_tpg_alloc_fabric_acl,
-       .tpg_release_fabric_acl =       ft_tpg_release_fabric_acl,
        .tpg_get_inst_index =           ft_tpg_get_inst_index,
        .check_stop_free =              ft_check_stop_free,
        .release_cmd =                  ft_release_cmd,
index fccb0ccb355a1ae46fe10939b43bc2b23887662e..82f4da8bfe416419bf0a5ec171ebc12848684a2b 100644 (file)
@@ -1373,18 +1373,6 @@ static char *usbg_parse_pr_out_transport_id(
        return tid;
 }
 
-static struct se_node_acl *usbg_alloc_fabric_acl(struct se_portal_group *se_tpg)
-{
-       return kzalloc(sizeof(struct se_node_acl), GFP_KERNEL);
-}
-
-static void usbg_release_fabric_acl(
-       struct se_portal_group *se_tpg,
-       struct se_node_acl *se_nacl)
-{
-       kfree(se_nacl);
-}
-
 static u32 usbg_tpg_get_inst_index(struct se_portal_group *se_tpg)
 {
        return 1;
@@ -1825,8 +1813,6 @@ static const struct target_core_fabric_ops usbg_ops = {
        .tpg_check_demo_mode_cache      = usbg_check_false,
        .tpg_check_demo_mode_write_protect = usbg_check_false,
        .tpg_check_prod_mode_write_protect = usbg_check_false,
-       .tpg_alloc_fabric_acl           = usbg_alloc_fabric_acl,
-       .tpg_release_fabric_acl         = usbg_release_fabric_acl,
        .tpg_get_inst_index             = usbg_tpg_get_inst_index,
        .release_cmd                    = usbg_release_cmd,
        .shutdown_session               = usbg_shutdown_session,
index 8faa7f4abf23f707825589b5458f671af8898591..b93c03935964df9f9968ef8efe430232c0219b41 100644 (file)
@@ -425,19 +425,6 @@ static int vhost_scsi_check_prot_fabric_only(struct se_portal_group *se_tpg)
        return tpg->tv_fabric_prot_type;
 }
 
-static struct se_node_acl *
-vhost_scsi_alloc_fabric_acl(struct se_portal_group *se_tpg)
-{
-       return kzalloc(sizeof(struct se_node_acl), GFP_KERNEL);
-}
-
-static void
-vhost_scsi_release_fabric_acl(struct se_portal_group *se_tpg,
-                            struct se_node_acl *se_nacl)
-{
-       kfree(se_nacl);
-}
-
 static u32 vhost_scsi_tpg_get_inst_index(struct se_portal_group *se_tpg)
 {
        return 1;
@@ -2268,8 +2255,6 @@ static struct target_core_fabric_ops vhost_scsi_ops = {
        .tpg_check_demo_mode_write_protect = vhost_scsi_check_false,
        .tpg_check_prod_mode_write_protect = vhost_scsi_check_false,
        .tpg_check_prot_fabric_only     = vhost_scsi_check_prot_fabric_only,
-       .tpg_alloc_fabric_acl           = vhost_scsi_alloc_fabric_acl,
-       .tpg_release_fabric_acl         = vhost_scsi_release_fabric_acl,
        .tpg_get_inst_index             = vhost_scsi_tpg_get_inst_index,
        .release_cmd                    = vhost_scsi_release_cmd,
        .check_stop_free                = vhost_scsi_check_stop_free,
index 8a130ab7173328f3af0452eddac3b001859f49f6..3756953b385bc0408ff92bce62cc56240ae01c23 100644 (file)
@@ -1449,19 +1449,6 @@ static void scsiback_drop_tport(struct se_wwn *wwn)
        kfree(tport);
 }
 
-static struct se_node_acl *
-scsiback_alloc_fabric_acl(struct se_portal_group *se_tpg)
-{
-       return kzalloc(sizeof(struct se_node_acl), GFP_KERNEL);
-}
-
-static void
-scsiback_release_fabric_acl(struct se_portal_group *se_tpg,
-                            struct se_node_acl *se_nacl)
-{
-       kfree(se_nacl);
-}
-
 static u32 scsiback_tpg_get_inst_index(struct se_portal_group *se_tpg)
 {
        return 1;
@@ -1952,8 +1939,6 @@ static const struct target_core_fabric_ops scsiback_ops = {
        .tpg_check_demo_mode_cache      = scsiback_check_true,
        .tpg_check_demo_mode_write_protect = scsiback_check_false,
        .tpg_check_prod_mode_write_protect = scsiback_check_false,
-       .tpg_alloc_fabric_acl           = scsiback_alloc_fabric_acl,
-       .tpg_release_fabric_acl         = scsiback_release_fabric_acl,
        .tpg_get_inst_index             = scsiback_tpg_get_inst_index,
        .check_stop_free                = scsiback_check_stop_free,
        .release_cmd                    = scsiback_release_cmd,
index 39f3d181d39d3f2339f700471bb825a07a30970a..f7b16ca67504dde421308fa007d7a9cdbd90e17c 100644 (file)
@@ -745,10 +745,10 @@ struct iscsi_node_stat_grps {
 };
 
 struct iscsi_node_acl {
+       struct se_node_acl      se_node_acl;
        struct iscsi_node_attrib node_attrib;
        struct iscsi_node_auth  node_auth;
        struct iscsi_node_stat_grps node_stat_grps;
-       struct se_node_acl      se_node_acl;
 };
 
 struct iscsi_tpg_attrib {
index 8b570c49f4d11c01f0d796d1e904d7c6a10e4dda..e5414744bf2d18e0c7eccbb34a30b1ca9731ccf2 100644 (file)
@@ -4,6 +4,7 @@
 struct target_core_fabric_ops {
        struct module *module;
        const char *name;
+       size_t node_acl_size;
        char *(*get_fabric_name)(void);
        u8 (*get_fabric_proto_ident)(struct se_portal_group *);
        char *(*tpg_get_wwn)(struct se_portal_group *);
@@ -36,10 +37,6 @@ struct target_core_fabric_ops {
         * WRITE_STRIP and READ_INSERT operations.
         */
        int (*tpg_check_prot_fabric_only)(struct se_portal_group *);
-       struct se_node_acl *(*tpg_alloc_fabric_acl)(
-                                       struct se_portal_group *);
-       void (*tpg_release_fabric_acl)(struct se_portal_group *,
-                                       struct se_node_acl *);
        u32 (*tpg_get_inst_index)(struct se_portal_group *);
        /*
         * Optional to release struct se_cmd and fabric dependent allocated