Commit 5199766d authored by Chen Jun's avatar Chen Jun Committed by Zhong Jinghua
Browse files

mm/sharepool: use delete_spg_node to replace some repetitive code

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I650K6



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

delete_spg_node can be use to replace the code snippets as follows:
list_del(&node->proc_node);
spg->proc_num--;

Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
parent 8da9e85b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1666,8 +1666,7 @@ int mg_sp_group_del_task(int tgid, int spg_id)

	if (list_is_singular(&spg->procs))
		is_alive = spg->is_alive = false;
	spg->proc_num--;
	list_del(&spg_node->proc_node);
	delete_spg_node(spg, spg_node);
	sp_group_put(spg);
	up_write(&spg->rw_lock);
	if (!is_alive)
@@ -4151,8 +4150,7 @@ int sp_group_exit(void)
		/* a dead group should NOT be reactive again */
		if (spg_valid(spg) && list_is_singular(&spg->procs))
			is_alive = spg->is_alive = false;
		spg->proc_num--;
		list_del(&spg_node->proc_node);
		delete_spg_node(spg, spg_node);
		up_write(&spg->rw_lock);

		if (!is_alive)