summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_linux.h
diff options
context:
space:
mode:
authorRichard Wareing2018-01-08 19:41:33 +0100
committerDarrick J. Wong2018-01-08 19:41:33 +0100
commita0158315964136d1a43c1a726ac4381ae3a76153 (patch)
treebc0bac214519561eb7bf8ce249b2dad5901fe9c2 /fs/xfs/xfs_linux.h
parentLinux 4.15-rc7 (diff)
downloadkernel-qcow2-linux-a0158315964136d1a43c1a726ac4381ae3a76153.tar.gz
kernel-qcow2-linux-a0158315964136d1a43c1a726ac4381ae3a76153.tar.xz
kernel-qcow2-linux-a0158315964136d1a43c1a726ac4381ae3a76153.zip
xfs: Show realtime device stats on statfs calls if realtime flags set
- Reports realtime device free blocks in statfs calls if (realtime) inheritance bit is set on the inode of directory, or realtime flag in the case of files. This is a bit more intuitive, especially for use-cases which are using a much larger device for the realtime device. - Add XFS_IS_REALTIME_MOUNT option to gate based on the existence of a realtime device on the mount, similar to the XFS_IS_REALTIME_INODE option. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Richard Wareing <rwareing@fb.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_linux.h')
-rw-r--r--fs/xfs/xfs_linux.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
index 99562ec0de56..74d3576c8043 100644
--- a/fs/xfs/xfs_linux.h
+++ b/fs/xfs/xfs_linux.h
@@ -285,8 +285,10 @@ static inline uint64_t howmany_64(uint64_t x, uint32_t y)
#define XFS_IS_REALTIME_INODE(ip) \
(((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME) && \
(ip)->i_mount->m_rtdev_targp)
+#define XFS_IS_REALTIME_MOUNT(mp) ((mp)->m_rtdev_targp ? 1 : 0)
#else
#define XFS_IS_REALTIME_INODE(ip) (0)
+#define XFS_IS_REALTIME_MOUNT(mp) (0)
#endif
#endif /* __XFS_LINUX__ */