Date: Fri, 23 Mar 2007 21:31:54 GMT From: Scott Long <scottl@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 116449 for review Message-ID: <200703232131.l2NLVsJl085546@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703232131.l2NLVsJl085546>