hulk inclusion category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/I9NZ3E
--------------------------------
resctrl_group_rm_ctrl() is only called in resctrl_group_rmdir_ctrl(), so merge resctrl_group_rm_ctrl() and resctrl_group_rmdir_ctrl() for the following fix patch. Also do the same on resctrl_group_rm_mon() and resctrl_group_rmdir_mon().
No functional change.
Signed-off-by: Yu Liao liaoyu15@huawei.com --- fs/resctrlfs.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/fs/resctrlfs.c b/fs/resctrlfs.c index a3354cd0e54a..dc084a03c1b2 100644 --- a/fs/resctrlfs.c +++ b/fs/resctrlfs.c @@ -954,7 +954,7 @@ static int resctrl_group_mkdir(struct kernfs_node *parent_kn, const char *name, return -EPERM; }
-static void resctrl_group_rm_mon(struct resctrl_group *rdtgrp, +static int resctrl_group_rmdir_mon(struct kernfs_node *kn, struct resctrl_group *rdtgrp, cpumask_var_t tmpmask) { struct resctrl_group *prdtgrp = rdtgrp->mon.parent; @@ -985,19 +985,14 @@ static void resctrl_group_rm_mon(struct resctrl_group *rdtgrp, */ WARN_ON(list_empty(&prdtgrp->mon.crdtgrp_list)); list_del(&rdtgrp->mon.crdtgrp_list); -} - -static int resctrl_group_rmdir_mon(struct kernfs_node *kn, struct resctrl_group *rdtgrp, - cpumask_var_t tmpmask) -{ - resctrl_group_rm_mon(rdtgrp, tmpmask);
kernfs_remove(rdtgrp->kn);
return 0; }
-static void resctrl_group_rm_ctrl(struct resctrl_group *rdtgrp, cpumask_var_t tmpmask) +static int resctrl_group_rmdir_ctrl(struct kernfs_node *kn, struct resctrl_group *rdtgrp, + cpumask_var_t tmpmask) { int cpu;
@@ -1033,12 +1028,6 @@ static void resctrl_group_rm_ctrl(struct resctrl_group *rdtgrp, cpumask_var_t tm free_all_child_rdtgrp(rdtgrp);
list_del(&rdtgrp->resctrl_group_list); -} - -static int resctrl_group_rmdir_ctrl(struct kernfs_node *kn, struct resctrl_group *rdtgrp, - cpumask_var_t tmpmask) -{ - resctrl_group_rm_ctrl(rdtgrp, tmpmask);
kernfs_remove(rdtgrp->kn);