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) ...@@ -298,15 +298,19 @@ check_pid(struct vdp_state *state, struct vsl_log *vsl, int options)
return (-1); return (-1);
} }
/* Assumes CHECK_OBJ* for req and state called by caller. */ static int v_matchproto_(vdp_bytes_f)
static int vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr,
rw_child(struct req *req, struct vdp_state *state, enum vdp_action act, ssize_t len)
const void *ptr, ssize_t len)
{ {
struct vdp_state *state;
struct pollfd *fds; struct pollfd *fds;
int retval; int retval;
ssize_t nbytes; 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); CHECK_OBJ_NOTNULL(state->obj, PIPE_VDP_MAGIC);
AN(state->obj->name); AN(state->obj->name);
AN(state->obj->path); AN(state->obj->path);
...@@ -427,20 +431,6 @@ rw_child(struct req *req, struct vdp_state *state, enum vdp_action act, ...@@ -427,20 +431,6 @@ rw_child(struct req *req, struct vdp_state *state, enum vdp_action act,
return (0); 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) static int v_matchproto_(vdp_fini_f)
vdp_fini(struct req *req, void **priv) 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