diff options
author | Andy Grover <agrover@redhat.com> | 2013-11-26 20:49:24 +0100 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-12-19 23:49:54 +0100 |
commit | de06875f089678f4f9f1e8d5e1421fb0ceab12d0 (patch) | |
tree | 20f4ce70000325ea696bad924bc8eed70e6134e1 /drivers | |
parent | target/file: Update hw_max_sectors based on current block_size (diff) | |
download | linux-de06875f089678f4f9f1e8d5e1421fb0ceab12d0.tar.xz linux-de06875f089678f4f9f1e8d5e1421fb0ceab12d0.zip |
target: Remove extra percpu_ref_init
lun->lun_ref is also initialized in core_tpg_post_addlun, so it doesn't
need to be done in core_tpg_setup_virtual_lun0.
(nab: Drop left-over percpu_ref_cancel_init in failure path)
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/target/target_core_tpg.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index f755712a9a0d..2a573de19a9f 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c @@ -656,15 +656,9 @@ static int core_tpg_setup_virtual_lun0(struct se_portal_group *se_tpg) spin_lock_init(&lun->lun_sep_lock); init_completion(&lun->lun_ref_comp); - ret = percpu_ref_init(&lun->lun_ref, core_tpg_lun_ref_release); - if (ret < 0) - return ret; - ret = core_tpg_post_addlun(se_tpg, lun, lun_access, dev); - if (ret < 0) { - percpu_ref_cancel_init(&lun->lun_ref); + if (ret < 0) return ret; - } return 0; } |