svn commit: r315937 - stable/10/sys/cam
Alexander Motin
mav at FreeBSD.org
Sat Mar 25 11:36:07 UTC 2017
Author: mav
Date: Sat Mar 25 11:36:06 2017
New Revision: 315937
URL: https://svnweb.freebsd.org/changeset/base/315937
Log:
MFC r315082: Allow XPT_GDEV_STATS for UNCONFIGURED devices.
Queue statistics has nothing to do with presence or absence of INQUIRY
data, etc. Target mode devices are never configured, but have queues.
Modified:
stable/10/sys/cam/cam_xpt.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cam/cam_xpt.c
==============================================================================
--- stable/10/sys/cam/cam_xpt.c Sat Mar 25 11:35:31 2017 (r315936)
+++ stable/10/sys/cam/cam_xpt.c Sat Mar 25 11:36:06 2017 (r315937)
@@ -2674,36 +2674,25 @@ call_sim:
}
case XPT_GDEV_STATS:
{
- struct cam_ed *dev;
+ struct ccb_getdevstats *cgds = &start_ccb->cgds;
+ struct cam_ed *dev = path->device;
+ struct cam_eb *bus = path->bus;
+ struct cam_et *tar = path->target;
+ struct cam_devq *devq = bus->sim->devq;
- dev = path->device;
- if ((dev->flags & CAM_DEV_UNCONFIGURED) != 0) {
- start_ccb->ccb_h.status = CAM_DEV_NOT_THERE;
- } else {
- struct ccb_getdevstats *cgds;
- struct cam_eb *bus;
- struct cam_et *tar;
- struct cam_devq *devq;
-
- cgds = &start_ccb->cgds;
- bus = path->bus;
- tar = path->target;
- devq = bus->sim->devq;
- mtx_lock(&devq->send_mtx);
- cgds->dev_openings = dev->ccbq.dev_openings;
- cgds->dev_active = dev->ccbq.dev_active;
- cgds->allocated = dev->ccbq.allocated;
- cgds->queued = cam_ccbq_pending_ccb_count(&dev->ccbq);
- cgds->held = cgds->allocated - cgds->dev_active -
- cgds->queued;
- cgds->last_reset = tar->last_reset;
- cgds->maxtags = dev->maxtags;
- cgds->mintags = dev->mintags;
- if (timevalcmp(&tar->last_reset, &bus->last_reset, <))
- cgds->last_reset = bus->last_reset;
- mtx_unlock(&devq->send_mtx);
- cgds->ccb_h.status = CAM_REQ_CMP;
- }
+ mtx_lock(&devq->send_mtx);
+ cgds->dev_openings = dev->ccbq.dev_openings;
+ cgds->dev_active = dev->ccbq.dev_active;
+ cgds->allocated = dev->ccbq.allocated;
+ cgds->queued = cam_ccbq_pending_ccb_count(&dev->ccbq);
+ cgds->held = cgds->allocated - cgds->dev_active - cgds->queued;
+ cgds->last_reset = tar->last_reset;
+ cgds->maxtags = dev->maxtags;
+ cgds->mintags = dev->mintags;
+ if (timevalcmp(&tar->last_reset, &bus->last_reset, <))
+ cgds->last_reset = bus->last_reset;
+ mtx_unlock(&devq->send_mtx);
+ cgds->ccb_h.status = CAM_REQ_CMP;
break;
}
case XPT_GDEVLIST:
More information about the svn-src-all
mailing list