HomeFreeBSD

Fix FALLOC_FL_PUNCH_HOLE use in randfree_file.c

Description

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

Details

Provenance
legend-hua <liu.hua130@zte.com.cn>Authored on Sep 17 2016, 10:20 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 17 2016, 10:20 PM
Parents
rG30f3f2e13c01: Fix Coverity defects
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGa34f7ab332a6: Fix FALLOC_FL_PUNCH_HOLE use in randfree_file.c (authored by legend-hua <liu.hua130@zte.com.cn>).Sep 17 2016, 10:20 PM