aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 6afaaeb2950..c207fef6770 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -2052,6 +2052,26 @@ xfs_mount_log_sb(
2052 return error; 2052 return error;
2053} 2053}
2054 2054
2055/*
2056 * If the underlying (data/log/rt) device is readonly, there are some
2057 * operations that cannot proceed.
2058 */
2059int
2060xfs_dev_is_read_only(
2061 struct xfs_mount *mp,
2062 char *message)
2063{
2064 if (xfs_readonly_buftarg(mp->m_ddev_targp) ||
2065 xfs_readonly_buftarg(mp->m_logdev_targp) ||
2066 (mp->m_rtdev_targp && xfs_readonly_buftarg(mp->m_rtdev_targp))) {
2067 cmn_err(CE_NOTE,
2068 "XFS: %s required on read-only device.", message);
2069 cmn_err(CE_NOTE,
2070 "XFS: write access unavailable, cannot proceed.");
2071 return EROFS;
2072 }
2073 return 0;
2074}
2055 2075
2056#ifdef HAVE_PERCPU_SB 2076#ifdef HAVE_PERCPU_SB
2057/* 2077/*