diff options
author | Christoph Hellwig <hch@lst.de> | 2015-04-13 13:51:16 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-05-31 01:42:23 -0400 |
commit | 144bc4c2a42a0f42a32c106d53f5bf2724fbf098 (patch) | |
tree | 1b1a1a6b0dabea88e6dcef368305c6bac3c33648 /drivers/scsi/qla2xxx/tcm_qla2xxx.c | |
parent | e413f4727037e826c55a639c713a221006b6d61d (diff) |
target: move node ACL allocation to core code
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/scsi/qla2xxx/tcm_qla2xxx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/tcm_qla2xxx.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index a7ab689f5524..cb376e5198d0 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c | |||
@@ -338,29 +338,6 @@ static int tcm_qla2xxx_check_prot_fabric_only(struct se_portal_group *se_tpg) | |||
338 | return tpg->tpg_attrib.fabric_prot_type; | 338 | return tpg->tpg_attrib.fabric_prot_type; |
339 | } | 339 | } |
340 | 340 | ||
341 | static struct se_node_acl *tcm_qla2xxx_alloc_fabric_acl( | ||
342 | struct se_portal_group *se_tpg) | ||
343 | { | ||
344 | struct tcm_qla2xxx_nacl *nacl; | ||
345 | |||
346 | nacl = kzalloc(sizeof(struct tcm_qla2xxx_nacl), GFP_KERNEL); | ||
347 | if (!nacl) { | ||
348 | pr_err("Unable to allocate struct tcm_qla2xxx_nacl\n"); | ||
349 | return NULL; | ||
350 | } | ||
351 | |||
352 | return &nacl->se_node_acl; | ||
353 | } | ||
354 | |||
355 | static void tcm_qla2xxx_release_fabric_acl( | ||
356 | struct se_portal_group *se_tpg, | ||
357 | struct se_node_acl *se_nacl) | ||
358 | { | ||
359 | struct tcm_qla2xxx_nacl *nacl = container_of(se_nacl, | ||
360 | struct tcm_qla2xxx_nacl, se_node_acl); | ||
361 | kfree(nacl); | ||
362 | } | ||
363 | |||
364 | static u32 tcm_qla2xxx_tpg_get_inst_index(struct se_portal_group *se_tpg) | 341 | static u32 tcm_qla2xxx_tpg_get_inst_index(struct se_portal_group *se_tpg) |
365 | { | 342 | { |
366 | struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, | 343 | struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, |
@@ -1949,6 +1926,7 @@ static struct configfs_attribute *tcm_qla2xxx_wwn_attrs[] = { | |||
1949 | static const struct target_core_fabric_ops tcm_qla2xxx_ops = { | 1926 | static const struct target_core_fabric_ops tcm_qla2xxx_ops = { |
1950 | .module = THIS_MODULE, | 1927 | .module = THIS_MODULE, |
1951 | .name = "qla2xxx", | 1928 | .name = "qla2xxx", |
1929 | .node_acl_size = sizeof(struct tcm_qla2xxx_nacl), | ||
1952 | .get_fabric_name = tcm_qla2xxx_get_fabric_name, | 1930 | .get_fabric_name = tcm_qla2xxx_get_fabric_name, |
1953 | .get_fabric_proto_ident = tcm_qla2xxx_get_fabric_proto_ident, | 1931 | .get_fabric_proto_ident = tcm_qla2xxx_get_fabric_proto_ident, |
1954 | .tpg_get_wwn = tcm_qla2xxx_get_fabric_wwn, | 1932 | .tpg_get_wwn = tcm_qla2xxx_get_fabric_wwn, |
@@ -1964,8 +1942,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = { | |||
1964 | tcm_qla2xxx_check_prod_write_protect, | 1942 | tcm_qla2xxx_check_prod_write_protect, |
1965 | .tpg_check_prot_fabric_only = tcm_qla2xxx_check_prot_fabric_only, | 1943 | .tpg_check_prot_fabric_only = tcm_qla2xxx_check_prot_fabric_only, |
1966 | .tpg_check_demo_mode_login_only = tcm_qla2xxx_check_demo_mode_login_only, | 1944 | .tpg_check_demo_mode_login_only = tcm_qla2xxx_check_demo_mode_login_only, |
1967 | .tpg_alloc_fabric_acl = tcm_qla2xxx_alloc_fabric_acl, | ||
1968 | .tpg_release_fabric_acl = tcm_qla2xxx_release_fabric_acl, | ||
1969 | .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, | 1945 | .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, |
1970 | .check_stop_free = tcm_qla2xxx_check_stop_free, | 1946 | .check_stop_free = tcm_qla2xxx_check_stop_free, |
1971 | .release_cmd = tcm_qla2xxx_release_cmd, | 1947 | .release_cmd = tcm_qla2xxx_release_cmd, |
@@ -2001,6 +1977,7 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = { | |||
2001 | static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { | 1977 | static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { |
2002 | .module = THIS_MODULE, | 1978 | .module = THIS_MODULE, |
2003 | .name = "qla2xxx_npiv", | 1979 | .name = "qla2xxx_npiv", |
1980 | .node_acl_size = sizeof(struct tcm_qla2xxx_nacl), | ||
2004 | .get_fabric_name = tcm_qla2xxx_npiv_get_fabric_name, | 1981 | .get_fabric_name = tcm_qla2xxx_npiv_get_fabric_name, |
2005 | .get_fabric_proto_ident = tcm_qla2xxx_get_fabric_proto_ident, | 1982 | .get_fabric_proto_ident = tcm_qla2xxx_get_fabric_proto_ident, |
2006 | .tpg_get_wwn = tcm_qla2xxx_get_fabric_wwn, | 1983 | .tpg_get_wwn = tcm_qla2xxx_get_fabric_wwn, |
@@ -2014,8 +1991,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { | |||
2014 | .tpg_check_prod_mode_write_protect = | 1991 | .tpg_check_prod_mode_write_protect = |
2015 | tcm_qla2xxx_check_prod_write_protect, | 1992 | tcm_qla2xxx_check_prod_write_protect, |
2016 | .tpg_check_demo_mode_login_only = tcm_qla2xxx_check_demo_mode_login_only, | 1993 | .tpg_check_demo_mode_login_only = tcm_qla2xxx_check_demo_mode_login_only, |
2017 | .tpg_alloc_fabric_acl = tcm_qla2xxx_alloc_fabric_acl, | ||
2018 | .tpg_release_fabric_acl = tcm_qla2xxx_release_fabric_acl, | ||
2019 | .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, | 1994 | .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, |
2020 | .check_stop_free = tcm_qla2xxx_check_stop_free, | 1995 | .check_stop_free = tcm_qla2xxx_check_stop_free, |
2021 | .release_cmd = tcm_qla2xxx_release_cmd, | 1996 | .release_cmd = tcm_qla2xxx_release_cmd, |