diff options
author | Amit Arora <aarora@in.ibm.com> | 2007-07-17 21:42:44 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2007-07-17 21:42:44 -0400 |
commit | 97ac73506c0ba93f30239bb57b4cfc5d73e68a62 (patch) | |
tree | 4d02848d6c792a70b413deadcaffd7bf8c8d61de /include/asm-i386 | |
parent | cb32da0416b823b7f4b65e7e85d6cba16ca4d1e1 (diff) | |
download | op-kernel-dev-97ac73506c0ba93f30239bb57b4cfc5d73e68a62.zip op-kernel-dev-97ac73506c0ba93f30239bb57b4cfc5d73e68a62.tar.gz |
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-i386')
-rw-r--r-- | include/asm-i386/unistd.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index e84ace1..9b15545 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h @@ -329,10 +329,11 @@ #define __NR_signalfd 321 #define __NR_timerfd 322 #define __NR_eventfd 323 +#define __NR_fallocate 324 #ifdef __KERNEL__ -#define NR_syscalls 324 +#define NR_syscalls 325 #define __ARCH_WANT_IPC_PARSE_VERSION #define __ARCH_WANT_OLD_READDIR |