diff options
author | Andy Grover <agrover@redhat.com> | 2013-11-26 15:07:54 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-12-16 16:28:19 -0500 |
commit | d344f8a15637e8b57a0d05a6d50182c11de08606 (patch) | |
tree | e4dc624eec2f9e2e8794d865f8ab62153666a72a /drivers/target | |
parent | 2af7973a37059c92330014ee5f39adc94900e7e1 (diff) |
target: Rename core_tpg_{pre,post}_addlun for clarity
"pre" is really an allocation function. The only time it isn't called is
for virtual_lun0, which is statically allocated. Renaming that to "alloc"
lets the other function not need to be "post", and just be called
core_tpg_add_lun.
(nab: fix minor applying fuzz in core_tpg_setup_virtual_lun0)
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_device.c | 4 | ||||
-rw-r--r-- | drivers/target/target_core_internal.h | 4 | ||||
-rw-r--r-- | drivers/target/target_core_tpg.c | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 4b6b787d2c62..dbd78a176ddb 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c | |||
@@ -1117,11 +1117,11 @@ struct se_lun *core_dev_add_lun( | |||
1117 | struct se_lun *lun; | 1117 | struct se_lun *lun; |
1118 | int rc; | 1118 | int rc; |
1119 | 1119 | ||
1120 | lun = core_tpg_pre_addlun(tpg, unpacked_lun); | 1120 | lun = core_tpg_alloc_lun(tpg, unpacked_lun); |
1121 | if (IS_ERR(lun)) | 1121 | if (IS_ERR(lun)) |
1122 | return lun; | 1122 | return lun; |
1123 | 1123 | ||
1124 | rc = core_tpg_post_addlun(tpg, lun, | 1124 | rc = core_tpg_add_lun(tpg, lun, |
1125 | TRANSPORT_LUNFLAGS_READ_WRITE, dev); | 1125 | TRANSPORT_LUNFLAGS_READ_WRITE, dev); |
1126 | if (rc < 0) | 1126 | if (rc < 0) |
1127 | return ERR_PTR(rc); | 1127 | return ERR_PTR(rc); |
diff --git a/drivers/target/target_core_internal.h b/drivers/target/target_core_internal.h index 47b63b094cdc..f67e764a42bd 100644 --- a/drivers/target/target_core_internal.h +++ b/drivers/target/target_core_internal.h | |||
@@ -77,8 +77,8 @@ struct se_node_acl *__core_tpg_get_initiator_node_acl(struct se_portal_group *tp | |||
77 | const char *); | 77 | const char *); |
78 | void core_tpg_add_node_to_devs(struct se_node_acl *, struct se_portal_group *); | 78 | void core_tpg_add_node_to_devs(struct se_node_acl *, struct se_portal_group *); |
79 | void core_tpg_wait_for_nacl_pr_ref(struct se_node_acl *); | 79 | void core_tpg_wait_for_nacl_pr_ref(struct se_node_acl *); |
80 | struct se_lun *core_tpg_pre_addlun(struct se_portal_group *, u32); | 80 | struct se_lun *core_tpg_alloc_lun(struct se_portal_group *, u32); |
81 | int core_tpg_post_addlun(struct se_portal_group *, struct se_lun *, | 81 | int core_tpg_add_lun(struct se_portal_group *, struct se_lun *, |
82 | u32, void *); | 82 | u32, void *); |
83 | struct se_lun *core_tpg_pre_dellun(struct se_portal_group *, u32 unpacked_lun); | 83 | struct se_lun *core_tpg_pre_dellun(struct se_portal_group *, u32 unpacked_lun); |
84 | int core_tpg_post_dellun(struct se_portal_group *, struct se_lun *); | 84 | int core_tpg_post_dellun(struct se_portal_group *, struct se_lun *); |
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index f697f8baec54..a1dbc9488183 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c | |||
@@ -662,7 +662,7 @@ static int core_tpg_setup_virtual_lun0(struct se_portal_group *se_tpg) | |||
662 | if (ret < 0) | 662 | if (ret < 0) |
663 | return ret; | 663 | return ret; |
664 | 664 | ||
665 | ret = core_tpg_post_addlun(se_tpg, lun, lun_access, dev); | 665 | ret = core_tpg_add_lun(se_tpg, lun, lun_access, dev); |
666 | if (ret < 0) { | 666 | if (ret < 0) { |
667 | percpu_ref_cancel_init(&lun->lun_ref); | 667 | percpu_ref_cancel_init(&lun->lun_ref); |
668 | return ret; | 668 | return ret; |
@@ -789,7 +789,7 @@ int core_tpg_deregister(struct se_portal_group *se_tpg) | |||
789 | } | 789 | } |
790 | EXPORT_SYMBOL(core_tpg_deregister); | 790 | EXPORT_SYMBOL(core_tpg_deregister); |
791 | 791 | ||
792 | struct se_lun *core_tpg_pre_addlun( | 792 | struct se_lun *core_tpg_alloc_lun( |
793 | struct se_portal_group *tpg, | 793 | struct se_portal_group *tpg, |
794 | u32 unpacked_lun) | 794 | u32 unpacked_lun) |
795 | { | 795 | { |
@@ -819,7 +819,7 @@ struct se_lun *core_tpg_pre_addlun( | |||
819 | return lun; | 819 | return lun; |
820 | } | 820 | } |
821 | 821 | ||
822 | int core_tpg_post_addlun( | 822 | int core_tpg_add_lun( |
823 | struct se_portal_group *tpg, | 823 | struct se_portal_group *tpg, |
824 | struct se_lun *lun, | 824 | struct se_lun *lun, |
825 | u32 lun_access, | 825 | u32 lun_access, |