summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2013-08-29 02:54:38 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2013-08-29 02:54:38 +0000
commit7280ce941e6fd0e51b577b44b49eeff891484ceb (patch)
treed399701999616e5ca3974a0d6eccc057dd307873
parentf633f78f2a4eb33688e4356f6c0f5ff0ef55ed25 (diff)
rename scsi_sem_{enter,leave} to scsi_pending_{start,finish}. these are
the wrappers around handling of pending work, theyre not semaphores. names from tedu@ ok krw@ guenther@
-rw-r--r--sys/scsi/mpath.c6
-rw-r--r--sys/scsi/scsi_base.c14
-rw-r--r--sys/scsi/scsiconf.h6
3 files changed, 13 insertions, 13 deletions
diff --git a/sys/scsi/mpath.c b/sys/scsi/mpath.c
index 7cd5d134f21..b8ce9eed10e 100644
--- a/sys/scsi/mpath.c
+++ b/sys/scsi/mpath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath.c,v 1.32 2013/08/27 00:53:09 dlg Exp $ */
+/* $OpenBSD: mpath.c,v 1.33 2013/08/29 02:54:36 dlg Exp $ */
/*
* Copyright (c) 2009 David Gwynne <dlg@openbsd.org>
@@ -340,7 +340,7 @@ mpath_done(struct scsi_xfer *mxs)
void
mpath_failover(struct mpath_dev *d)
{
- if (!scsi_sem_enter(&d->d_mtx, &d->d_failover))
+ if (!scsi_pending_start(&d->d_mtx, &d->d_failover))
return;
mpath_failover_start(d);
@@ -389,7 +389,7 @@ mpath_path_status(struct mpath_path *p, int status)
if (status == MPATH_S_ACTIVE) {
scsi_xsh_add(&p->p_xsh);
- if (!scsi_sem_leave(&d->d_mtx, &d->d_failover))
+ if (!scsi_pending_finish(&d->d_mtx, &d->d_failover))
mpath_failover_start(d);
} else
mpath_failover_check(d);
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index c1fc1caef86..d60fcf74ebb 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.205 2013/08/27 00:05:36 dlg Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.206 2013/08/29 02:54:36 dlg Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -214,7 +214,7 @@ scsi_plug_detach(void *xsc, void *xp)
}
int
-scsi_sem_enter(struct mutex *mtx, u_int *running)
+scsi_pending_start(struct mutex *mtx, u_int *running)
{
int rv = 1;
@@ -228,7 +228,7 @@ scsi_sem_enter(struct mutex *mtx, u_int *running)
}
int
-scsi_sem_leave(struct mutex *mtx, u_int *running)
+scsi_pending_finish(struct mutex *mtx, u_int *running)
{
int rv = 1;
@@ -402,7 +402,7 @@ scsi_ioh_runqueue(struct scsi_iopool *iopl)
struct scsi_iohandler *ioh;
void *io;
- if (!scsi_sem_enter(&iopl->mtx, &iopl->running))
+ if (!scsi_pending_start(&iopl->mtx, &iopl->running))
return;
do {
while (scsi_ioh_pending(iopl)) {
@@ -418,7 +418,7 @@ scsi_ioh_runqueue(struct scsi_iopool *iopl)
ioh->handler(ioh->cookie, io);
}
- } while (!scsi_sem_leave(&iopl->mtx, &iopl->running));
+ } while (!scsi_pending_finish(&iopl->mtx, &iopl->running));
}
/*
@@ -561,7 +561,7 @@ scsi_xsh_runqueue(struct scsi_link *link)
struct scsi_iohandler *ioh;
int runq;
- if (!scsi_sem_enter(&link->pool->mtx, &link->running))
+ if (!scsi_pending_start(&link->pool->mtx, &link->running))
return;
do {
runq = 0;
@@ -582,7 +582,7 @@ scsi_xsh_runqueue(struct scsi_link *link)
if (runq)
scsi_ioh_runqueue(link->pool);
- } while (!scsi_sem_leave(&link->pool->mtx, &link->running));
+ } while (!scsi_pending_finish(&link->pool->mtx, &link->running));
}
void
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index 03c2e22f56b..7dbe60509b2 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.h,v 1.155 2013/08/26 01:37:13 dlg Exp $ */
+/* $OpenBSD: scsiconf.h,v 1.156 2013/08/29 02:54:37 dlg Exp $ */
/* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */
/*
@@ -570,8 +570,8 @@ int scsi_xsh_del(struct scsi_xshandler *);
/*
* utility functions
*/
-int scsi_sem_enter(struct mutex *, u_int *);
-int scsi_sem_leave(struct mutex *, u_int *);
+int scsi_pending_start(struct mutex *, u_int *);
+int scsi_pending_finish(struct mutex *, u_int *);
/*
* Utility functions for SCSI HBA emulation.