]> granicus.if.org Git - zfs/commit
Fix FALLOC_FL_PUNCH_HOLE use in randfree_file.c
authorlegend-hua <liu.hua130@zte.com.cn>
Sat, 17 Sep 2016 22:20:10 +0000 (06:20 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 17 Sep 2016 22:20:10 +0000 (15:20 -0700)
commita34f7ab332a66c2857b212abb6082fcc0e762519
tree817448b6a3330029274655ffdded0152d576f3fc
parent30f3f2e13c01bf1c881b2f3bb1236fca9f87a8e5
Fix FALLOC_FL_PUNCH_HOLE use in randfree_file.c

The FALLOC_FL_PUNCH_HOLE flag was introduced in the 2.6.38
kernel.  To prevent breaking the build on older systems wrap its use
in a conditional.  When FALLOC_FL_PUNCH_HOLE isn't available
return a non-zero status and error message.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: legend-hua <liu.hua130@zte.com.cn>
Closes #5101
tests/zfs-tests/cmd/randfree_file/randfree_file.c