Fix vfs_emptydir(). It would consider Move internal-to-'vfs_default.c' get_next_directories containing directories of thent() to 'vfs_subr.c' and export
form 'X.' with X being any character as empty and would cause VOP_READDIR() toit for use by other parts of the VFS. This is a preparatory change for using it
return an error on directories containing enough whiteouts. While here, use a
more decently sized buffer as done elsewhere (allocated through malloc()in vfs_emptydir().
Remove manual iteration with VOP_READDIR() and instead reuse the old privateSimplify the old interface (one less argument, simpler termination test) and
get_next_dirent(), now public vfs_next_dirent()add documentation about it. Add documentation for the nowmore sanity checks (mostly under INVARIANTS,
public version. Simplifybut also in the old interface (one less argument,general case to prevent infinite loops). simplerDrop the explicit test
termination test). Add more sanity checks. Ion minimum directory entry size (without INVARIANTS).
Deal with the impacts in original callerscallers (dirent_exists() and vop_stdvptocnp()).
(dirent_exists() and vop_stdvptocnp()). As a result of dealing with impacts,
dirent_exists() has been simplified a bit but preserves the exact same
semantics except that, even if the return code has been reversed (0 now means the entry
exists, ENOENT that it doesn't and other values are genuine errors).
vfs_emptydirnext_dirent() has been tested manually for correctness. vfs_next_dirent() hasby a 'make -j4 buildkernel' with a temporary
been tested by a 'make -j4 buildkernel' with a temporary modification to themodification to the VFS cache causing vn_vptocnp() to always call VOP_VPTOCNP()
VFS cache causing vn_vptocnp() to always call VOP_VPTOCNP() and finally
vop_stdvptocnp() (observed with temporary debug counters).
Export new _GENERIC_MINDIRSIZ and _GENERIC_MAXDIRSIZ on __BSD_VISIBLE, and
GENERIC_MINDIRSIZ and GENERIC_MAXDIRSIZ on _KERNEL. While in 'dirent.h', fix
the comment for field 'd_off'.