|
@@ -126,6 +126,27 @@ static void closid_free(int closid)
|
|
|
closid_free_map |= 1 << closid;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * rdtgroup_mode_by_closid - Return mode of resource group with closid
|
|
|
+ * @closid: closid if the resource group
|
|
|
+ *
|
|
|
+ * Each resource group is associated with a @closid. Here the mode
|
|
|
+ * of a resource group can be queried by searching for it using its closid.
|
|
|
+ *
|
|
|
+ * Return: mode as &enum rdtgrp_mode of resource group with closid @closid
|
|
|
+ */
|
|
|
+enum rdtgrp_mode rdtgroup_mode_by_closid(int closid)
|
|
|
+{
|
|
|
+ struct rdtgroup *rdtgrp;
|
|
|
+
|
|
|
+ list_for_each_entry(rdtgrp, &rdt_all_groups, rdtgroup_list) {
|
|
|
+ if (rdtgrp->closid == closid)
|
|
|
+ return rdtgrp->mode;
|
|
|
+ }
|
|
|
+
|
|
|
+ return RDT_NUM_MODES;
|
|
|
+}
|
|
|
+
|
|
|
/* set uid and gid of rdtgroup dirs and files to that of the creator */
|
|
|
static int rdtgroup_kn_set_ugid(struct kernfs_node *kn)
|
|
|
{
|
|
@@ -1491,6 +1512,7 @@ static void rdt_kill_sb(struct super_block *sb)
|
|
|
reset_all_ctrls(r);
|
|
|
cdp_disable_all();
|
|
|
rmdir_all_sub();
|
|
|
+ rdtgroup_default.mode = RDT_MODE_SHAREABLE;
|
|
|
static_branch_disable_cpuslocked(&rdt_alloc_enable_key);
|
|
|
static_branch_disable_cpuslocked(&rdt_mon_enable_key);
|
|
|
static_branch_disable_cpuslocked(&rdt_enable_key);
|