From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 10:06:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BF8505ED; Thu, 18 Apr 2013 10:06:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B16AB9DB; Thu, 18 Apr 2013 10:06:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IA6rJY001231; Thu, 18 Apr 2013 10:06:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IA6qHu001227; Thu, 18 Apr 2013 10:06:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181006.r3IA6qHu001227@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249615 - in stable/9/sys/cam: ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:06:53 -0000 Author: mav Date: Thu Apr 18 10:06:52 2013 New Revision: 249615 URL: http://svnweb.freebsd.org/changeset/base/249615 Log: MFC r249106: Replace some direct mutex operations with wrappers. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_pass.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/ata/ata_da.c Thu Apr 18 10:06:52 2013 (r249615) @@ -1104,7 +1104,7 @@ adaregister(struct cam_periph *periph, v * Register this media as a disk */ (void)cam_periph_hold(periph, PRIBIO); - mtx_unlock(periph->sim->mtx); + cam_periph_unlock(periph); snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.quirks", periph->unit_number); quirks = softc->quirks; @@ -1195,7 +1195,7 @@ adaregister(struct cam_periph *periph, v } else legacy_id = -1; disk_create(softc->disk, DISK_VERSION); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); cam_periph_unhold(periph); dp = &softc->params; Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/scsi/scsi_cd.c Thu Apr 18 10:06:52 2013 (r249615) @@ -1446,7 +1446,7 @@ cdgetccb(struct cam_periph *periph, u_in softc->changer->flags |= CHANGER_MANUAL_CALL; cdrunchangerqueue(softc->changer); } else - msleep(&softc->changer, periph->sim->mtx, + cam_periph_sleep(periph, &softc->changer, PRIBIO, "cgticb", 0); } } Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 10:06:52 2013 (r249615) @@ -985,7 +985,7 @@ daopen(struct disk *dp) dareprobe(periph); /* Wait for the disk size update. */ - error = msleep(&softc->disk->d_mediasize, periph->sim->mtx, PRIBIO, + error = cam_periph_sleep(periph, &softc->disk->d_mediasize, PRIBIO, "dareprobe", 0); if (error != 0) xpt_print(periph->path, "unable to retrieve capacity data"); @@ -1676,7 +1676,7 @@ daregister(struct cam_periph *periph, vo (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); - mtx_unlock(periph->sim->mtx); + cam_periph_unlock(periph); /* * RBC devices don't have to support READ(6), only READ(10). */ @@ -1759,12 +1759,12 @@ daregister(struct cam_periph *periph, vo if (cam_periph_acquire(periph) != CAM_REQ_CMP) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); return (CAM_REQ_CMP_ERR); } disk_create(softc->disk, DISK_VERSION); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); /* * Add async callbacks for events of interest. Modified: stable/9/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pass.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/scsi/scsi_pass.c Thu Apr 18 10:06:52 2013 (r249615) @@ -381,7 +381,7 @@ passregister(struct cam_periph *periph, * know what the blocksize of this device is, if * it even has a blocksize. */ - mtx_unlock(periph->sim->mtx); + cam_periph_unlock(periph); no_tags = (cgd->inq_data.flags & SID_CmdQue) == 0; softc->device_stats = devstat_new_entry("pass", periph->unit_number, 0, @@ -417,7 +417,7 @@ passregister(struct cam_periph *periph, */ dev_ref(softc->dev); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); softc->dev->si_drv1 = periph; TASK_INIT(&softc->add_physpath_task, /*priority*/0,