Commit 71e53dbd authored by Geoff Simmons's avatar Geoff Simmons

Spare the function call in vdp_bytes().

But we might go back to it when we add the VFP, since much of the
code for I/O with the child process should be reuasable.
parent f9a1944f
......@@ -298,15 +298,19 @@ check_pid(struct vdp_state *state, struct vsl_log *vsl, int options)
return (-1);
}
/* Assumes CHECK_OBJ* for req and state called by caller. */
static int
rw_child(struct req *req, struct vdp_state *state, enum vdp_action act,
const void *ptr, ssize_t len)
static int v_matchproto_(vdp_bytes_f)
vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr,
ssize_t len)
{
struct vdp_state *state;
struct pollfd *fds;
int retval;
ssize_t nbytes;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
assert(len >= 0);
AN(priv);
CAST_OBJ_NOTNULL(state, *priv, PIPE_VDP_STATE_MAGIC);
CHECK_OBJ_NOTNULL(state->obj, PIPE_VDP_MAGIC);
AN(state->obj->name);
AN(state->obj->path);
......@@ -427,20 +431,6 @@ rw_child(struct req *req, struct vdp_state *state, enum vdp_action act,
return (0);
}
static int v_matchproto_(vdp_bytes_f)
vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr,
ssize_t len)
{
struct vdp_state *state;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
assert(len >= 0);
AN(priv);
CAST_OBJ_NOTNULL(state, *priv, PIPE_VDP_STATE_MAGIC);
return (rw_child(req, state, act, ptr, len));
}
static int v_matchproto_(vdp_fini_f)
vdp_fini(struct req *req, void **priv)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment