函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\resctrl\rdtgroup.c Create Date:2022-07-27 09:12:07
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:mkdir_rdt_prepare

函数原型:static int mkdir_rdt_prepare(struct kernfs_node *parent_kn, struct kernfs_node *prgrp_kn, const char *name, umode_t mode, enum rdt_group_type rtype, struct rdtgroup **r)

返回类型:int

参数:

类型参数名称
struct kernfs_node *parent_kn
struct kernfs_node *prgrp_kn
const char *name
umode_tmode
enum rdt_group_typertype
struct rdtgroup **r
2653  files等于0
2656  prdtgrp等于rdtgroup_kn_lock_live(parent_kn)
2657  如果非prdtgrp
2658  ret等于负ENODEV
2659  转到:out_unlock
2662  如果rtype恒等于RDTMON_GROUPmode恒等于RDT_MODE_PSEUDO_LOCKSETUPmode恒等于RDT_MODE_PSEUDO_LOCKED的值则
2665  ret等于负EINVAL
2666  rdt_last_cmd_puts("Pseudo-locking in progress\n")
2667  转到:out_unlock
2671  rdtgrp等于分配内存并置零
2672  如果非rdtgrp
2673  ret等于负ENOSPC
2674  rdt_last_cmd_puts("Kernel out of memory\n")
2675  转到:out_unlock
2677  r等于rdtgrp
2678  parent等于prdtgrp
2679  type等于rtype
2680  初始化链表头
2683  kn等于kernfs_create_dir(parent_kn, name, mode, rdtgrp)
2684  如果是错误
2685  ret等于错误
2686  rdt_last_cmd_puts("kernfs create error\n")
2687  转到:out_free_rgrp
2689  kn等于kn
2697  kernfs_get(kn)
2699  ret等于set uid and gid of rdtgroup dirs and files to that of the creator
2700  如果ret
2701  rdt_last_cmd_puts("kernfs perm error\n")
2702  转到:out_destroy
2705  files等于RFTYPE_BASE按位或BIT(RF_CTRLSHIFT + rtype)
2706  ret等于rdtgroup_add_files(kn, files)
2707  如果ret
2708  rdt_last_cmd_puts("kernfs fill error\n")
2709  转到:out_destroy
2712  如果rdt_mon_capable
2713  ret等于alloc_rmid()
2714  如果ret小于0则
2715  rdt_last_cmd_puts("Out of RMIDs\n")
2716  转到:out_destroy
2718  rmid等于ret
2720  ret等于This creates a directory mon_data which contains the monitored data
2721  如果ret
2722  rdt_last_cmd_puts("kernfs subdir error\n")
2723  转到:out_idfree
2726  kernfs_activate(kn)
2731  返回:0
2733  out_idfree :
2734  free_rmid(rmid)
2735  out_destroy :
2736  kernfs_remove(kn)
2737  out_free_rgrp :
2738  释放内存
2739  out_unlock :
2740  rdtgroup_kn_unlock(parent_kn)
2741  返回:ret
调用者
名称描述
rdtgroup_mkdir_monCreate a monitor group under "mon_groups" directory of a control* and monitor group(ctrl_mon). This is a resource group* to monitor a subset of tasks and cpus in its parent ctrl_mon group.
rdtgroup_mkdir_ctrl_monThese are rdtgroups created under the root directory. Can be used* to allocate and monitor resources.