“a07972c0d0db75d412efb6099ba8a4d754b3a102”上不存在“...java/git@gitcode.net:openanolis/dragonwell8_jdk.git”
提交 d0d4289e 编写于 作者: L Long Li 提交者: openeuler-sync-bot

xfs: factor out xfs_destroy_perag()

Offering: HULK
hulk inclusion
category: bugfix
bugzilla: 188878, https://gitee.com/openeuler/kernel/issues/I76JSK

--------------------------------

Factor out xfs_destroy_perag() from xfs_initialize_perag() for error
handle, delete perag from radix tree requires lock protection, just like
any other places where perag tree are modified.
Signed-off-by: NLong Li <leo.lilong@huawei.com>
(cherry picked from commit 42297cd9)
上级 c5b8a94f
...@@ -173,6 +173,27 @@ xfs_sb_validate_fsb_count( ...@@ -173,6 +173,27 @@ xfs_sb_validate_fsb_count(
return 0; return 0;
} }
void
xfs_destroy_perag(
xfs_mount_t *mp,
xfs_agnumber_t agstart,
xfs_agnumber_t agend)
{
xfs_agnumber_t index;
xfs_perag_t *pag;
for (index = agstart; index < agend; index++) {
spin_lock(&mp->m_perag_lock);
pag = radix_tree_delete(&mp->m_perag_tree, index);
spin_unlock(&mp->m_perag_lock);
if (!pag)
break;
xfs_buf_hash_destroy(pag);
xfs_iunlink_destroy(pag);
kmem_free(pag);
}
}
int int
xfs_initialize_perag( xfs_initialize_perag(
xfs_mount_t *mp, xfs_mount_t *mp,
...@@ -252,14 +273,7 @@ xfs_initialize_perag( ...@@ -252,14 +273,7 @@ xfs_initialize_perag(
kmem_free(pag); kmem_free(pag);
out_unwind_new_pags: out_unwind_new_pags:
/* unwind any prior newly initialized pags */ /* unwind any prior newly initialized pags */
for (index = first_initialised; index < agcount; index++) { xfs_destroy_perag(mp, first_initialised, agcount);
pag = radix_tree_delete(&mp->m_perag_tree, index);
if (!pag)
break;
xfs_buf_hash_destroy(pag);
xfs_iunlink_destroy(pag);
kmem_free(pag);
}
return error; return error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册