diff options
author | Darrick J. Wong <djwong@kernel.org> | 2024-02-03 12:23:36 -0800 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-05-10 22:59:02 -0700 |
commit | 626b5be26d8eb25a47f6e05f5ccac781d3f6d4d3 (patch) | |
tree | ff0f0ac702891bf824af06c7543fdee45eb2354d | |
parent | 4e967c0932ec0ffbad9309991a3022bde244798e (diff) | |
download | xfs-linux-contention-timestats.tar.gz |
xfs: create debugfs uuid aliasescontention-timestats_2024-05-10contention-timestats
Create an alias for the debugfs dir so that we can find a filesystem by
uuid. Unless it's mounted nouuid.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
-rw-r--r-- | fs/xfs/xfs_mount.h | 1 | ||||
-rw-r--r-- | fs/xfs/xfs_super.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 03574233d8eec3..887e173851ebe0 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -235,6 +235,7 @@ typedef struct xfs_mount { uint64_t m_resblks_save; /* reserved blks @ remount,ro */ struct delayed_work m_reclaim_work; /* background inode reclaim */ struct dentry *m_debugfs; /* debugfs parent */ + struct dentry *m_debugfs_uuid; /* debugfs symlink */ struct xfs_kobj m_kobj; struct xfs_kobj m_error_kobj; struct xfs_kobj m_error_meta_kobj; diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 66d10e6163ff8c..899dcc5cee1e89 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -767,6 +767,7 @@ xfs_mount_free( if (mp->m_ddev_targp) xfs_free_buftarg(mp->m_ddev_targp); + debugfs_remove(mp->m_debugfs_uuid); debugfs_remove(mp->m_debugfs); xfs_timestats_destroy(mp); kfree(mp->m_rtname); @@ -1814,6 +1815,16 @@ xfs_fs_fill_super( goto out_unmount; } + if (xfs_debugfs && mp->m_debugfs && !xfs_has_nouuid(mp)) { + char name[UUID_STRING_LEN + 1]; + + snprintf(name, UUID_STRING_LEN + 1, "%pU", &mp->m_sb.sb_uuid); + mp->m_debugfs_uuid = debugfs_create_symlink(name, xfs_debugfs, + mp->m_super->s_id); + } else { + mp->m_debugfs_uuid = NULL; + } + return 0; out_filestream_unmount: |