summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_bmap_util.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:16:23 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-11-09 19:08:16 -0800
commite936e495ae1b7cf83a33e9b530dfa903a30dfad6 (patch)
treef28737b2e7b35c8ff74eee3df5588caa1a92d506 /fs/xfs/xfs_bmap_util.h
parent59f8bca3c5e494751aaded276dc0366dc4b87a82 (diff)
xfs: fallocate free space into a filedefrag-freespace_2022-11-09
Add a new fallocate mode to map free physical space into a file, at the same file offset as if the file were a sparse image of the physical device backing the filesystem. The intent here is to use this to prototype a free space defragmentation tool. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_bmap_util.h')
-rw-r--r--fs/xfs/xfs_bmap_util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap_util.h b/fs/xfs/xfs_bmap_util.h
index 0a3fbc6d7aa8..a54b9fd2254a 100644
--- a/fs/xfs/xfs_bmap_util.h
+++ b/fs/xfs/xfs_bmap_util.h
@@ -76,4 +76,11 @@ int xfs_bmap_count_blocks(struct xfs_trans *tp, struct xfs_inode *ip,
int xfs_flush_unmap_range(struct xfs_inode *ip, xfs_off_t offset,
xfs_off_t len);
+int xfs_map_free_space(struct xfs_inode *ip, xfs_off_t off, xfs_off_t len);
+#ifdef CONFIG_XFS_RT
+int xfs_map_free_rt_space(struct xfs_inode *ip, xfs_off_t off, xfs_off_t len);
+#else
+# define xfs_map_free_rt_space(ip, off, len) (-EOPNOTSUPP)
+#endif
+
#endif /* __XFS_BMAP_UTIL_H__ */