summaryrefslogtreecommitdiff
path: root/include/linux/fadvise.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-02-03 16:59:04 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-02-03 16:59:04 -0800
commitfccbe3844c29beed4e665b1a5aafada44e133adc (patch)
treed36c55cf2d4c17987889a429457065dd9ac6f2ac /include/linux/fadvise.h
parente7bfb1dbceb8015e4cb4900a6f0ce05fd437016b (diff)
[PATCH] implement posix_fadvise64()
An implementation of posix_fadvise64(). It adds 368 bytes to my vmlinux and is worth it. I didn't bother doing posix_fadvise(), as userspace can implement that by calling fadvise64(). The main reason for wanting this syscall is to provide userspace with the ability to explicitly shoot down pagecache when streaming large files. This is what O_STEAMING does, only posix_fadvise() is standards-based, and harder to use. posix_fadvise() also subsumes sys_readahead(). POSIX_FADV_WILLNEED will generally provide asynchronous readahead semantics for small amounts of I/O. As long as things like indirect blocks are aready in core. POSIX_FADV_RANDOM gives unprivileged applications a way of disabling readahead on a per-fd basis, which may provide some benefit for super-seeky access patterns such as databases. The POSIX_FADV_* values are already implemented in glibc, and this patch ensures that they are in sync. A test app (fadvise.c) is available in ext3 CVS. See http://www.zip.com.au/~akpm/linux/ext3/ for CVS details. Ulrich has reviewed this patch (thanks).
Diffstat (limited to 'include/linux/fadvise.h')
-rw-r--r--include/linux/fadvise.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/fadvise.h b/include/linux/fadvise.h
new file mode 100644
index 000000000000..6fc656dfb93d
--- /dev/null
+++ b/include/linux/fadvise.h
@@ -0,0 +1,11 @@
+#ifndef FADVISE_H_INCLUDED
+#define FADVISE_H_INCLUDED
+
+#define POSIX_FADV_NORMAL 0 /* No further special treatment. */
+#define POSIX_FADV_RANDOM 1 /* Expect random page references. */
+#define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+#define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
+#define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
+#define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
+
+#endif /* FADVISE_H_INCLUDED */