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

xfs: fold xfs_mount-alloc() into xfs_init_fs_context()

After switching to use the mount-api the only remaining caller of
xfs_mount_alloc() is xfs_init_fs_context(), so fold xfs_mount_alloc()
into it.

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
50f83009 8757c38f

+19 -30
+19 -30
fs/xfs/xfs_super.c
··· 1096 1096 .free_cached_objects = xfs_fs_free_cached_objects, 1097 1097 }; 1098 1098 1099 - static struct xfs_mount * 1100 - xfs_mount_alloc(void) 1101 - { 1102 - struct xfs_mount *mp; 1103 - 1104 - mp = kmem_alloc(sizeof(struct xfs_mount), KM_ZERO); 1105 - if (!mp) 1106 - return NULL; 1107 - 1108 - spin_lock_init(&mp->m_sb_lock); 1109 - spin_lock_init(&mp->m_agirotor_lock); 1110 - INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); 1111 - spin_lock_init(&mp->m_perag_lock); 1112 - mutex_init(&mp->m_growlock); 1113 - atomic_set(&mp->m_active_trans, 0); 1114 - INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker); 1115 - INIT_DELAYED_WORK(&mp->m_eofblocks_work, xfs_eofblocks_worker); 1116 - INIT_DELAYED_WORK(&mp->m_cowblocks_work, xfs_cowblocks_worker); 1117 - mp->m_kobj.kobject.kset = xfs_kset; 1118 - /* 1119 - * We don't create the finobt per-ag space reservation until after log 1120 - * recovery, so we must set this to true so that an ifree transaction 1121 - * started during log recovery will not depend on space reservations 1122 - * for finobt expansion. 1123 - */ 1124 - mp->m_finobt_nores = true; 1125 - return mp; 1126 - } 1127 - 1128 1099 static int 1129 1100 suffix_kstrtoint( 1130 1101 const char *s, ··· 1739 1768 { 1740 1769 struct xfs_mount *mp; 1741 1770 1742 - mp = xfs_mount_alloc(); 1771 + mp = kmem_alloc(sizeof(struct xfs_mount), KM_ZERO); 1743 1772 if (!mp) 1744 1773 return -ENOMEM; 1774 + 1775 + spin_lock_init(&mp->m_sb_lock); 1776 + spin_lock_init(&mp->m_agirotor_lock); 1777 + INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); 1778 + spin_lock_init(&mp->m_perag_lock); 1779 + mutex_init(&mp->m_growlock); 1780 + atomic_set(&mp->m_active_trans, 0); 1781 + INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker); 1782 + INIT_DELAYED_WORK(&mp->m_eofblocks_work, xfs_eofblocks_worker); 1783 + INIT_DELAYED_WORK(&mp->m_cowblocks_work, xfs_cowblocks_worker); 1784 + mp->m_kobj.kobject.kset = xfs_kset; 1785 + /* 1786 + * We don't create the finobt per-ag space reservation until after log 1787 + * recovery, so we must set this to true so that an ifree transaction 1788 + * started during log recovery will not depend on space reservations 1789 + * for finobt expansion. 1790 + */ 1791 + mp->m_finobt_nores = true; 1745 1792 1746 1793 /* 1747 1794 * These can be overridden by the mount option parsing.