summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_bmap_util.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2017-10-09 11:37:22 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2017-10-11 10:21:06 -0700
commitbb9c2e5433250f5b477035dc478314f8e6dd5e36 (patch)
treefe86cb95800f97fe729310190e0847ac520ce04b /fs/xfs/xfs_bmap_util.h
parent20413e37d71befd02b5846acdaf5e2564dd1c38e (diff)
downloadlwn-bb9c2e5433250f5b477035dc478314f8e6dd5e36.tar.gz
lwn-bb9c2e5433250f5b477035dc478314f8e6dd5e36.zip
xfs: move more RT specific code under CONFIG_XFS_RT
Various utility functions and interfaces that iterate internal devices try to reference the realtime device even when RT support is not compiled into the kernel. Make sure this code is excluded from the CONFIG_XFS_RT=n build, and where appropriate stub functions to return fatal errors if they ever get called when RT support is not present. Signed-Off-By: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_bmap_util.h')
-rw-r--r--fs/xfs/xfs_bmap_util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap_util.h b/fs/xfs/xfs_bmap_util.h
index 0eaa81dc49be..7d330b3c77c3 100644
--- a/fs/xfs/xfs_bmap_util.h
+++ b/fs/xfs/xfs_bmap_util.h
@@ -28,7 +28,20 @@ struct xfs_mount;
struct xfs_trans;
struct xfs_bmalloca;
+#ifdef CONFIG_XFS_RT
int xfs_bmap_rtalloc(struct xfs_bmalloca *ap);
+#else /* !CONFIG_XFS_RT */
+/*
+ * Attempts to allocate RT extents when RT is disable indicates corruption and
+ * should trigger a shutdown.
+ */
+static inline int
+xfs_bmap_rtalloc(struct xfs_bmalloca *ap)
+{
+ return -EFSCORRUPTED;
+}
+#endif /* CONFIG_XFS_RT */
+
int xfs_bmap_eof(struct xfs_inode *ip, xfs_fileoff_t endoff,
int whichfork, int *eof);
int xfs_bmap_punch_delalloc_range(struct xfs_inode *ip,