aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/vnode.h
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2002-07-19 07:29:39 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2002-07-19 07:29:39 +0000
commit7aca6291e3fb803b6563ce6e39680da3a2ba0feb (patch)
treeab6d723eb551696589894f8c55d99db82233b8c0 /sys/sys/vnode.h
parenteeeaf0fdd11ac3acc5602723957c965f47a5a15b (diff)
downloadsrc-7aca6291e3fb803b6563ce6e39680da3a2ba0feb.tar.gz
src-7aca6291e3fb803b6563ce6e39680da3a2ba0feb.zip
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.
Notes
Notes: svn path=/head/; revision=100344
Diffstat (limited to 'sys/sys/vnode.h')
-rw-r--r--sys/sys/vnode.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 0c5523ab16d4..83391126327a 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -225,16 +225,18 @@ struct vattr {
* Flags for ioflag. (high 16 bits used to ask for read-ahead and
* help with write clustering)
*/
-#define IO_UNIT 0x01 /* do I/O as atomic unit */
-#define IO_APPEND 0x02 /* append write to end */
-#define IO_SYNC 0x04 /* do I/O synchronously */
-#define IO_NODELOCKED 0x08 /* underlying node already locked */
-#define IO_NDELAY 0x10 /* FNDELAY flag set in file table */
-#define IO_VMIO 0x20 /* data already in VMIO space */
-#define IO_INVAL 0x40 /* invalidate after I/O */
-#define IO_ASYNC 0x80 /* bawrite rather then bdwrite */
-#define IO_DIRECT 0x100 /* attempt to bypass buffer cache */
-#define IO_NOWDRAIN 0x200 /* do not block on wdrain */
+#define IO_UNIT 0x0001 /* do I/O as atomic unit */
+#define IO_APPEND 0x0002 /* append write to end */
+#define IO_SYNC 0x0004 /* do I/O synchronously */
+#define IO_NODELOCKED 0x0008 /* underlying node already locked */
+#define IO_NDELAY 0x0010 /* FNDELAY flag set in file table */
+#define IO_VMIO 0x0020 /* data already in VMIO space */
+#define IO_INVAL 0x0040 /* invalidate after I/O */
+#define IO_ASYNC 0x0080 /* bawrite rather then bdwrite */
+#define IO_DIRECT 0x0100 /* attempt to bypass buffer cache */
+#define IO_NOWDRAIN 0x0200 /* do not block on wdrain */
+#define IO_EXT 0x0400 /* operate on external attributes */
+#define IO_NORMAL 0x0800 /* operate on regular data */
/*
* Modes. Some values same as Ixxx entries from inode.h for now.
@@ -281,6 +283,8 @@ extern int vttoif_tab[];
#define WRITECLOSE 0x0004 /* vflush: only close writable files */
#define DOCLOSE 0x0008 /* vclean: close active files */
#define V_SAVE 0x0001 /* vinvalbuf: sync file first */
+#define V_ALT 0x0002 /* vinvalbuf: invalidate only alternate bufs */
+#define V_NORMAL 0x0004 /* vinvalbuf: invalidate only regular bufs */
#define REVOKEALL 0x0001 /* vop_revoke: revoke all aliases */
#define V_WAIT 0x0001 /* vn_start_write: sleep for suspend */
#define V_NOWAIT 0x0002 /* vn_start_write: don't sleep for suspend */