Commit e1d3d218 authored by Ian Kent's avatar Ian Kent Committed by Darrick J. Wong

xfs: use super s_id instead of struct xfs_mount m_fsname

Eliminate struct xfs_mount field m_fsname by using the super block s_id
field directly.
Signed-off-by: default avatarIan Kent <raven@themaw.net>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent f676c750
...@@ -257,7 +257,7 @@ xfs_errortag_test( ...@@ -257,7 +257,7 @@ xfs_errortag_test(
xfs_warn_ratelimited(mp, xfs_warn_ratelimited(mp,
"Injecting error (%s) at file %s, line %d, on filesystem \"%s\"", "Injecting error (%s) at file %s, line %d, on filesystem \"%s\"",
expression, file, line, mp->m_fsname); expression, file, line, mp->m_super->s_id);
return true; return true;
} }
......
...@@ -1526,7 +1526,7 @@ xlog_alloc_log( ...@@ -1526,7 +1526,7 @@ xlog_alloc_log(
log->l_ioend_workqueue = alloc_workqueue("xfs-log/%s", log->l_ioend_workqueue = alloc_workqueue("xfs-log/%s",
WQ_MEM_RECLAIM | WQ_FREEZABLE | WQ_HIGHPRI, 0, WQ_MEM_RECLAIM | WQ_FREEZABLE | WQ_HIGHPRI, 0,
mp->m_fsname); mp->m_super->s_id);
if (!log->l_ioend_workqueue) if (!log->l_ioend_workqueue)
goto out_free_iclog; goto out_free_iclog;
......
...@@ -20,8 +20,8 @@ __xfs_printk( ...@@ -20,8 +20,8 @@ __xfs_printk(
const struct xfs_mount *mp, const struct xfs_mount *mp,
struct va_format *vaf) struct va_format *vaf)
{ {
if (mp && mp->m_fsname) { if (mp && mp->m_super) {
printk("%sXFS (%s): %pV\n", level, mp->m_fsname, vaf); printk("%sXFS (%s): %pV\n", level, mp->m_super->s_id, vaf);
return; return;
} }
printk("%sXFS: %pV\n", level, vaf); printk("%sXFS: %pV\n", level, vaf);
......
...@@ -667,7 +667,8 @@ xfs_mountfs( ...@@ -667,7 +667,8 @@ xfs_mountfs(
/* enable fail_at_unmount as default */ /* enable fail_at_unmount as default */
mp->m_fail_unmount = true; mp->m_fail_unmount = true;
error = xfs_sysfs_init(&mp->m_kobj, &xfs_mp_ktype, NULL, mp->m_fsname); error = xfs_sysfs_init(&mp->m_kobj, &xfs_mp_ktype,
NULL, mp->m_super->s_id);
if (error) if (error)
goto out; goto out;
...@@ -1241,7 +1242,7 @@ xfs_mod_fdblocks( ...@@ -1241,7 +1242,7 @@ xfs_mod_fdblocks(
printk_once(KERN_WARNING printk_once(KERN_WARNING
"Filesystem \"%s\": reserve blocks depleted! " "Filesystem \"%s\": reserve blocks depleted! "
"Consider increasing reserve pool size.", "Consider increasing reserve pool size.",
mp->m_fsname); mp->m_super->s_id);
fdblocks_enospc: fdblocks_enospc:
spin_unlock(&mp->m_sb_lock); spin_unlock(&mp->m_sb_lock);
return -ENOSPC; return -ENOSPC;
......
...@@ -89,7 +89,6 @@ typedef struct xfs_mount { ...@@ -89,7 +89,6 @@ typedef struct xfs_mount {
struct percpu_counter m_delalloc_blks; struct percpu_counter m_delalloc_blks;
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_rtname; /* realtime device name */ char *m_rtname; /* realtime device name */
char *m_logname; /* external log device name */ char *m_logname; /* external log device name */
int m_bsize; /* fs logical block size */ int m_bsize; /* fs logical block size */
......
...@@ -60,7 +60,7 @@ xfs_fs_get_uuid( ...@@ -60,7 +60,7 @@ xfs_fs_get_uuid(
printk_once(KERN_NOTICE printk_once(KERN_NOTICE
"XFS (%s): using experimental pNFS feature, use at your own risk!\n", "XFS (%s): using experimental pNFS feature, use at your own risk!\n",
mp->m_fsname); mp->m_super->s_id);
if (*len < sizeof(uuid_t)) if (*len < sizeof(uuid_t))
return -EINVAL; return -EINVAL;
......
...@@ -161,14 +161,6 @@ xfs_parseargs( ...@@ -161,14 +161,6 @@ xfs_parseargs(
substring_t args[MAX_OPT_ARGS]; substring_t args[MAX_OPT_ARGS];
int size = 0; int size = 0;
/*
* set up the mount name first so all the errors will refer to the
* correct device.
*/
mp->m_fsname = kstrndup(sb->s_id, MAXNAMELEN, GFP_KERNEL);
if (!mp->m_fsname)
return -ENOMEM;
/* /*
* Copy binary VFS mount flags we are interested in. * Copy binary VFS mount flags we are interested in.
*/ */
...@@ -778,33 +770,33 @@ xfs_init_mount_workqueues( ...@@ -778,33 +770,33 @@ xfs_init_mount_workqueues(
struct xfs_mount *mp) struct xfs_mount *mp)
{ {
mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s", mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s",
WQ_MEM_RECLAIM|WQ_FREEZABLE, 1, mp->m_fsname); WQ_MEM_RECLAIM|WQ_FREEZABLE, 1, mp->m_super->s_id);
if (!mp->m_buf_workqueue) if (!mp->m_buf_workqueue)
goto out; goto out;
mp->m_unwritten_workqueue = alloc_workqueue("xfs-conv/%s", mp->m_unwritten_workqueue = alloc_workqueue("xfs-conv/%s",
WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id);
if (!mp->m_unwritten_workqueue) if (!mp->m_unwritten_workqueue)
goto out_destroy_buf; goto out_destroy_buf;
mp->m_cil_workqueue = alloc_workqueue("xfs-cil/%s", mp->m_cil_workqueue = alloc_workqueue("xfs-cil/%s",
WQ_MEM_RECLAIM | WQ_FREEZABLE | WQ_UNBOUND, WQ_MEM_RECLAIM | WQ_FREEZABLE | WQ_UNBOUND,
0, mp->m_fsname); 0, mp->m_super->s_id);
if (!mp->m_cil_workqueue) if (!mp->m_cil_workqueue)
goto out_destroy_unwritten; goto out_destroy_unwritten;
mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s", mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s",
WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id);
if (!mp->m_reclaim_workqueue) if (!mp->m_reclaim_workqueue)
goto out_destroy_cil; goto out_destroy_cil;
mp->m_eofblocks_workqueue = alloc_workqueue("xfs-eofblocks/%s", mp->m_eofblocks_workqueue = alloc_workqueue("xfs-eofblocks/%s",
WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id);
if (!mp->m_eofblocks_workqueue) if (!mp->m_eofblocks_workqueue)
goto out_destroy_reclaim; goto out_destroy_reclaim;
mp->m_sync_workqueue = alloc_workqueue("xfs-sync/%s", WQ_FREEZABLE, 0, mp->m_sync_workqueue = alloc_workqueue("xfs-sync/%s", WQ_FREEZABLE, 0,
mp->m_fsname); mp->m_super->s_id);
if (!mp->m_sync_workqueue) if (!mp->m_sync_workqueue)
goto out_destroy_eofb; goto out_destroy_eofb;
...@@ -1009,10 +1001,9 @@ xfs_fs_drop_inode( ...@@ -1009,10 +1001,9 @@ xfs_fs_drop_inode(
} }
STATIC void STATIC void
xfs_free_fsname( xfs_free_names(
struct xfs_mount *mp) struct xfs_mount *mp)
{ {
kfree(mp->m_fsname);
kfree(mp->m_rtname); kfree(mp->m_rtname);
kfree(mp->m_logname); kfree(mp->m_logname);
} }
...@@ -1189,7 +1180,7 @@ xfs_test_remount_options( ...@@ -1189,7 +1180,7 @@ xfs_test_remount_options(
tmp_mp->m_super = sb; tmp_mp->m_super = sb;
error = xfs_parseargs(tmp_mp, options); error = xfs_parseargs(tmp_mp, options);
xfs_free_fsname(tmp_mp); xfs_free_names(tmp_mp);
kmem_free(tmp_mp); kmem_free(tmp_mp);
return error; return error;
...@@ -1555,7 +1546,7 @@ xfs_fs_fill_super( ...@@ -1555,7 +1546,7 @@ xfs_fs_fill_super(
error = xfs_parseargs(mp, (char *)data); error = xfs_parseargs(mp, (char *)data);
if (error) if (error)
goto out_free_fsname; goto out_free_names;
sb_min_blocksize(sb, BBSIZE); sb_min_blocksize(sb, BBSIZE);
sb->s_xattr = xfs_xattr_handlers; sb->s_xattr = xfs_xattr_handlers;
...@@ -1582,7 +1573,7 @@ xfs_fs_fill_super( ...@@ -1582,7 +1573,7 @@ xfs_fs_fill_super(
error = xfs_open_devices(mp); error = xfs_open_devices(mp);
if (error) if (error)
goto out_free_fsname; goto out_free_names;
error = xfs_init_mount_workqueues(mp); error = xfs_init_mount_workqueues(mp);
if (error) if (error)
...@@ -1719,9 +1710,9 @@ xfs_fs_fill_super( ...@@ -1719,9 +1710,9 @@ xfs_fs_fill_super(
xfs_destroy_mount_workqueues(mp); xfs_destroy_mount_workqueues(mp);
out_close_devices: out_close_devices:
xfs_close_devices(mp); xfs_close_devices(mp);
out_free_fsname: out_free_names:
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
xfs_free_fsname(mp); xfs_free_names(mp);
kfree(mp); kfree(mp);
out: out:
return error; return error;
...@@ -1753,7 +1744,7 @@ xfs_fs_put_super( ...@@ -1753,7 +1744,7 @@ xfs_fs_put_super(
xfs_close_devices(mp); xfs_close_devices(mp);
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
xfs_free_fsname(mp); xfs_free_names(mp);
kfree(mp); kfree(mp);
} }
......
...@@ -836,7 +836,7 @@ xfs_trans_ail_init( ...@@ -836,7 +836,7 @@ xfs_trans_ail_init(
init_waitqueue_head(&ailp->ail_empty); init_waitqueue_head(&ailp->ail_empty);
ailp->ail_task = kthread_run(xfsaild, ailp, "xfsaild/%s", ailp->ail_task = kthread_run(xfsaild, ailp, "xfsaild/%s",
ailp->ail_mount->m_fsname); ailp->ail_mount->m_super->s_id);
if (IS_ERR(ailp->ail_task)) if (IS_ERR(ailp->ail_task))
goto out_free_ailp; goto out_free_ailp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment