]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
filestore: use FL_ALLOC_PUNCH_HOLE to zero, when available
authorSage Weil <sage@newdream.net>
Thu, 8 Mar 2012 22:30:06 +0000 (14:30 -0800)
committerSage Weil <sage@newdream.net>
Thu, 8 Mar 2012 22:30:06 +0000 (14:30 -0800)
commited6cc47b18ff78d6628a7dcba9873b717ba02a1a
tree2124a06d91d785e8539453edf7fad9a58d971a5f
parent1468d95101adfad44247016a1399aab6b86708d2
filestore: use FL_ALLOC_PUNCH_HOLE to zero, when available

First try the FL_ALLOC_PUNCH_HOLE fallocate() flag.  If we get EOPNOTSUPP,
fall back to writing zeros.

Check for fallocate(2) with configure.  Also, avoid this if we are not
Linux, since I'm not sure about the hard-coded FL_ALLOC_PUNCH_HOLE being
correct on other platforms.

Signed-off-by: Sage Weil <sage@newdream.net>
Reviewed-by: Samuel Just <samuel.just@dreamhost.com>
configure.ac
src/os/FileStore.cc
src/os/FileStore.h