diff options
author | dillon <dillon@FreeBSD.org> | 2001-05-24 07:22:27 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2001-05-24 07:22:27 +0000 |
commit | a179ee09ab9ca2d9d1d09dc4752c53a13609f5e9 (patch) | |
tree | faca8401754525a67aa26f144230806cf238e370 /sys/sys/fcntl.h | |
parent | a26134411c10ba2364d3d85686667b8a87f0015f (diff) | |
download | FreeBSD-src-a179ee09ab9ca2d9d1d09dc4752c53a13609f5e9.zip FreeBSD-src-a179ee09ab9ca2d9d1d09dc4752c53a13609f5e9.tar.gz |
This patch implements O_DIRECT about 80% of the way. It takes a patchset
Tor created a while ago, removes the raw I/O piece (that has cache coherency
problems), and adds a buffer cache / VM freeing piece.
Essentially this patch causes O_DIRECT I/O to not be left in the cache, but
does not prevent it from going through the cache, hence the 80%. For
the last 20% we need a method by which the I/O can be issued directly to
buffer supplied by the user process and bypass the buffer cache entirely,
but still maintain cache coherency.
I also have the code working under -stable but the changes made to sys/file.h
may not be MFCable, so an MFC is not on the table yet.
Submitted by: tegge, dillon
Diffstat (limited to 'sys/sys/fcntl.h')
-rw-r--r-- | sys/sys/fcntl.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index 6bbf156..85a168c 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -98,15 +98,18 @@ /* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */ #define O_NOCTTY 0x8000 /* don't assign controlling terminal */ +/* Attempt to bypass buffer cache */ +#define O_DIRECT 0x00010000 + #ifdef _KERNEL /* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */ #define FFLAGS(oflags) ((oflags) + 1) #define OFLAGS(fflags) ((fflags) - 1) /* bits to save after open */ -#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK) +#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT) /* bits settable by fcntl(F_SETFL, ...) */ -#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM) +#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM|O_DIRECT) #endif /* |