diff options
author | Ravishankar N <ravishankar@redhat.com> | 2016-07-28 20:42:45 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-07-29 00:09:54 -0700 |
commit | 6d994661db96cad43f26d0d1e2fba31dce9a76f5 (patch) | |
tree | e9fe6c8cf108c32d2b1bac13614b4ab7eb4693f3 /tests/bugs | |
parent | b20b3c68d32f6dba3f7e003f3ad9b86220d9fa25 (diff) |
posix: leverage FALLOC_FL_ZERO_RANGE in zerofill fop
posix_zerofill() implements zerofilling of a given (offset,length) by
doing a writev in a loop followed by an optional fsync on the file.
fallocate(2) has a FALLOC_FL_ZERO_RANGE flag which does away with all
this and provides the same result (from a userspace application point of
view) with a single syscall. This patch attempts the zerofill with the
latter and falls back to the former if it fails.
Tested using a libgfapi based C program on XFS and observed using gdb that
posix_zerofill()'s call to fallocate with FALLOC_FL_ZERO_RANGE was a
success.
Change-Id: I77e9b7de0d59c255f06b0c39c43a276990081727
BUG: 1361249
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/15037
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'tests/bugs')
0 files changed, 0 insertions, 0 deletions