diff options
author | Jörn Engel <joern@logfs.org> | 2012-03-15 15:05:40 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-03-15 19:15:51 -0700 |
commit | f2083241f23722207676025abbb45a301d412e69 (patch) | |
tree | c340376faf2a1eebe0983075adee2a3c8070c064 /drivers/target/target_core_fabric_configfs.c | |
parent | 4a5a75f32dcbcd0b2685f74fd4ede26edf8765a9 (diff) | |
download | linux-f2083241f23722207676025abbb45a301d412e69.tar.bz2 |
target: Use array_zalloc for device_list
Turns an order-8 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.
(nab: Fix lio-core patch fuzz)
Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_fabric_configfs.c')
-rw-r--r-- | drivers/target/target_core_fabric_configfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index 9a2ce11e1a6e..405cc98eaed6 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c @@ -108,7 +108,7 @@ static int target_fabric_mappedlun_link( * tpg_1/attrib/demo_mode_write_protect=1 */ spin_lock_irq(&lacl->se_lun_nacl->device_list_lock); - deve = &lacl->se_lun_nacl->device_list[lacl->mapped_lun]; + deve = lacl->se_lun_nacl->device_list[lacl->mapped_lun]; if (deve->lun_flags & TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) lun_access = deve->lun_flags; else @@ -137,7 +137,7 @@ static int target_fabric_mappedlun_unlink( struct se_lun_acl *lacl = container_of(to_config_group(lun_acl_ci), struct se_lun_acl, se_lun_group); struct se_node_acl *nacl = lacl->se_lun_nacl; - struct se_dev_entry *deve = &nacl->device_list[lacl->mapped_lun]; + struct se_dev_entry *deve = nacl->device_list[lacl->mapped_lun]; struct se_portal_group *se_tpg; /* * Determine if the underlying MappedLUN has already been released.. @@ -168,7 +168,7 @@ static ssize_t target_fabric_mappedlun_show_write_protect( ssize_t len; spin_lock_irq(&se_nacl->device_list_lock); - deve = &se_nacl->device_list[lacl->mapped_lun]; + deve = se_nacl->device_list[lacl->mapped_lun]; len = sprintf(page, "%d\n", (deve->lun_flags & TRANSPORT_LUNFLAGS_READ_ONLY) ? 1 : 0); |