From owner-p4-projects@FreeBSD.ORG Fri Mar 23 21:31:56 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C1D7516A404; Fri, 23 Mar 2007 21:31:55 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63FE816A402 for ; Fri, 23 Mar 2007 21:31:55 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 48FE513C45E for ; Fri, 23 Mar 2007 21:31:55 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l2NLVtmt085553 for ; Fri, 23 Mar 2007 21:31:55 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l2NLVsJl085546 for perforce@freebsd.org; Fri, 23 Mar 2007 21:31:54 GMT (envelope-from scottl@freebsd.org) Date: Fri, 23 Mar 2007 21:31:54 GMT Message-Id: <200703232131.l2NLVsJl085546@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 116449 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2007 21:31:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=116449 Change 116449 by scottl@scottl-x64 on 2007/03/23 21:31:19 Remove CAM_PERIPH_LOCK/UNLOCK. These were redundant with their functional equivalents. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/cam_periph.h#10 edit .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_da.c#24 edit .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_pass.c#18 edit .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_sa.c#10 edit .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_ses.c#11 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/cam_periph.h#10 (text+ko) ==== @@ -126,9 +126,6 @@ #define CAM_PERIPH_MAXMAPS 2 -#define CAM_PERIPH_LOCK(periph) mtx_lock((periph)->sim->mtx) -#define CAM_PERIPH_UNLOCK(periph) mtx_unlock((periph)->sim->mtx) - struct cam_periph_map_info { int num_bufs_used; struct buf *bp[CAM_PERIPH_MAXMAPS]; ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_da.c#24 (text+ko) ==== @@ -716,7 +716,7 @@ } softc = (struct da_softc *)periph->softc; - CAM_PERIPH_LOCK(periph); + cam_periph_lock(periph); #if 0 /* @@ -737,7 +737,7 @@ */ if ((softc->flags & DA_FLAG_PACK_INVALID)) { splx(s); - CAM_PERIPH_UNLOCK(periph); + cam_periph_unlock(periph); biofinish(bp, NULL, ENXIO); return; } @@ -753,7 +753,7 @@ * Schedule ourselves for performing the work. */ xpt_schedule(periph, /* XXX priority */1); - CAM_PERIPH_UNLOCK(periph); + cam_periph_lock(periph); return; } ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_pass.c#18 (text+ko) ==== @@ -459,7 +459,7 @@ if (periph == NULL) return(ENXIO); - CAM_PERIPH_LOCK(periph); + cam_periph_lock(periph); softc = (struct pass_softc *)periph->softc; error = 0; @@ -526,7 +526,7 @@ break; } - CAM_PERIPH_UNLOCK(periph); + cam_periph_lock(periph); return(error); } ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_sa.c#10 (text+ko) ==== ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_ses.c#11 (text+ko) ==== @@ -533,17 +533,17 @@ CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering sesioctl\n")); - CAM_PERIPH_LOCK(periph); + cam_periph_lock(periph); ssc = (struct ses_softc *)periph->softc; /* * Now check to see whether we're initialized or not. */ if ((ssc->ses_flags & SES_FLAG_INITIALIZED) == 0) { - CAM_PERIPH_UNLOCK(periph); + cam_periph_unlock(periph); return (ENXIO); } - CAM_PERIPH_UNLOCK(periph); + cam_periph_lock(periph); error = 0; @@ -577,30 +577,30 @@ * XXX Dropping the lock while copying multiple segments is * bogus. */ - CAM_PERIPH_LOCK(periph); + cam_periph_lock(periph); for (uobj = addr, i = 0; i != ssc->ses_nobjects; i++, uobj++) { obj.obj_id = i; obj.subencid = ssc->ses_objmap[i].subenclosure; obj.object_type = ssc->ses_objmap[i].enctype; - CAM_PERIPH_UNLOCK(periph); + cam_periph_lock(periph); error = copyout(&obj, uobj, sizeof (ses_object)); - CAM_PERIPH_LOCK(periph); + cam_periph_lock(periph); if (error) { break; } } - CAM_PERIPH_UNLOCK(periph); + cam_periph_lock(periph); break; case SESIOC_GETENCSTAT: - CAM_PERIPH_LOCK(periph); + cam_periph_lock(periph); error = (*ssc->ses_vec.get_encstat)(ssc, 1); if (error) { - CAM_PERIPH_UNLOCK(periph); + cam_periph_unlock(periph); break; } tmp = ssc->ses_encstat & ~ENCI_SVALID; - CAM_PERIPH_UNLOCK(periph); + cam_periph_unlock(periph); error = copyout(&tmp, addr, sizeof (ses_encstat)); ssc->ses_encstat = tmp; break; @@ -609,9 +609,9 @@ error = copyin(addr, &tmp, sizeof (ses_encstat)); if (error) break; - CAM_PERIPH_LOCK(periph); + cam_periph_lock(periph); error = (*ssc->ses_vec.set_encstat)(ssc, tmp, 1); - CAM_PERIPH_UNLOCK(periph); + cam_periph_unlock(periph); break; case SESIOC_GETOBJSTAT: @@ -622,9 +622,9 @@ error = EINVAL; break; } - CAM_PERIPH_LOCK(periph); + cam_periph_lock(periph); error = (*ssc->ses_vec.get_objstat)(ssc, &objs, 1); - CAM_PERIPH_UNLOCK(periph); + cam_periph_unlock(periph); if (error) break; error = copyout(&objs, addr, sizeof (ses_objstat)); @@ -643,9 +643,9 @@ error = EINVAL; break; } - CAM_PERIPH_LOCK(periph); + cam_periph_lock(periph); error = (*ssc->ses_vec.set_objstat)(ssc, &objs, 1); - CAM_PERIPH_UNLOCK(periph); + cam_periph_unlock(periph); /* * Always (for now) invalidate entry. @@ -655,15 +655,15 @@ case SESIOC_INIT: - CAM_PERIPH_LOCK(periph); + cam_periph_lock(periph); error = (*ssc->ses_vec.init_enc)(ssc); - CAM_PERIPH_UNLOCK(periph); + cam_periph_unlock(periph); break; default: - CAM_PERIPH_LOCK(periph); + cam_periph_lock(periph); error = cam_periph_ioctl(periph, cmd, arg_addr, seserror); - CAM_PERIPH_UNLOCK(periph); + cam_periph_unlock(periph); break; } return (error);