sys/vfs/union/union_vnops.c
static int
union_readdir(struct vop_readdir_args *ap)
{
	struct union_node *un = VTOUNION(ap->a_vp);
	struct thread *td = ap->a_uio->uio_td;
	struct vnode *uvp;
	int error = 0;

	if ((uvp = union_ref_upper(un)) != NULLVP) {
		ap->a_head.a_ops = *uvp->v_ops;
		ap->a_vp = uvp;
		error = vop_readdir_ap(ap);
		vrele(uvp);
	}
	return(error);
}
/*
 * union_readdir works in concert with getdirentries and
 * readdir(3) to provide a list of entries in the unioned
 * directories.  getdirentries is responsible for walking
 * down the union stack.  readdir(3) is responsible for
 * eliminating duplicate names from the returned data stream.
 *
 * union_readdir(struct vnode *a_vp, struct uio *a_uio, struct ucred *a_cred,
 *		 int *a_eofflag, off_t *a_cookies, int a_ncookies)
 */
union_readdir works in concert with getdirentries and
readdir(3) to provide a list of entries in the unioned
directories.  getdirentries is responsible for walking
down the union stack.  readdir(3) is responsible for
eliminating duplicate names from the returned data stream.


union_readdir works in concert with getdirentries and readdir ( 3 ) to provide a list of entries in the unioned directories . getdirentries is responsible for walking down the union stack . readdir ( 3 ) is responsible for eliminating duplicate names from the returned data stream .
static int
union_readdir(struct vop_readdir_args *ap)
{
	struct union_node *un = VTOUNION(ap->a_vp);
	struct thread *td = ap->a_uio->uio_td;
	struct vnode *uvp;
	int error = 0;
	if ((uvp = union_ref_upper(un)) != NULLVP) {
		ap->a_head.a_ops = *uvp->v_ops;
		ap->a_vp = uvp;
		error = vop_readdir_ap(ap);
		vrele(uvp);
	}
	return(error);
}
static int union_readdir ( struct vop_readdir_args * ap ) { struct union_node * un = VTOUNION ( ap -> a_vp ) ; struct thread * td = ap -> a_uio -> uio_td ; struct vnode * uvp ; int error = 0 ; if ( ( uvp = union_ref_upper ( un ) ) != NULLVP ) { ap -> a_head . a_ops = * uvp -> v_ops ; ap -> a_vp = uvp ; error = vop_readdir_ap ( ap ) ; vrele ( uvp ) ; } return ( error ) ; }
union_readdir works in concert with getdirentries and
 readdir(3) to provide a list of entries in the unioned
 directories.
union_readdir works in concert with getdirentries and readdir ( 3 ) to provide a list of entries in the unioned directories .