diff options
author | Jörn Engel <joern@logfs.org> | 2012-03-15 15:05:12 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-03-15 22:15:38 -0400 |
commit | 4a5a75f32dcbcd0b2685f74fd4ede26edf8765a9 (patch) | |
tree | 9c05e0df5d2cfe06ed490ce763347f65aaf64c6a /drivers/target/target_core_device.c | |
parent | b168fe8cfe530daabbdf632af4554600006a81a9 (diff) |
target: Use array_zalloc for tpg_lun_list
Turns an order-10 allocation into slab-sized ones, thereby preventing
allocation failures with memory fragmentation.
This likely saves memory as well, as the slab allocator can pack objects
more tightly than the buddy allocator.
Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_device.c')
-rw-r--r-- | drivers/target/target_core_device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 5cfaa4b6da42..fd7f17c303a7 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c | |||
@@ -1429,7 +1429,7 @@ struct se_lun *core_get_lun_from_tpg(struct se_portal_group *tpg, u32 unpacked_l | |||
1429 | spin_unlock(&tpg->tpg_lun_lock); | 1429 | spin_unlock(&tpg->tpg_lun_lock); |
1430 | return NULL; | 1430 | return NULL; |
1431 | } | 1431 | } |
1432 | lun = &tpg->tpg_lun_list[unpacked_lun]; | 1432 | lun = tpg->tpg_lun_list[unpacked_lun]; |
1433 | 1433 | ||
1434 | if (lun->lun_status != TRANSPORT_LUN_STATUS_FREE) { | 1434 | if (lun->lun_status != TRANSPORT_LUN_STATUS_FREE) { |
1435 | pr_err("%s Logical Unit Number: %u is not free on" | 1435 | pr_err("%s Logical Unit Number: %u is not free on" |
@@ -1462,7 +1462,7 @@ static struct se_lun *core_dev_get_lun(struct se_portal_group *tpg, u32 unpacked | |||
1462 | spin_unlock(&tpg->tpg_lun_lock); | 1462 | spin_unlock(&tpg->tpg_lun_lock); |
1463 | return NULL; | 1463 | return NULL; |
1464 | } | 1464 | } |
1465 | lun = &tpg->tpg_lun_list[unpacked_lun]; | 1465 | lun = tpg->tpg_lun_list[unpacked_lun]; |
1466 | 1466 | ||
1467 | if (lun->lun_status != TRANSPORT_LUN_STATUS_ACTIVE) { | 1467 | if (lun->lun_status != TRANSPORT_LUN_STATUS_ACTIVE) { |
1468 | pr_err("%s Logical Unit Number: %u is not active on" | 1468 | pr_err("%s Logical Unit Number: %u is not active on" |