s3: prefer posix_fallocate for doing "strict allocate"
commitc064b089109a2b8192d344a7faadbde9a2b0d194
authorBjörn Jacke <bj@sernet.de>
Wed, 2 Dec 2009 14:13:37 +0000 (2 15:13 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 8 Dec 2009 08:15:22 +0000 (8 09:15 +0100)
tree4022c420465c00d9d770a55e71abc9e2aa06e9e6
parenta227d4b8d7f064606a9c656d31cfbc56eac98b63
s3: prefer posix_fallocate for doing "strict allocate"

posix_fallocate is more efficient than manual zero'ing the file. When
preallocation in kernel space is supported it's extremely fast. Support for
preallocation at fs layer via posix_fallocate and fallocate at kernel site
can be found in Linux kernel 2.6.23/glibc 2.10 with ext4, XFS and OCFS2. Other
systems that I know of which support fast preallocation in kernel space are
AIX 6.1 with JFS2 and recent Solaris versions with ZFS maybe UFS2, too.

People who have a system with preallocation in kernel space might want to set
"strict allocate = yes". This reduces file fragentation and it's also safer for
setups with quota being turned on.

As of today most systems still don't have preallocation in kernel space, and
that's why "strict allocate = no" will stay the default for now.
(cherry picked from commit a1991b17cdb38b1bffa32d2386132ae01f827cd0)
source3/configure.in
source3/include/proto.h
source3/lib/system.c
source3/modules/vfs_default.c