lkml.org 
[lkml]   [2014]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 07/14] scsi: convert host_busy to atomic_t
From
Date
>>>>> "Christoph" == Christoph Hellwig <hch@lst.de> writes:

Christoph> Avoid taking the host-wide host_lock to check the per-host
Christoph> queue limit. Instead we do an atomic_inc_return early on to
Christoph> grab our slot in the queue, and if nessecary decrement it
Christoph> after finishing all checks.

More nitpicking. In the two previous atomic conversion patches you kept
%hu for the atomic_t. Here it's %d.

+static ssize_t
+sdev_show_device_busy(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct scsi_device *sdev = to_scsi_device(dev);
+ return snprintf(buf, 20, "%d\n", atomic_read(&sdev->device_busy));
+}
+static DEVICE_ATTR(device_busy, S_IRUGO, sdev_show_device_busy, NULL);

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

--
Martin K. Petersen Oracle Linux Engineering


\
 
 \ /
  Last update: 2014-07-22 06:43    [W:0.161 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site