Date: Fri, 19 Jul 2002 00:29:39 -0700 (PDT) From: Kirk McKusick <mckusick@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern vfs_bio.c vfs_subr.c src/sys/sys buf.h vnode.h src/sys/ufs/ffs ffs_alloc.c ffs_balloc.c ffs_extern.h ffs_inode.c ffs_softdep.c ffs_softdep_stub.c softdep.h src/sys/ufs/ufs ufs_bmap.c ufs_extern.h ufs_inode.c ufs_lookup.c ... Message-ID: <200207190729.g6J7TdRw077240@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
mckusick 2002/07/19 00:29:39 PDT Modified files: sys/kern vfs_bio.c vfs_subr.c sys/sys buf.h vnode.h sys/ufs/ffs ffs_alloc.c ffs_balloc.c ffs_extern.h ffs_inode.c ffs_softdep.c ffs_softdep_stub.c softdep.h sys/ufs/ufs ufs_bmap.c ufs_extern.h ufs_inode.c ufs_lookup.c ufs_readwrite.c ufs_vnops.c Log: Add support to UFS2 to provide storage for extended attributes. As this code is not actually used by any of the existing interfaces, it seems unlikely to break anything (famous last words). The internal kernel interface to manipulate these attributes is invoked using two new IO_ flags: IO_NORMAL and IO_EXT. These flags may be specified in the ioflags word of VOP_READ, VOP_WRITE, and VOP_TRUNCATE. Specifying IO_NORMAL means that you want to do I/O to the normal data part of the file and IO_EXT means that you want to do I/O to the extended attributes part of the file. IO_NORMAL and IO_EXT are mutually exclusive for VOP_READ and VOP_WRITE, but may be specified individually or together in the case of VOP_TRUNCATE. For example, when removing a file, VOP_TRUNCATE is called with both IO_NORMAL and IO_EXT set. For backward compatibility, if neither IO_NORMAL nor IO_EXT is set, then IO_NORMAL is assumed. Note that the BA_ and IO_ flags have been `merged' so that they may both be used in the same flags word. This merger is possible by assigning the IO_ flags to the low sixteen bits and the BA_ flags the high sixteen bits. This works because the high sixteen bits of the IO_ word is reserved for read-ahead and help with write clustering so will never be used for flags. This merge lets us get away from code of the form: if (ioflags & IO_SYNC) flags |= BA_SYNC; For the future, I have considered adding a new field to the vattr structure, va_extsize. This addition could then be exported through the stat structure to allow applications to find out the size of the extended attribute storage and also would provide a more standard interface for truncating them (via VOP_SETATTR rather than VOP_TRUNCATE). I am also contemplating adding a pathconf parameter (for concreteness, lets call it _PC_MAX_EXTSIZE) which would let an application determine the maximum size of the extended atribute storage. Sponsored by: DARPA & NAI Labs. Revision Changes Path 1.322 +2 -2 src/sys/kern/vfs_bio.c 1.379 +85 -51 src/sys/kern/vfs_subr.c 1.137 +1 -0 src/sys/sys/buf.h 1.190 +14 -10 src/sys/sys/vnode.h 1.98 +4 -3 src/sys/ufs/ffs/ffs_alloc.c 1.37 +148 -42 src/sys/ufs/ffs/ffs_balloc.c 1.50 +5 -3 src/sys/ufs/ffs/ffs_extern.h 1.81 +81 -21 src/sys/ufs/ffs/ffs_inode.c 1.120 +403 -118 src/sys/ufs/ffs/ffs_softdep.c 1.25 +14 -0 src/sys/ufs/ffs/ffs_softdep_stub.c 1.16 +10 -3 src/sys/ufs/ffs/softdep.h 1.54 +16 -3 src/sys/ufs/ufs/ufs_bmap.c 1.45 +11 -7 src/sys/ufs/ufs/ufs_extern.h 1.45 +2 -1 src/sys/ufs/ufs/ufs_inode.c 1.63 +3 -2 src/sys/ufs/ufs/ufs_lookup.c 1.94 +337 -4 src/sys/ufs/ufs/ufs_readwrite.c 1.200 +9 -4 src/sys/ufs/ufs/ufs_vnops.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207190729.g6J7TdRw077240>