FreeBSD/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
/*
 * gfs_readdir_fini: generic readdir cleanup
 *   error	- if positive, an error to return
 *   eofp	- the eofp passed to readdir
 *   eof	- the eof value
 *
 * Returns a 0 on success, a non-zero errno on failure.  This result
 * should be returned from readdir.
 */
generic readdir cleanup
error      - if positive, an error to return
eofp       - the eofp passed to readdir
eof        - the eof value

Returns a 0 on success, a non-zero errno on failure.  This result
should be returned from readdir.
generic readdir cleanup error - if positive an error to return eofp - the eofp passed to readdir eof - the eof value Returns a 0 on success a non - zero errno on failure . This result should be returned from readdir .
int
gfs_readdir_fini(gfs_readdir_state_t *st, int error, int *eofp, int eof)
{
	size_t dirent_size;
	if (st->grd_flags & V_RDDIR_ENTFLAGS)
		dirent_size = EDIRENT_RECLEN(st->grd_namlen);
	else
		dirent_size = DIRENT64_RECLEN(st->grd_namlen);
	kmem_free(st->grd_dirent, dirent_size);
	if (error > 0)
		return (error);
	if (eofp)
		*eofp = eof;
	return (0);
}
int gfs_readdir_fini ( gfs_readdir_state_t * st , int error , int * eofp , int eof ) { size_t dirent_size ; if ( st -> grd_flags & V_RDDIR_ENTFLAGS ) dirent_size = EDIRENT_RECLEN ( st -> grd_namlen ) ; else dirent_size = DIRENT64_RECLEN ( st -> grd_namlen ) ; kmem_free ( st -> grd_dirent , dirent_size ) ; if ( error > 0 ) return ( error ) ; if ( eofp ) * eofp = eof ; return ( 0 ) ; }
gfs_readdir_fini: generic readdir cleanup
   error      - if positive, an error to return
   eofp       - the eofp passed to readdir
   eof        - the eof value
gfs_readdir_fini : generic readdir cleanup error - if positive an error to return eofp - the eofp passed to readdir eof - the eof value