From: Wang ShaoBo bobo.shaobowang@huawei.com
hulk inclusion category: feature bugzilla: 34278 CVE: NA
-------------------------------------------------
Code in resctrlfs.c is not shared with x86 RDT currently, but may be updated to support both in the future, so remove unrelated CONFIG for now to make code clearer.
Signed-off-by: Wang ShaoBo bobo.shaobowang@huawei.com Reviewed-by: Xiongfeng Wang wangxiongfeng2@huawei.com Reviewed-by: Cheng Jian cj.chengjian@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com Signed-off-by: Cheng Jian cj.chengjian@huawei.com --- fs/resctrlfs.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/fs/resctrlfs.c b/fs/resctrlfs.c index ebca3fb03e9a..eb7eec23096d 100644 --- a/fs/resctrlfs.c +++ b/fs/resctrlfs.c @@ -183,9 +183,7 @@ static int resctrl_group_create_info_dir(struct kernfs_node *parent_kn) unsigned long fflags; char name[32]; int ret; -#ifdef CONFIG_ARM64 enum resctrl_resource_level level; -#endif
/* create the directory */ kn_info = kernfs_create_dir(parent_kn, "info", parent_kn->mode, NULL); @@ -197,14 +195,10 @@ static int resctrl_group_create_info_dir(struct kernfs_node *parent_kn) if (ret) goto out_destroy;
-#ifdef CONFIG_ARM64 for (level = RDT_RESOURCE_SMMU; level < RDT_NUM_RESOURCES; level++) { r = mpam_resctrl_get_resource(level); if (!r) continue; -#else - for_each_resctrl_resource(r) { -#endif if (r->alloc_enabled) { fflags = r->fflags | RF_CTRL_INFO; ret = resctrl_group_mkdir_info_resdir(r, r->name, fflags); @@ -213,14 +207,10 @@ static int resctrl_group_create_info_dir(struct kernfs_node *parent_kn) } }
-#ifdef CONFIG_ARM64 for (level = RDT_RESOURCE_SMMU; level < RDT_NUM_RESOURCES; level++) { r = mpam_resctrl_get_resource(level); if (!r) continue; -#else - for_each_resctrl_resource(r) { -#endif if (r->mon_enabled) { fflags = r->fflags | RF_MON_INFO; snprintf(name, sizeof(name), "%s_MON", r->name); @@ -467,13 +457,11 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type, dentry = ERR_PTR(ret); goto out_options; } -#ifdef CONFIG_ARM64 ret = schemata_list_init(); if (ret) { dentry = ERR_PTR(ret); goto out_options; } -#endif ret = resctrl_id_init(); if (ret) { dentry = ERR_PTR(ret); @@ -496,7 +484,6 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type, } kernfs_get(kn_mongrp);
-#ifndef CONFIG_ARM64 /* [FIXME] arch specific code */ ret = mkdir_mondata_all_prepare(&resctrl_group_default); if (ret < 0) { dentry = ERR_PTR(ret); @@ -510,7 +497,6 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type, } kernfs_get(kn_mondata); resctrl_group_default.mon.mon_data_kn = kn_mondata; -#endif }
dentry = kernfs_mount(fs_type, flags, resctrl_root, @@ -523,11 +509,9 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type, goto out;
out_mondata: -#ifndef CONFIG_ARM64 /* [FIXME] arch specific code */ if (resctrl_mon_capable) kernfs_remove(kn_mondata); out_mongrp: -#endif if (resctrl_mon_capable) kernfs_remove(kn_mongrp); out_info: @@ -652,9 +636,8 @@ static void resctrl_kill_sb(struct super_block *sb) mutex_lock(&resctrl_group_mutex);
resctrl_resource_reset(); -#ifdef CONFIG_ARM64 + schemata_list_destroy(); -#endif
rmdir_all_sub(); static_branch_disable_cpuslocked(&resctrl_alloc_enable_key);