[XFS] Track external log/realtime device names for correct reporting in

/proc/mounts.

SGI-PV: 942984
SGI-Modid: xfs-linux:xfs-kern:23862a

Signed-off-by: Nathan Scott <nathans@sgi.com>
This commit is contained in:
Nathan Scott 2005-11-02 11:44:33 +11:00
parent 4aeb664c25
commit fc1f8c1ca3
5 changed files with 29 additions and 13 deletions

View File

@ -483,7 +483,8 @@ xfs_log_mount(xfs_mount_t *mp,
#if defined(DEBUG) || defined(XLOG_NOLOG) #if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug) { if (!xlog_debug) {
cmn_err(CE_NOTE, "log dev: %s", XFS_BUFTARG_NAME(log_target)); cmn_err(CE_NOTE, "logdev: %s", mp->m_logname ?
mp->m_logname : "internal");
return 0; return 0;
} }
#endif #endif

View File

@ -2226,8 +2226,9 @@ xlog_recover_do_buffer_trans(
break; break;
default: default:
xfs_fs_cmn_err(CE_ALERT, log->l_mp, xfs_fs_cmn_err(CE_ALERT, log->l_mp,
"xfs_log_recover: unknown buffer type 0x%x, dev %s", "xfs_log_recover: unknown buffer type 0x%x, logdev %s",
buf_f->blf_type, XFS_BUFTARG_NAME(log->l_targ)); buf_f->blf_type, log->l_mp->m_logname ?
log->l_mp->m_logname : "internal");
XFS_ERROR_REPORT("xlog_recover_do_buffer_trans", XFS_ERROR_REPORT("xlog_recover_do_buffer_trans",
XFS_ERRLEVEL_LOW, log->l_mp); XFS_ERRLEVEL_LOW, log->l_mp);
return XFS_ERROR(EFSCORRUPTED); return XFS_ERROR(EFSCORRUPTED);
@ -3938,8 +3939,9 @@ xlog_recover(
} }
cmn_err(CE_NOTE, cmn_err(CE_NOTE,
"Starting XFS recovery on filesystem: %s (dev: %s)", "Starting XFS recovery on filesystem: %s (logdev: %s)",
log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ)); log->l_mp->m_fsname, log->l_mp->m_logname ?
log->l_mp->m_logname : "internal");
error = xlog_do_recover(log, head_blk, tail_blk); error = xlog_do_recover(log, head_blk, tail_blk);
log->l_flags |= XLOG_RECOVERY_NEEDED; log->l_flags |= XLOG_RECOVERY_NEEDED;
@ -3987,8 +3989,9 @@ xlog_recover_finish(
xlog_recover_check_summary(log); xlog_recover_check_summary(log);
cmn_err(CE_NOTE, cmn_err(CE_NOTE,
"Ending XFS recovery on filesystem: %s (dev: %s)", "Ending XFS recovery on filesystem: %s (logdev: %s)",
log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ)); log->l_mp->m_fsname, log->l_mp->m_logname ?
log->l_mp->m_logname : "internal");
log->l_flags &= ~XLOG_RECOVERY_NEEDED; log->l_flags &= ~XLOG_RECOVERY_NEEDED;
} else { } else {
cmn_err(CE_DEBUG, cmn_err(CE_DEBUG,

View File

@ -180,6 +180,10 @@ xfs_mount_free(
if (mp->m_fsname != NULL) if (mp->m_fsname != NULL)
kmem_free(mp->m_fsname, mp->m_fsname_len); kmem_free(mp->m_fsname, mp->m_fsname_len);
if (mp->m_rtname != NULL)
kmem_free(mp->m_rtname, strlen(mp->m_rtname) + 1);
if (mp->m_logname != NULL)
kmem_free(mp->m_logname, strlen(mp->m_logname) + 1);
if (remove_bhv) { if (remove_bhv) {
struct vfs *vfsp = XFS_MTOVFS(mp); struct vfs *vfsp = XFS_MTOVFS(mp);

View File

@ -292,6 +292,8 @@ typedef struct xfs_mount {
struct xfs_buf *m_sb_bp; /* buffer for superblock */ struct xfs_buf *m_sb_bp; /* buffer for superblock */
char *m_fsname; /* filesystem name */ char *m_fsname; /* filesystem name */
int m_fsname_len; /* strlen of fs name */ int m_fsname_len; /* strlen of fs name */
char *m_rtname; /* realtime device name */
char *m_logname; /* external log device name */
int m_bsize; /* fs logical block size */ int m_bsize; /* fs logical block size */
xfs_agnumber_t m_agfrotor; /* last ag where space found */ xfs_agnumber_t m_agfrotor; /* last ag where space found */
xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */

View File

@ -257,6 +257,14 @@ xfs_start_flags(
mp->m_fsname_len = strlen(ap->fsname) + 1; mp->m_fsname_len = strlen(ap->fsname) + 1;
mp->m_fsname = kmem_alloc(mp->m_fsname_len, KM_SLEEP); mp->m_fsname = kmem_alloc(mp->m_fsname_len, KM_SLEEP);
strcpy(mp->m_fsname, ap->fsname); strcpy(mp->m_fsname, ap->fsname);
if (ap->rtname[0]) {
mp->m_rtname = kmem_alloc(strlen(ap->rtname) + 1, KM_SLEEP);
strcpy(mp->m_rtname, ap->rtname);
}
if (ap->logname[0]) {
mp->m_logname = kmem_alloc(strlen(ap->logname) + 1, KM_SLEEP);
strcpy(mp->m_logname, ap->logname);
}
if (ap->flags & XFSMNT_WSYNC) if (ap->flags & XFSMNT_WSYNC)
mp->m_flags |= XFS_MOUNT_WSYNC; mp->m_flags |= XFS_MOUNT_WSYNC;
@ -1914,13 +1922,11 @@ xfs_showargs(
if (mp->m_logbsize > 0) if (mp->m_logbsize > 0)
seq_printf(m, "," MNTOPT_LOGBSIZE "=%d", mp->m_logbsize); seq_printf(m, "," MNTOPT_LOGBSIZE "=%d", mp->m_logbsize);
if (mp->m_ddev_targp != mp->m_logdev_targp) if (mp->m_logname)
seq_printf(m, "," MNTOPT_LOGDEV "=%s", seq_printf(m, "," MNTOPT_LOGDEV "=%s", mp->m_logname);
XFS_BUFTARG_NAME(mp->m_logdev_targp));
if (mp->m_rtdev_targp && mp->m_ddev_targp != mp->m_rtdev_targp) if (mp->m_rtname)
seq_printf(m, "," MNTOPT_RTDEV "=%s", seq_printf(m, "," MNTOPT_RTDEV "=%s", mp->m_rtname);
XFS_BUFTARG_NAME(mp->m_rtdev_targp));
if (mp->m_dalign > 0) if (mp->m_dalign > 0)
seq_printf(m, "," MNTOPT_SUNIT "=%d", seq_printf(m, "," MNTOPT_SUNIT "=%d",