aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_stat.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_stat.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_stat.c')
-rw-r--r--drivers/target/target_core_stat.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c
index f8c2d2cc3431..7ce1bfa5c542 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(
1253 ssize_t ret; 1253 ssize_t ret;
1254 1254
1255 spin_lock_irq(&nacl->device_list_lock); 1255 spin_lock_irq(&nacl->device_list_lock);
1256 deve = &nacl->device_list[lacl->mapped_lun]; 1256 deve = nacl->device_list[lacl->mapped_lun];
1257 if (!deve->se_lun || !deve->se_lun_acl) { 1257 if (!deve->se_lun || !deve->se_lun_acl) {
1258 spin_unlock_irq(&nacl->device_list_lock); 1258 spin_unlock_irq(&nacl->device_list_lock);
1259 return -ENODEV; 1259 return -ENODEV;
@@ -1279,7 +1279,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_dev(
1279 ssize_t ret; 1279 ssize_t ret;
1280 1280
1281 spin_lock_irq(&nacl->device_list_lock); 1281 spin_lock_irq(&nacl->device_list_lock);
1282 deve = &nacl->device_list[lacl->mapped_lun]; 1282 deve = nacl->device_list[lacl->mapped_lun];
1283 if (!deve->se_lun || !deve->se_lun_acl) { 1283 if (!deve->se_lun || !deve->se_lun_acl) {
1284 spin_unlock_irq(&nacl->device_list_lock); 1284 spin_unlock_irq(&nacl->device_list_lock);
1285 return -ENODEV; 1285 return -ENODEV;
@@ -1304,7 +1304,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_port(
1304 ssize_t ret; 1304 ssize_t ret;
1305 1305
1306 spin_lock_irq(&nacl->device_list_lock); 1306 spin_lock_irq(&nacl->device_list_lock);
1307 deve = &nacl->device_list[lacl->mapped_lun]; 1307 deve = nacl->device_list[lacl->mapped_lun];
1308 if (!deve->se_lun || !deve->se_lun_acl) { 1308 if (!deve->se_lun || !deve->se_lun_acl) {
1309 spin_unlock_irq(&nacl->device_list_lock); 1309 spin_unlock_irq(&nacl->device_list_lock);
1310 return -ENODEV; 1310 return -ENODEV;
@@ -1327,7 +1327,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_indx(
1327 ssize_t ret; 1327 ssize_t ret;
1328 1328
1329 spin_lock_irq(&nacl->device_list_lock); 1329 spin_lock_irq(&nacl->device_list_lock);
1330 deve = &nacl->device_list[lacl->mapped_lun]; 1330 deve = nacl->device_list[lacl->mapped_lun];
1331 if (!deve->se_lun || !deve->se_lun_acl) { 1331 if (!deve->se_lun || !deve->se_lun_acl) {
1332 spin_unlock_irq(&nacl->device_list_lock); 1332 spin_unlock_irq(&nacl->device_list_lock);
1333 return -ENODEV; 1333 return -ENODEV;
@@ -1349,7 +1349,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_dev_or_port(
1349 ssize_t ret; 1349 ssize_t ret;
1350 1350
1351 spin_lock_irq(&nacl->device_list_lock); 1351 spin_lock_irq(&nacl->device_list_lock);
1352 deve = &nacl->device_list[lacl->mapped_lun]; 1352 deve = nacl->device_list[lacl->mapped_lun];
1353 if (!deve->se_lun || !deve->se_lun_acl) { 1353 if (!deve->se_lun || !deve->se_lun_acl) {
1354 spin_unlock_irq(&nacl->device_list_lock); 1354 spin_unlock_irq(&nacl->device_list_lock);
1355 return -ENODEV; 1355 return -ENODEV;
@@ -1371,7 +1371,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_intr_name(
1371 ssize_t ret; 1371 ssize_t ret;
1372 1372
1373 spin_lock_irq(&nacl->device_list_lock); 1373 spin_lock_irq(&nacl->device_list_lock);
1374 deve = &nacl->device_list[lacl->mapped_lun]; 1374 deve = nacl->device_list[lacl->mapped_lun];
1375 if (!deve->se_lun || !deve->se_lun_acl) { 1375 if (!deve->se_lun || !deve->se_lun_acl) {
1376 spin_unlock_irq(&nacl->device_list_lock); 1376 spin_unlock_irq(&nacl->device_list_lock);
1377 return -ENODEV; 1377 return -ENODEV;
@@ -1393,7 +1393,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_map_indx(
1393 ssize_t ret; 1393 ssize_t ret;
1394 1394
1395 spin_lock_irq(&nacl->device_list_lock); 1395 spin_lock_irq(&nacl->device_list_lock);
1396 deve = &nacl->device_list[lacl->mapped_lun]; 1396 deve = nacl->device_list[lacl->mapped_lun];
1397 if (!deve->se_lun || !deve->se_lun_acl) { 1397 if (!deve->se_lun || !deve->se_lun_acl) {
1398 spin_unlock_irq(&nacl->device_list_lock); 1398 spin_unlock_irq(&nacl->device_list_lock);
1399 return -ENODEV; 1399 return -ENODEV;
@@ -1415,7 +1415,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_att_count(
1415 ssize_t ret; 1415 ssize_t ret;
1416 1416
1417 spin_lock_irq(&nacl->device_list_lock); 1417 spin_lock_irq(&nacl->device_list_lock);
1418 deve = &nacl->device_list[lacl->mapped_lun]; 1418 deve = nacl->device_list[lacl->mapped_lun];
1419 if (!deve->se_lun || !deve->se_lun_acl) { 1419 if (!deve->se_lun || !deve->se_lun_acl) {
1420 spin_unlock_irq(&nacl->device_list_lock); 1420 spin_unlock_irq(&nacl->device_list_lock);
1421 return -ENODEV; 1421 return -ENODEV;
@@ -1437,7 +1437,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_num_cmds(
1437 ssize_t ret; 1437 ssize_t ret;
1438 1438
1439 spin_lock_irq(&nacl->device_list_lock); 1439 spin_lock_irq(&nacl->device_list_lock);
1440 deve = &nacl->device_list[lacl->mapped_lun]; 1440 deve = nacl->device_list[lacl->mapped_lun];
1441 if (!deve->se_lun || !deve->se_lun_acl) { 1441 if (!deve->se_lun || !deve->se_lun_acl) {
1442 spin_unlock_irq(&nacl->device_list_lock); 1442 spin_unlock_irq(&nacl->device_list_lock);
1443 return -ENODEV; 1443 return -ENODEV;
@@ -1459,7 +1459,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_read_mbytes(
1459 ssize_t ret; 1459 ssize_t ret;
1460 1460
1461 spin_lock_irq(&nacl->device_list_lock); 1461 spin_lock_irq(&nacl->device_list_lock);
1462 deve = &nacl->device_list[lacl->mapped_lun]; 1462 deve = nacl->device_list[lacl->mapped_lun];
1463 if (!deve->se_lun || !deve->se_lun_acl) { 1463 if (!deve->se_lun || !deve->se_lun_acl) {
1464 spin_unlock_irq(&nacl->device_list_lock); 1464 spin_unlock_irq(&nacl->device_list_lock);
1465 return -ENODEV; 1465 return -ENODEV;
@@ -1481,7 +1481,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_write_mbytes(
1481 ssize_t ret; 1481 ssize_t ret;
1482 1482
1483 spin_lock_irq(&nacl->device_list_lock); 1483 spin_lock_irq(&nacl->device_list_lock);
1484 deve = &nacl->device_list[lacl->mapped_lun]; 1484 deve = nacl->device_list[lacl->mapped_lun];
1485 if (!deve->se_lun || !deve->se_lun_acl) { 1485 if (!deve->se_lun || !deve->se_lun_acl) {
1486 spin_unlock_irq(&nacl->device_list_lock); 1486 spin_unlock_irq(&nacl->device_list_lock);
1487 return -ENODEV; 1487 return -ENODEV;
@@ -1503,7 +1503,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_hs_num_cmds(
1503 ssize_t ret; 1503 ssize_t ret;
1504 1504
1505 spin_lock_irq(&nacl->device_list_lock); 1505 spin_lock_irq(&nacl->device_list_lock);
1506 deve = &nacl->device_list[lacl->mapped_lun]; 1506 deve = nacl->device_list[lacl->mapped_lun];
1507 if (!deve->se_lun || !deve->se_lun_acl) { 1507 if (!deve->se_lun || !deve->se_lun_acl) {
1508 spin_unlock_irq(&nacl->device_list_lock); 1508 spin_unlock_irq(&nacl->device_list_lock);
1509 return -ENODEV; 1509 return -ENODEV;
@@ -1525,7 +1525,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_creation_time(
1525 ssize_t ret; 1525 ssize_t ret;
1526 1526
1527 spin_lock_irq(&nacl->device_list_lock); 1527 spin_lock_irq(&nacl->device_list_lock);
1528 deve = &nacl->device_list[lacl->mapped_lun]; 1528 deve = nacl->device_list[lacl->mapped_lun];
1529 if (!deve->se_lun || !deve->se_lun_acl) { 1529 if (!deve->se_lun || !deve->se_lun_acl) {
1530 spin_unlock_irq(&nacl->device_list_lock); 1530 spin_unlock_irq(&nacl->device_list_lock);
1531 return -ENODEV; 1531 return -ENODEV;
@@ -1548,7 +1548,7 @@ static ssize_t target_stat_scsi_auth_intr_show_attr_row_status(
1548 ssize_t ret; 1548 ssize_t ret;
1549 1549
1550 spin_lock_irq(&nacl->device_list_lock); 1550 spin_lock_irq(&nacl->device_list_lock);
1551 deve = &nacl->device_list[lacl->mapped_lun]; 1551 deve = nacl->device_list[lacl->mapped_lun];
1552 if (!deve->se_lun || !deve->se_lun_acl) { 1552 if (!deve->se_lun || !deve->se_lun_acl) {
1553 spin_unlock_irq(&nacl->device_list_lock); 1553 spin_unlock_irq(&nacl->device_list_lock);
1554 return -ENODEV; 1554 return -ENODEV;
@@ -1621,7 +1621,7 @@ static ssize_t target_stat_scsi_att_intr_port_show_attr_inst(
1621 ssize_t ret; 1621 ssize_t ret;
1622 1622
1623 spin_lock_irq(&nacl->device_list_lock); 1623 spin_lock_irq(&nacl->device_list_lock);
1624 deve = &nacl->device_list[lacl->mapped_lun]; 1624 deve = nacl->device_list[lacl->mapped_lun];
1625 if (!deve->se_lun || !deve->se_lun_acl) { 1625 if (!deve->se_lun || !deve->se_lun_acl) {
1626 spin_unlock_irq(&nacl->device_list_lock); 1626 spin_unlock_irq(&nacl->device_list_lock);
1627 return -ENODEV; 1627 return -ENODEV;
@@ -1647,7 +1647,7 @@ static ssize_t target_stat_scsi_att_intr_port_show_attr_dev(
1647 ssize_t ret; 1647 ssize_t ret;
1648 1648
1649 spin_lock_irq(&nacl->device_list_lock); 1649 spin_lock_irq(&nacl->device_list_lock);
1650 deve = &nacl->device_list[lacl->mapped_lun]; 1650 deve = nacl->device_list[lacl->mapped_lun];
1651 if (!deve->se_lun || !deve->se_lun_acl) { 1651 if (!deve->se_lun || !deve->se_lun_acl) {
1652 spin_unlock_irq(&nacl->device_list_lock); 1652 spin_unlock_irq(&nacl->device_list_lock);
1653 return -ENODEV; 1653 return -ENODEV;
@@ -1672,7 +1672,7 @@ static ssize_t target_stat_scsi_att_intr_port_show_attr_port(
1672 ssize_t ret; 1672 ssize_t ret;
1673 1673
1674 spin_lock_irq(&nacl->device_list_lock); 1674 spin_lock_irq(&nacl->device_list_lock);
1675 deve = &nacl->device_list[lacl->mapped_lun]; 1675 deve = nacl->device_list[lacl->mapped_lun];
1676 if (!deve->se_lun || !deve->se_lun_acl) { 1676 if (!deve->se_lun || !deve->se_lun_acl) {
1677 spin_unlock_irq(&nacl->device_list_lock); 1677 spin_unlock_irq(&nacl->device_list_lock);
1678 return -ENODEV; 1678 return -ENODEV;
@@ -1721,7 +1721,7 @@ static ssize_t target_stat_scsi_att_intr_port_show_attr_port_auth_indx(
1721 ssize_t ret; 1721 ssize_t ret;
1722 1722
1723 spin_lock_irq(&nacl->device_list_lock); 1723 spin_lock_irq(&nacl->device_list_lock);
1724 deve = &nacl->device_list[lacl->mapped_lun]; 1724 deve = nacl->device_list[lacl->mapped_lun];
1725 if (!deve->se_lun || !deve->se_lun_acl) { 1725 if (!deve->se_lun || !deve->se_lun_acl) {
1726 spin_unlock_irq(&nacl->device_list_lock); 1726 spin_unlock_irq(&nacl->device_list_lock);
1727 return -ENODEV; 1727 return -ENODEV;