aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-05-31 00:14:26 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-05-31 00:14:26 -0400
commitd5b732b17ca2fc74f370bdba5aae6c804fac8c35 (patch)
tree4facc6d96116b032a3c1cb2ced9b2a3008e9216e /drivers/scsi/scsi_scan.c
parenteb6e8605ee5f5b4e116451bf01b3f35eac446dde (diff)
parent67a3e12b05e055c0415c556a315a3d3eb637e29e (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index c992ecf4e372..1c027a97d8b9 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -492,19 +492,20 @@ void scsi_target_reap(struct scsi_target *starget)
492 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 492 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
493 unsigned long flags; 493 unsigned long flags;
494 enum scsi_target_state state; 494 enum scsi_target_state state;
495 int empty; 495 int empty = 0;
496 496
497 spin_lock_irqsave(shost->host_lock, flags); 497 spin_lock_irqsave(shost->host_lock, flags);
498 state = starget->state; 498 state = starget->state;
499 empty = --starget->reap_ref == 0 && 499 if (--starget->reap_ref == 0 && list_empty(&starget->devices)) {
500 list_empty(&starget->devices) ? 1 : 0; 500 empty = 1;
501 starget->state = STARGET_DEL;
502 }
501 spin_unlock_irqrestore(shost->host_lock, flags); 503 spin_unlock_irqrestore(shost->host_lock, flags);
502 504
503 if (!empty) 505 if (!empty)
504 return; 506 return;
505 507
506 BUG_ON(state == STARGET_DEL); 508 BUG_ON(state == STARGET_DEL);
507 starget->state = STARGET_DEL;
508 if (state == STARGET_CREATED) 509 if (state == STARGET_CREATED)
509 scsi_target_destroy(starget); 510 scsi_target_destroy(starget);
510 else 511 else
@@ -1220,7 +1221,7 @@ static void scsi_sequential_lun_scan(struct scsi_target *starget,
1220} 1221}
1221 1222
1222/** 1223/**
1223 * scsilun_to_int: convert a scsi_lun to an int 1224 * scsilun_to_int - convert a scsi_lun to an int
1224 * @scsilun: struct scsi_lun to be converted. 1225 * @scsilun: struct scsi_lun to be converted.
1225 * 1226 *
1226 * Description: 1227 * Description:
@@ -1252,7 +1253,7 @@ int scsilun_to_int(struct scsi_lun *scsilun)
1252EXPORT_SYMBOL(scsilun_to_int); 1253EXPORT_SYMBOL(scsilun_to_int);
1253 1254
1254/** 1255/**
1255 * int_to_scsilun: reverts an int into a scsi_lun 1256 * int_to_scsilun - reverts an int into a scsi_lun
1256 * @lun: integer to be reverted 1257 * @lun: integer to be reverted
1257 * @scsilun: struct scsi_lun to be set. 1258 * @scsilun: struct scsi_lun to be set.
1258 * 1259 *
@@ -1876,12 +1877,9 @@ void scsi_forget_host(struct Scsi_Host *shost)
1876 spin_unlock_irqrestore(shost->host_lock, flags); 1877 spin_unlock_irqrestore(shost->host_lock, flags);
1877} 1878}
1878 1879
1879/* 1880/**
1880 * Function: scsi_get_host_dev() 1881 * scsi_get_host_dev - Create a scsi_device that points to the host adapter itself
1881 * 1882 * @shost: Host that needs a scsi_device
1882 * Purpose: Create a scsi_device that points to the host adapter itself.
1883 *
1884 * Arguments: SHpnt - Host that needs a scsi_device
1885 * 1883 *
1886 * Lock status: None assumed. 1884 * Lock status: None assumed.
1887 * 1885 *
@@ -1894,7 +1892,7 @@ void scsi_forget_host(struct Scsi_Host *shost)
1894 * 1892 *
1895 * Note - this device is not accessible from any high-level 1893 * Note - this device is not accessible from any high-level
1896 * drivers (including generics), which is probably not 1894 * drivers (including generics), which is probably not
1897 * optimal. We can add hooks later to attach 1895 * optimal. We can add hooks later to attach.
1898 */ 1896 */
1899struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost) 1897struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost)
1900{ 1898{
@@ -1920,18 +1918,13 @@ struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost)
1920} 1918}
1921EXPORT_SYMBOL(scsi_get_host_dev); 1919EXPORT_SYMBOL(scsi_get_host_dev);
1922 1920
1923/* 1921/**
1924 * Function: scsi_free_host_dev() 1922 * scsi_free_host_dev - Free a scsi_device that points to the host adapter itself
1925 * 1923 * @sdev: Host device to be freed
1926 * Purpose: Free a scsi_device that points to the host adapter itself.
1927 *
1928 * Arguments: SHpnt - Host that needs a scsi_device
1929 * 1924 *
1930 * Lock status: None assumed. 1925 * Lock status: None assumed.
1931 * 1926 *
1932 * Returns: Nothing 1927 * Returns: Nothing
1933 *
1934 * Notes:
1935 */ 1928 */
1936void scsi_free_host_dev(struct scsi_device *sdev) 1929void scsi_free_host_dev(struct scsi_device *sdev)
1937{ 1930{