[XFS] Track external log/realtime device names for correct reporting in
authorNathan Scott <nathans@sgi.com>
Wed, 2 Nov 2005 00:44:33 +0000 (11:44 +1100)
committerNathan Scott <nathans@sgi.com>
Wed, 2 Nov 2005 00:44:33 +0000 (11:44 +1100)
/proc/mounts.

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

Signed-off-by: Nathan Scott <nathans@sgi.com>
fs/xfs/xfs_log.c
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_mount.c
fs/xfs/xfs_mount.h
fs/xfs/xfs_vfsops.c

index b9d3ad35240ee9960d47a293c32c8e8e6af4a274..fcde2a2fc457b03b9a82fe0a6a96e3a2d90b49c6 100644 (file)
@@ -483,7 +483,8 @@ xfs_log_mount(xfs_mount_t   *mp,
 
 #if defined(DEBUG) || defined(XLOG_NOLOG)
        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;
        }
 #endif
index 14faabaabf29150c902d33a41a4252346623f464..212c5411595ee6b78c130e76bc6d2d471e83d1d9 100644 (file)
@@ -2226,8 +2226,9 @@ xlog_recover_do_buffer_trans(
                break;
        default:
                xfs_fs_cmn_err(CE_ALERT, log->l_mp,
-                       "xfs_log_recover: unknown buffer type 0x%x, dev %s",
-                       buf_f->blf_type, XFS_BUFTARG_NAME(log->l_targ));
+                       "xfs_log_recover: unknown buffer type 0x%x, logdev %s",
+                       buf_f->blf_type, log->l_mp->m_logname ?
+                       log->l_mp->m_logname : "internal");
                XFS_ERROR_REPORT("xlog_recover_do_buffer_trans",
                                 XFS_ERRLEVEL_LOW, log->l_mp);
                return XFS_ERROR(EFSCORRUPTED);
@@ -3938,8 +3939,9 @@ xlog_recover(
                }
 
                cmn_err(CE_NOTE,
-                       "Starting XFS recovery on filesystem: %s (dev: %s)",
-                       log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ));
+                       "Starting XFS recovery on filesystem: %s (logdev: %s)",
+                       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);
                log->l_flags |= XLOG_RECOVERY_NEEDED;
@@ -3987,8 +3989,9 @@ xlog_recover_finish(
                xlog_recover_check_summary(log);
 
                cmn_err(CE_NOTE,
-                       "Ending XFS recovery on filesystem: %s (dev: %s)",
-                       log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ));
+                       "Ending XFS recovery on filesystem: %s (logdev: %s)",
+                       log->l_mp->m_fsname, log->l_mp->m_logname ?
+                       log->l_mp->m_logname : "internal");
                log->l_flags &= ~XLOG_RECOVERY_NEEDED;
        } else {
                cmn_err(CE_DEBUG,
index a93ef802db6b099f958becad8514f9ca65b054b8..4f26172a163e0cab57f5c1f3ccf5148c7a6ac693 100644 (file)
@@ -180,6 +180,10 @@ xfs_mount_free(
 
        if (mp->m_fsname != NULL)
                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) {
                struct vfs      *vfsp = XFS_MTOVFS(mp);
index 5c5e7bf4a8a9d4f4a801ce2898c99ea0e71563e1..7341f4984c08fcd807b41a0330e4b608dca55b23 100644 (file)
@@ -292,6 +292,8 @@ typedef struct xfs_mount {
        struct xfs_buf          *m_sb_bp;       /* buffer for superblock */
        char                    *m_fsname;      /* filesystem 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 */
        xfs_agnumber_t          m_agfrotor;     /* last ag where space found */
        xfs_agnumber_t          m_agirotor;     /* last ag dir inode alloced */
index 07779c5ab42f4726ef430c7772e0a0ef79c64c96..200e0c50acf29fb45d919e92b0b8f23661369d2b 100644 (file)
@@ -257,6 +257,14 @@ xfs_start_flags(
        mp->m_fsname_len = strlen(ap->fsname) + 1;
        mp->m_fsname = kmem_alloc(mp->m_fsname_len, KM_SLEEP);
        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)
                mp->m_flags |= XFS_MOUNT_WSYNC;
@@ -1914,13 +1922,11 @@ xfs_showargs(
        if (mp->m_logbsize > 0)
                seq_printf(m, "," MNTOPT_LOGBSIZE "=%d", mp->m_logbsize);
 
-       if (mp->m_ddev_targp != mp->m_logdev_targp)
-               seq_printf(m, "," MNTOPT_LOGDEV "=%s",
-                               XFS_BUFTARG_NAME(mp->m_logdev_targp));
+       if (mp->m_logname)
+               seq_printf(m, "," MNTOPT_LOGDEV "=%s", mp->m_logname);
 
-       if (mp->m_rtdev_targp && mp->m_ddev_targp != mp->m_rtdev_targp)
-               seq_printf(m, "," MNTOPT_RTDEV "=%s",
-                               XFS_BUFTARG_NAME(mp->m_rtdev_targp));
+       if (mp->m_rtname)
+               seq_printf(m, "," MNTOPT_RTDEV "=%s", mp->m_rtname);
 
        if (mp->m_dalign > 0)
                seq_printf(m, "," MNTOPT_SUNIT "=%d",