summaryrefslogtreecommitdiffstats
path: root/include/sys/zfs_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sys/zfs_context.h')
-rw-r--r--include/sys/zfs_context.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
index 260b8a458..87ddde30a 100644
--- a/include/sys/zfs_context.h
+++ b/include/sys/zfs_context.h
@@ -579,6 +579,8 @@ typedef struct vsecattr {
#define CRCREAT 0
+#define F_FREESP 11
+
extern int fop_getattr(vnode_t *vp, vattr_t *vap);
#define VOP_CLOSE(vp, f, c, o, cr, ct) vn_close(vp)
@@ -587,6 +589,16 @@ extern int fop_getattr(vnode_t *vp, vattr_t *vap);
#define VOP_FSYNC(vp, f, cr, ct) fsync((vp)->v_fd)
+#if defined(HAVE_FILE_FALLOCATE) && \
+ defined(FALLOC_FL_PUNCH_HOLE) && \
+ defined(FALLOC_FL_KEEP_SIZE)
+#define VOP_SPACE(vp, cmd, flck, fl, off, cr, ct) \
+ fallocate((vp)->v_fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, \
+ (flck)->l_start, (flck)->l_len)
+#else
+#define VOP_SPACE(vp, cmd, flck, fl, off, cr, ct) (0)
+#endif
+
#define VN_RELE(vp) vn_close(vp)
extern int vn_open(char *path, int x1, int oflags, int mode, vnode_t **vpp,