aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_ua.c
diff options
context:
space:
mode:
authorJörn Engel <joern@logfs.org>2012-03-15 15:05:40 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-03-15 22:15:51 -0400
commitf2083241f23722207676025abbb45a301d412e69 (patch)
treec340376faf2a1eebe0983075adee2a3c8070c064 /drivers/target/target_core_ua.c
parent4a5a75f32dcbcd0b2685f74fd4ede26edf8765a9 (diff)
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_ua.c')
-rw-r--r--drivers/target/target_core_ua.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/target/target_core_ua.c b/drivers/target/target_core_ua.c
index 3e12f6bcfa10..6666a0c74f60 100644
--- a/drivers/target/target_core_ua.c
+++ b/drivers/target/target_core_ua.c
@@ -53,7 +53,7 @@ int core_scsi3_ua_check(
53 if (!nacl) 53 if (!nacl)
54 return 0; 54 return 0;
55 55
56 deve = &nacl->device_list[cmd->orig_fe_lun]; 56 deve = nacl->device_list[cmd->orig_fe_lun];
57 if (!atomic_read(&deve->ua_count)) 57 if (!atomic_read(&deve->ua_count))
58 return 0; 58 return 0;
59 /* 59 /*
@@ -110,7 +110,7 @@ int core_scsi3_ua_allocate(
110 ua->ua_ascq = ascq; 110 ua->ua_ascq = ascq;
111 111
112 spin_lock_irq(&nacl->device_list_lock); 112 spin_lock_irq(&nacl->device_list_lock);
113 deve = &nacl->device_list[unpacked_lun]; 113 deve = nacl->device_list[unpacked_lun];
114 114
115 spin_lock(&deve->ua_lock); 115 spin_lock(&deve->ua_lock);
116 list_for_each_entry_safe(ua_p, ua_tmp, &deve->ua_list, ua_nacl_list) { 116 list_for_each_entry_safe(ua_p, ua_tmp, &deve->ua_list, ua_nacl_list) {
@@ -220,7 +220,7 @@ void core_scsi3_ua_for_check_condition(
220 return; 220 return;
221 221
222 spin_lock_irq(&nacl->device_list_lock); 222 spin_lock_irq(&nacl->device_list_lock);
223 deve = &nacl->device_list[cmd->orig_fe_lun]; 223 deve = nacl->device_list[cmd->orig_fe_lun];
224 if (!atomic_read(&deve->ua_count)) { 224 if (!atomic_read(&deve->ua_count)) {
225 spin_unlock_irq(&nacl->device_list_lock); 225 spin_unlock_irq(&nacl->device_list_lock);
226 return; 226 return;
@@ -289,7 +289,7 @@ int core_scsi3_ua_clear_for_request_sense(
289 return -EINVAL; 289 return -EINVAL;
290 290
291 spin_lock_irq(&nacl->device_list_lock); 291 spin_lock_irq(&nacl->device_list_lock);
292 deve = &nacl->device_list[cmd->orig_fe_lun]; 292 deve = nacl->device_list[cmd->orig_fe_lun];
293 if (!atomic_read(&deve->ua_count)) { 293 if (!atomic_read(&deve->ua_count)) {
294 spin_unlock_irq(&nacl->device_list_lock); 294 spin_unlock_irq(&nacl->device_list_lock);
295 return -EPERM; 295 return -EPERM;