|
@@ -1579,29 +1579,48 @@ xfs_destroy_percpu_counters(
|
|
percpu_counter_destroy(&mp->m_fdblocks);
|
|
percpu_counter_destroy(&mp->m_fdblocks);
|
|
}
|
|
}
|
|
|
|
|
|
-STATIC int
|
|
|
|
-xfs_fs_fill_super(
|
|
|
|
- struct super_block *sb,
|
|
|
|
- void *data,
|
|
|
|
- int silent)
|
|
|
|
|
|
+static struct xfs_mount *
|
|
|
|
+xfs_mount_alloc(
|
|
|
|
+ struct super_block *sb)
|
|
{
|
|
{
|
|
- struct inode *root;
|
|
|
|
- struct xfs_mount *mp = NULL;
|
|
|
|
- int flags = 0, error = -ENOMEM;
|
|
|
|
|
|
+ struct xfs_mount *mp;
|
|
|
|
|
|
mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL);
|
|
mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL);
|
|
if (!mp)
|
|
if (!mp)
|
|
- goto out;
|
|
|
|
|
|
+ return NULL;
|
|
|
|
|
|
|
|
+ mp->m_super = sb;
|
|
spin_lock_init(&mp->m_sb_lock);
|
|
spin_lock_init(&mp->m_sb_lock);
|
|
|
|
+ spin_lock_init(&mp->m_agirotor_lock);
|
|
|
|
+ INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC);
|
|
|
|
+ spin_lock_init(&mp->m_perag_lock);
|
|
mutex_init(&mp->m_growlock);
|
|
mutex_init(&mp->m_growlock);
|
|
atomic_set(&mp->m_active_trans, 0);
|
|
atomic_set(&mp->m_active_trans, 0);
|
|
INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker);
|
|
INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker);
|
|
INIT_DELAYED_WORK(&mp->m_eofblocks_work, xfs_eofblocks_worker);
|
|
INIT_DELAYED_WORK(&mp->m_eofblocks_work, xfs_eofblocks_worker);
|
|
INIT_DELAYED_WORK(&mp->m_cowblocks_work, xfs_cowblocks_worker);
|
|
INIT_DELAYED_WORK(&mp->m_cowblocks_work, xfs_cowblocks_worker);
|
|
mp->m_kobj.kobject.kset = xfs_kset;
|
|
mp->m_kobj.kobject.kset = xfs_kset;
|
|
|
|
+ return mp;
|
|
|
|
+}
|
|
|
|
|
|
- mp->m_super = sb;
|
|
|
|
|
|
+
|
|
|
|
+STATIC int
|
|
|
|
+xfs_fs_fill_super(
|
|
|
|
+ struct super_block *sb,
|
|
|
|
+ void *data,
|
|
|
|
+ int silent)
|
|
|
|
+{
|
|
|
|
+ struct inode *root;
|
|
|
|
+ struct xfs_mount *mp = NULL;
|
|
|
|
+ int flags = 0, error = -ENOMEM;
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * allocate mp and do all low-level struct initializations before we
|
|
|
|
+ * attach it to the super
|
|
|
|
+ */
|
|
|
|
+ mp = xfs_mount_alloc(sb);
|
|
|
|
+ if (!mp)
|
|
|
|
+ goto out;
|
|
sb->s_fs_info = mp;
|
|
sb->s_fs_info = mp;
|
|
|
|
|
|
error = xfs_parseargs(mp, (char *)data);
|
|
error = xfs_parseargs(mp, (char *)data);
|