summaryrefslogtreecommitdiff
path: root/libiohelp
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-02-11 18:30:02 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-02-11 18:30:02 +0000
commit3dc72e2ee1ec681ab22be681e4e07df1da2a7f38 (patch)
tree39b837bdcc5f6bab09c76f298fcc8583975f4a19 /libiohelp
parent3e73723e057707e6a433d70630319cbf00a988f1 (diff)
entered into RCS
Diffstat (limited to 'libiohelp')
-rw-r--r--libiohelp/get_conch.c6
-rw-r--r--libiohelp/handle_io_get_conch.c30
-rw-r--r--libiohelp/handle_io_release_conch.c7
3 files changed, 15 insertions, 28 deletions
diff --git a/libiohelp/get_conch.c b/libiohelp/get_conch.c
index b8a06e10..3d5fd8af 100644
--- a/libiohelp/get_conch.c
+++ b/libiohelp/get_conch.c
@@ -19,11 +19,10 @@
/* The conch must be locked when calling this routine. */
/* Remove any current holder of conch C. */
-error_t
+void
ioserver_get_conch (struct conch *c)
{
struct shared_io *user_sh;
- int error = 0;
again:
user_sh = c->holder_shared_page;
@@ -45,7 +44,7 @@ ioserver_get_conch (struct conch *c)
case USER_COULD_HAVE_CONCH:
user_sh->conch_status = USER_HAS_NOT_CONCH;
spin_unlock (&user_sh->lock);
- error = ioserver_fetch_shared_data (c->holder);
+ ioserver_fetch_shared_data (c->holder);
break;
case USER_HAS_NOT_CONCH:
@@ -55,5 +54,4 @@ ioserver_get_conch (struct conch *c)
}
c->holder = 0;
c->holder_shared_page = 0;
- return error;
}
diff --git a/libiohelp/handle_io_get_conch.c b/libiohelp/handle_io_get_conch.c
index 92b145f9..8c3a2948 100644
--- a/libiohelp/handle_io_get_conch.c
+++ b/libiohelp/handle_io_get_conch.c
@@ -21,38 +21,30 @@
/* Called by an I/O server when an io_get_conch message is received.
The user represented by USER and USER_SH wants conch C; give it
to her or return an error. */
-error_t
+void
ioserver_handle_io_get_conch (struct conch *c, void *user,
struct shared_io *user_sh)
{
- error_t error = 0;
if (c->holder == user)
{
if (user_sh->conch_status != USER_HAS_NOT_CONCH)
- error = ioserver_fetch_shared_data (user);
+ ioserver_fetch_shared_data (user);
else
user_sh->accessed = user_sh->written = 0;
- if (!error)
- error = ioserver_put_shared_data (user);
- if (!error)
- user_sh->conch_status = USER_HAS_CONCH;
+ ioserver_put_shared_data (user);
+ user_sh->conch_status = USER_HAS_CONCH;
}
else
{
- error = ioserver_get_conch (c);
+ ioserver_get_conch (c);
- if (!error)
- {
- c->holder = user;
- c->holder_shared_page = user_sh;
- if (user_sh->conch_status == USER_HAS_NOT_CONCH)
- user_sh->accessed = user_sh->written = 0;
- user_sh->conch_status = USER_HAS_CONCH;
- ioserver_put_shared_data (user);
- }
+ c->holder = user;
+ c->holder_shared_page = user_sh;
+ if (user_sh->conch_status == USER_HAS_NOT_CONCH)
+ user_sh->accessed = user_sh->written = 0;
+ user_sh->conch_status = USER_HAS_CONCH;
+ ioserver_put_shared_data (user);
}
-
- return error;
}
diff --git a/libiohelp/handle_io_release_conch.c b/libiohelp/handle_io_release_conch.c
index 6e352498..27b79211 100644
--- a/libiohelp/handle_io_release_conch.c
+++ b/libiohelp/handle_io_release_conch.c
@@ -20,15 +20,14 @@
/* Called by an I/O server upon receipt of an io_release_conch message;
The user identified by USER is done with conch C; release it and
allow a waiting user to obtain the conch. */
-error_t
+void
ioserver_handle_io_release_conch (struct conch *c, void *user)
{
- error_t error = 0;
if (c->holder_shared_page->conch_status != USER_HAS_NOT_CONCH)
{
c->holder_shared_page->conch_status = USER_HAS_NOT_CONCH;
- error = ioserver_fetch_shared_data (c->holder);
+ ioserver_fetch_shared_data (c->holder);
}
if (c->holder == user)
@@ -38,7 +37,5 @@ ioserver_handle_io_release_conch (struct conch *c, void *user)
}
condition_broadcast (&c->wait);
-
- return error;
}