Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Ian Kent <raven@themaw.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

authored by

Ian Kent and committed by
Darrick J. Wong
e1d3d218 f676c750

+22 -31
+1 -1
fs/xfs/xfs_error.c
··· 257 257 258 258 xfs_warn_ratelimited(mp, 259 259 "Injecting error (%s) at file %s, line %d, on filesystem \"%s\"", 260 - expression, file, line, mp->m_fsname); 260 + expression, file, line, mp->m_super->s_id); 261 261 return true; 262 262 } 263 263
+1 -1
fs/xfs/xfs_log.c
··· 1526 1526 1527 1527 log->l_ioend_workqueue = alloc_workqueue("xfs-log/%s", 1528 1528 WQ_MEM_RECLAIM | WQ_FREEZABLE | WQ_HIGHPRI, 0, 1529 - mp->m_fsname); 1529 + mp->m_super->s_id); 1530 1530 if (!log->l_ioend_workqueue) 1531 1531 goto out_free_iclog; 1532 1532
+2 -2
fs/xfs/xfs_message.c
··· 20 20 const struct xfs_mount *mp, 21 21 struct va_format *vaf) 22 22 { 23 - if (mp && mp->m_fsname) { 24 - printk("%sXFS (%s): %pV\n", level, mp->m_fsname, vaf); 23 + if (mp && mp->m_super) { 24 + printk("%sXFS (%s): %pV\n", level, mp->m_super->s_id, vaf); 25 25 return; 26 26 } 27 27 printk("%sXFS: %pV\n", level, vaf);
+3 -2
fs/xfs/xfs_mount.c
··· 667 667 /* enable fail_at_unmount as default */ 668 668 mp->m_fail_unmount = true; 669 669 670 - error = xfs_sysfs_init(&mp->m_kobj, &xfs_mp_ktype, NULL, mp->m_fsname); 670 + error = xfs_sysfs_init(&mp->m_kobj, &xfs_mp_ktype, 671 + NULL, mp->m_super->s_id); 671 672 if (error) 672 673 goto out; 673 674 ··· 1242 1241 printk_once(KERN_WARNING 1243 1242 "Filesystem \"%s\": reserve blocks depleted! " 1244 1243 "Consider increasing reserve pool size.", 1245 - mp->m_fsname); 1244 + mp->m_super->s_id); 1246 1245 fdblocks_enospc: 1247 1246 spin_unlock(&mp->m_sb_lock); 1248 1247 return -ENOSPC;
-1
fs/xfs/xfs_mount.h
··· 89 89 struct percpu_counter m_delalloc_blks; 90 90 91 91 struct xfs_buf *m_sb_bp; /* buffer for superblock */ 92 - char *m_fsname; /* filesystem name */ 93 92 char *m_rtname; /* realtime device name */ 94 93 char *m_logname; /* external log device name */ 95 94 int m_bsize; /* fs logical block size */
+1 -1
fs/xfs/xfs_pnfs.c
··· 60 60 61 61 printk_once(KERN_NOTICE 62 62 "XFS (%s): using experimental pNFS feature, use at your own risk!\n", 63 - mp->m_fsname); 63 + mp->m_super->s_id); 64 64 65 65 if (*len < sizeof(uuid_t)) 66 66 return -EINVAL;
+13 -22
fs/xfs/xfs_super.c
··· 162 162 int size = 0; 163 163 164 164 /* 165 - * set up the mount name first so all the errors will refer to the 166 - * correct device. 167 - */ 168 - mp->m_fsname = kstrndup(sb->s_id, MAXNAMELEN, GFP_KERNEL); 169 - if (!mp->m_fsname) 170 - return -ENOMEM; 171 - 172 - /* 173 165 * Copy binary VFS mount flags we are interested in. 174 166 */ 175 167 if (sb_rdonly(sb)) ··· 770 778 struct xfs_mount *mp) 771 779 { 772 780 mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s", 773 - WQ_MEM_RECLAIM|WQ_FREEZABLE, 1, mp->m_fsname); 781 + WQ_MEM_RECLAIM|WQ_FREEZABLE, 1, mp->m_super->s_id); 774 782 if (!mp->m_buf_workqueue) 775 783 goto out; 776 784 777 785 mp->m_unwritten_workqueue = alloc_workqueue("xfs-conv/%s", 778 - WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); 786 + WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id); 779 787 if (!mp->m_unwritten_workqueue) 780 788 goto out_destroy_buf; 781 789 782 790 mp->m_cil_workqueue = alloc_workqueue("xfs-cil/%s", 783 791 WQ_MEM_RECLAIM | WQ_FREEZABLE | WQ_UNBOUND, 784 - 0, mp->m_fsname); 792 + 0, mp->m_super->s_id); 785 793 if (!mp->m_cil_workqueue) 786 794 goto out_destroy_unwritten; 787 795 788 796 mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s", 789 - WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); 797 + WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id); 790 798 if (!mp->m_reclaim_workqueue) 791 799 goto out_destroy_cil; 792 800 793 801 mp->m_eofblocks_workqueue = alloc_workqueue("xfs-eofblocks/%s", 794 - WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); 802 + WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id); 795 803 if (!mp->m_eofblocks_workqueue) 796 804 goto out_destroy_reclaim; 797 805 798 806 mp->m_sync_workqueue = alloc_workqueue("xfs-sync/%s", WQ_FREEZABLE, 0, 799 - mp->m_fsname); 807 + mp->m_super->s_id); 800 808 if (!mp->m_sync_workqueue) 801 809 goto out_destroy_eofb; 802 810 ··· 1001 1009 } 1002 1010 1003 1011 STATIC void 1004 - xfs_free_fsname( 1012 + xfs_free_names( 1005 1013 struct xfs_mount *mp) 1006 1014 { 1007 - kfree(mp->m_fsname); 1008 1015 kfree(mp->m_rtname); 1009 1016 kfree(mp->m_logname); 1010 1017 } ··· 1180 1189 1181 1190 tmp_mp->m_super = sb; 1182 1191 error = xfs_parseargs(tmp_mp, options); 1183 - xfs_free_fsname(tmp_mp); 1192 + xfs_free_names(tmp_mp); 1184 1193 kmem_free(tmp_mp); 1185 1194 1186 1195 return error; ··· 1546 1555 1547 1556 error = xfs_parseargs(mp, (char *)data); 1548 1557 if (error) 1549 - goto out_free_fsname; 1558 + goto out_free_names; 1550 1559 1551 1560 sb_min_blocksize(sb, BBSIZE); 1552 1561 sb->s_xattr = xfs_xattr_handlers; ··· 1573 1582 1574 1583 error = xfs_open_devices(mp); 1575 1584 if (error) 1576 - goto out_free_fsname; 1585 + goto out_free_names; 1577 1586 1578 1587 error = xfs_init_mount_workqueues(mp); 1579 1588 if (error) ··· 1710 1719 xfs_destroy_mount_workqueues(mp); 1711 1720 out_close_devices: 1712 1721 xfs_close_devices(mp); 1713 - out_free_fsname: 1722 + out_free_names: 1714 1723 sb->s_fs_info = NULL; 1715 - xfs_free_fsname(mp); 1724 + xfs_free_names(mp); 1716 1725 kfree(mp); 1717 1726 out: 1718 1727 return error; ··· 1744 1753 xfs_close_devices(mp); 1745 1754 1746 1755 sb->s_fs_info = NULL; 1747 - xfs_free_fsname(mp); 1756 + xfs_free_names(mp); 1748 1757 kfree(mp); 1749 1758 } 1750 1759
+1 -1
fs/xfs/xfs_trans_ail.c
··· 836 836 init_waitqueue_head(&ailp->ail_empty); 837 837 838 838 ailp->ail_task = kthread_run(xfsaild, ailp, "xfsaild/%s", 839 - ailp->ail_mount->m_fsname); 839 + ailp->ail_mount->m_super->s_id); 840 840 if (IS_ERR(ailp->ail_task)) 841 841 goto out_free_ailp; 842 842