aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
authorAmit Arora <aarora@in.ibm.com>2007-07-17 21:42:44 -0400
committerTheodore Ts'o <tytso@mit.edu>2007-07-17 21:42:44 -0400
commit97ac73506c0ba93f30239bb57b4cfc5d73e68a62 (patch)
tree4d02848d6c792a70b413deadcaffd7bf8c8d61de /include/asm-powerpc
parentcb32da0416b823b7f4b65e7e85d6cba16ca4d1e1 (diff)
sys_fallocate() implementation on i386, x86_64 and powerpc
fallocate() is a new system call being proposed here which will allow applications to preallocate space to any file(s) in a file system. Each file system implementation that wants to use this feature will need to support an inode operation called ->fallocate(). Applications can use this feature to avoid fragmentation to certain level and thus get faster access speed. With preallocation, applications also get a guarantee of space for particular file(s) - even if later the the system becomes full. Currently, glibc provides an interface called posix_fallocate() which can be used for similar cause. Though this has the advantage of working on all file systems, but it is quite slow (since it writes zeroes to each block that has to be preallocated). Without a doubt, file systems can do this more efficiently within the kernel, by implementing the proposed fallocate() system call. It is expected that posix_fallocate() will be modified to call this new system call first and incase the kernel/filesystem does not implement it, it should fall back to the current implementation of writing zeroes to the new blocks. ToDos: 1. Implementation on other architectures (other than i386, x86_64, and ppc). Patches for s390(x) and ia64 are already available from previous posts, but it was decided that they should be added later once fallocate is in the mainline. Hence not including those patches in this take. 2. Changes to glibc, a) to support fallocate() system call b) to make posix_fallocate() and posix_fallocate64() call fallocate() Signed-off-by: Amit Arora <aarora@in.ibm.com>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/systbl.h1
-rw-r--r--include/asm-powerpc/unistd.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
index 1cc3f9cb6f4e..cc6d87228258 100644
--- a/include/asm-powerpc/systbl.h
+++ b/include/asm-powerpc/systbl.h
@@ -308,6 +308,7 @@ COMPAT_SYS_SPU(move_pages)
308SYSCALL_SPU(getcpu) 308SYSCALL_SPU(getcpu)
309COMPAT_SYS(epoll_pwait) 309COMPAT_SYS(epoll_pwait)
310COMPAT_SYS_SPU(utimensat) 310COMPAT_SYS_SPU(utimensat)
311COMPAT_SYS(fallocate)
311COMPAT_SYS_SPU(signalfd) 312COMPAT_SYS_SPU(signalfd)
312COMPAT_SYS_SPU(timerfd) 313COMPAT_SYS_SPU(timerfd)
313SYSCALL_SPU(eventfd) 314SYSCALL_SPU(eventfd)
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index f71c6061f1ec..97d82b6a9406 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -331,10 +331,11 @@
331#define __NR_timerfd 306 331#define __NR_timerfd 306
332#define __NR_eventfd 307 332#define __NR_eventfd 307
333#define __NR_sync_file_range2 308 333#define __NR_sync_file_range2 308
334#define __NR_fallocate 309
334 335
335#ifdef __KERNEL__ 336#ifdef __KERNEL__
336 337
337#define __NR_syscalls 309 338#define __NR_syscalls 310
338 339
339#define __NR__exit __NR_exit 340#define __NR__exit __NR_exit
340#define NR_syscalls __NR_syscalls 341#define NR_syscalls __NR_syscalls