SVCXPRT refcounting (lifecycle).

Add SVCXPRT lifecycle operations (SVC_REF, SVC_RELEASE) to
exported interface.

On creation, SVCXPRTs have refcnt 1.  Insertion on event
channel counts as 1 ref.  A ref is taken internally -before-
invocation of xp_getreq, the callout is responsible to
call SVC_RELEASE when finished with xprt in the getreq
call path.

Refactor SVC_RELEASE, SVC_DESTROY.

Remove unregistration logic in SVC_RELEASE implementations,
which was not correct.  Meanwhile cause SVC_DESTROY to
unregister unconditionally.

Add remarks on future lock reordering options.

Fix lock ordering violation in svc_xprt_set path.

Finalize xprts in SVC_DESTROY.

Move svc_rqst_finalize_xprt to SVC_DESTROY.  There's no
need for idle processing on destroyed connections.

In addition, remove incorrect conditional cleanup code from
svc_clean_idle2_func.  The "destroyed" case may now be
impossible to hit--log for debugging.

Add missing SVC_REF in svc_rqst_evchan_reg.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>

SVC_REF drops xprt->xp_unlock (don't do it again).

Remove cond_(un)block_events_svc.

These are not called, and disappear in duplex-9.

Remove non-effective duplex cases in clnt_vc.c.

These features are completely redesigned on duplex-9, and
have no real effect here.  Removing the event-blocking
calls is helpful for debugging with helgrind/drd because
it removes a lock order false case.

Hide and rename svc_rqst_(un)block events.

These routines are not just internal helper routines.
To permit declaring these static, also move the
xprt_(un)register routines into svc_rqst.c.

Remove dead code in xprt_register.

Fix call to svc_rqst_unhook_events (missed in commit).

Don't directly decrement refcnt in SVC_DESTROY.

In brief, this is now accounted for.  Internal references are
still returned indirectly, of course.

In addition, add a guard.

Refcnt tracing.

This logic will likely be reduced or removed after further
validation.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Refactor xprt refcnt.

Split lifecycle ops for rendezvous and request xprt handles.
Refactor.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Take xd->refcnt only on new link.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Dont return ref not taken.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Always return SVCXPRT handles ref'd.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
s/__rpc_client/rpc_client/

Consumers understand that they should use the canonical
type name.  Mirrors prior SVCXPRT change.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix uninitialized access, return type of svc_vc_ref.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Normalize CLNT refcouting.

Reimplement CLNT handle refcnting logic to match SVCXPRT.  In
support of this, add cl_lock and cl_flags members to struct
rpc_client.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
On (xp|cl)_destroy, shared destroy only if both refcnts are
now 0.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix unlock typo.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Decrement xd->refcnt only in svc_vc_destroy.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Deal cleanly with bidirectional timeouts.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Fix rpc_dplx_rec refcnt imbalance.

Each of CLNT and SVCXPRT handle count toward the refcnt, if
present.  Release each such ref in vc_shared_destroy.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Add new file os_epoll.h to Makefile.am

Signed-off-by: Matt Benjamin <matt@linuxbox.com>