summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-09-20 16:25:16 +0000
committerphk <phk@FreeBSD.org>2002-09-20 16:25:16 +0000
commitc0477d28f4c17fd9e0f6dec142347b99ea64bd67 (patch)
tree8c3907d27645d787f31cdb69dc7c8d0788d466d8 /sys/cam
parent207fb06f80b03b76ba9e573a376d32a7b8c6c731 (diff)
downloadFreeBSD-src-c0477d28f4c17fd9e0f6dec142347b99ea64bd67.zip
FreeBSD-src-c0477d28f4c17fd9e0f6dec142347b99ea64bd67.tar.gz
Don't use dkunit() to find out unit, we already have our softc pointer
where we can find it. Don't call dkpart() just to print the result, it is constant. Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_da.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 54fb5b5..bf77e70 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -500,14 +500,12 @@ daopen(dev_t dev, int flags __unused, int fmt __unused, struct thread *td __unus
struct scsi_read_capacity_data *rcap;
union ccb *ccb;
int unit;
- int part;
int error;
int s;
- unit = dkunit(dev);
- part = dkpart(dev);
s = splsoftcam();
periph = (struct cam_periph *)dev->si_drv1;
+ unit = periph->unit_number;
if (periph == NULL) {
splx(s);
return (ENXIO);
@@ -516,8 +514,8 @@ daopen(dev_t dev, int flags __unused, int fmt __unused, struct thread *td __unus
softc = (struct da_softc *)periph->softc;
CAM_DEBUG(periph->path, CAM_DEBUG_TRACE,
- ("daopen: dev=%s (unit %d , partition %d)\n", devtoname(dev),
- unit, part));
+ ("daopen: dev=%s (unit %d)\n", devtoname(dev),
+ unit));
if ((error = cam_periph_lock(periph, PRIBIO|PCATCH)) != 0)
return (error); /* error code from tsleep */
OpenPOWER on IntegriCloud