Make struct dirent contain a full 64bit inode. Allow more than 255 byte
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Sat, 27 Aug 2005 20:23:06 +0000 (20:23 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Sat, 27 Aug 2005 20:23:06 +0000 (20:23 +0000)
commit01f31ab32f7099aaccb062c201ddd5e2818557a4
treecabfaec603310cbcad68672b04379823acf3b9d4
parentba1b1de30c66fb8ef4e4f13ff64a292cf1137585
Make struct dirent contain a full 64bit inode. Allow more than 255 byte
filenames by increasing d_namlen to 16bit. Remove UFS specific macros
from sys/dirent.h, programs which really need them should include
vfs/ufs/dir.h. MAXNAMLEN should not be used, but replaced by NAME_MAX.

To keep the impact for older BSD code small, d_ino and d_fileno are kept
in the old meaning when __BSD_VISIBLE is defined, otherwise the POSIX
version d_ino is used. This will be changed later to always define only
d_ino and make d_fileno a compatiblity macro for __BSD_VISIBLE.

d_name is left with hard-coded 256 byte space, this will be changed at
some point in the future and doesn't affect the ABI. Programs should
correctly allocate space themselve, since the maximum directory entry
length can be > 256 byte.

For allocating dirents (e.g. for readdir_r), _DIRENT_RECLEN and
_DIRENT_DIRSIZ should be used. NetBSD has choosen the same names.
Revamp the compatibility code to always use a local kernel buffer and
write out the entries. This will be changed later by passing down the
output function to vop_readdir, elimininating the redundant copy.

Change NFS and CD9660 to use to use vop_write_dirent, for CD9660 ensure
that the buffers are big enough by prepending char arrays of the right
size.

Tested-by & discussed-with: dillon
31 files changed:
include/dirent.h
lib/libc/gen/readdir.c
lib/libc/gen/scandir.c
lib/libc/gen/ttyname.c
lib/libstand/cd9660.c
lib/libstand/ufs.c
sbin/restore/interactive.c
sys/conf/files
sys/emulation/43bsd/43bsd_file.c
sys/emulation/dragonfly12/dfbsd12_getdirentries.c [new file with mode: 0644]
sys/emulation/ibcs2/i386/ibcs2_misc.c
sys/emulation/linux/linux_file.c
sys/emulation/svr4/svr4_misc.c
sys/kern/init_sysent.c
sys/kern/syscalls.c
sys/kern/syscalls.master
sys/kern/vfs_cache.c
sys/kern/vfs_subr.c
sys/sys/dirent.h
sys/sys/syscall-args
sys/sys/syscall-hide.h
sys/sys/syscall.h
sys/sys/syscall.mk
sys/sys/sysproto.h
sys/sys/sysunion.h
sys/vfs/isofs/cd9660/cd9660_vnops.c
sys/vfs/nfs/nfs_bio.c
sys/vfs/nfs/nfs_serv.c
sys/vfs/nfs/nfs_vnops.c
sys/vfs/nfs/nfsnode.h
sys/vfs/smbfs/smbfs_io.c