rocksdb/env
Aaron Gao 9e72939029 only FALLOC_FL_PUNCH_HOLE when ftruncate is buggy
Summary:
In RocksDB, we sometimes preallocate the estimated space for a file to have better perf with fallocate (if supported). Usually it is a little bit bigger than the real resulting file size. At this time, we have to let the Filesystem reclaim the space not used.

Ideally, calling ftruncate to truncate the file to its real size should be enough. HOWEVER, it isn't on tmpfs, which we witness in our case, with some buggy kernel version. ftruncate a file with preallocated space doesn't change number of the blocks used by the file, which means the space not used by the file is not returned to the filesystems. So in this case we need fallocate with FALLOC_FL_PUNCH_HOLE to explicitly reclaim the used blocks. It is a hack to cope with the kernel bug and usually we should not need it.
Closes https://github.com/facebook/rocksdb/pull/2102

Differential Revision: D4848934

Pulled By: lightmark

fbshipit-source-id: f1b40b5
2017-04-06 18:25:03 -07:00
..
env.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
env_basic_test.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
env_chroot.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
env_chroot.h Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
env_hdfs.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
env_posix.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
env_test.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
io_posix.cc only FALLOC_FL_PUNCH_HOLE when ftruncate is buggy 2017-04-06 18:25:03 -07:00
io_posix.h Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
memenv.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
mock_env.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
mock_env.h Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
mock_env_test.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
posix_logger.h Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00