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_stat.c | |
parent | 4a5a75f32dcbcd0b2685f74fd4ede26edf8765a9 (diff) | |
download | op-kernel-dev-f2083241f23722207676025abbb45a301d412e69.zip op-kernel-dev-f2083241f23722207676025abbb45a301d412e69.tar.gz |
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_stat.c')
-rw-r--r-- | drivers/target/target_core_stat.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c index f8c2d2c..7ce1bfa5 100644 --- a/drivers/target/target_core_stat.c +++ b/drivers/target/target_core_stat.c @@ -1253,7 +1253,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_inst( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1279,7 +1279,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_dev( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1304,7 +1304,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_port( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1327,7 +1327,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_indx( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1349,7 +1349,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_dev_or_port( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1371,7 +1371,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_intr_name( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1393,7 +1393,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_map_indx( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1415,7 +1415,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_att_count( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1437,7 +1437,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_num_cmds( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1459,7 +1459,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_read_mbytes( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1481,7 +1481,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_write_mbytes( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1503,7 +1503,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_hs_num_cmds( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1525,7 +1525,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_creation_time( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1548,7 +1548,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_row_status( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1621,7 +1621,7 @@ static ssize_t target_stat_scsi_att_intr_port_show_attr_inst( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1647,7 +1647,7 @@ static ssize_t target_stat_scsi_att_intr_port_show_attr_dev( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1672,7 +1672,7 @@ static ssize_t target_stat_scsi_att_intr_port_show_attr_port( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; @@ -1721,7 +1721,7 @@ static ssize_t target_stat_scsi_att_intr_port_show_attr_port_auth_indx( ssize_t ret; spin_lock_irq(&nacl->device_list_lock); - deve = &nacl->device_list[lacl->mapped_lun]; + deve = nacl->device_list[lacl->mapped_lun]; if (!deve->se_lun || !deve->se_lun_acl) { spin_unlock_irq(&nacl->device_list_lock); return -ENODEV; |