summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2010-08-24 12:02:11 +1000
committerAlex Elder <aelder@sgi.com>2010-10-18 15:07:25 -0500
commit447223520520b17d3b6d0631aa4838fbaf8eddb4 (patch)
tree068716a0537e0f7007a037073c4b7bc608233c1e /fs/xfs/xfs_bmap.h
parent3ae4c9deb30a8d5ee305b461625dcb298c9804a9 (diff)
downloadop-kernel-dev-447223520520b17d3b6d0631aa4838fbaf8eddb4.zip
op-kernel-dev-447223520520b17d3b6d0631aa4838fbaf8eddb4.tar.gz
xfs: Introduce XFS_IOC_ZERO_RANGE
XFS_IOC_ZERO_RANGE is the equivalent of an atomic XFS_IOC_UNRESVSP/ XFS_IOC_RESVSP call pair. It enabled ranges of written data to be turned into zeroes without requiring IO or having to free and reallocate the extents in the range given as would occur if we had to punch and then preallocate them separately. This enables applications to zero parts of files very quickly without changing the layout of the files in any way. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_bmap.h')
-rw-r--r--fs/xfs/xfs_bmap.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/xfs/xfs_bmap.h b/fs/xfs/xfs_bmap.h
index b13569a..71ec9b6 100644
--- a/fs/xfs/xfs_bmap.h
+++ b/fs/xfs/xfs_bmap.h
@@ -74,9 +74,12 @@ typedef struct xfs_bmap_free
#define XFS_BMAPI_IGSTATE 0x080 /* Ignore state - */
/* combine contig. space */
#define XFS_BMAPI_CONTIG 0x100 /* must allocate only one extent */
-#define XFS_BMAPI_CONVERT 0x200 /* unwritten extent conversion - */
- /* need write cache flushing and no */
- /* additional allocation alignments */
+/*
+ * unwritten extent conversion - this needs write cache flushing and no additional
+ * allocation alignments. When specified with XFS_BMAPI_PREALLOC it converts
+ * from written to unwritten, otherwise convert from unwritten to written.
+ */
+#define XFS_BMAPI_CONVERT 0x200
#define XFS_BMAPI_FLAGS \
{ XFS_BMAPI_WRITE, "WRITE" }, \
OpenPOWER on IntegriCloud