函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\percpu-refcount.c Create Date:2022-07-27 07:22:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:percpu_ref_init - initialize a percpu refcount*@ref: percpu_ref to initialize*@release: function which will be called when refcount hits 0*@flags: PERCPU_REF_INIT_* flags*@gfp: allocation mask to use* Initializes @ref

函数原型:int percpu_ref_init(struct percpu_ref *ref, percpu_ref_func_t *release, unsigned int flags, gfp_t gfp)

返回类型:int

参数:

类型参数名称
struct percpu_ref *ref
percpu_ref_func_t *release
unsigned intflags
gfp_tgfp
63  align等于max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, 1 << __PERCPU_REF_FLAG_BITS, __alignof__(unsignedlong))
65  start_count等于0
67  * The low bit of the pointer indicates whether the ref is in percpu * mode; if set, then get/put will manipulate the atomic_t.等于__alloc_percpu_gfp(sizeof(unsignedlong), align, gfp)
69  如果非* The low bit of the pointer indicates whether the ref is in percpu * mode; if set, then get/put will manipulate the atomic_t.则返回:负ENOMEM
72  force_atomic等于flags按位与PERCPU_REF_INIT_ATOMIC
73  allow_reinit等于flags按位与PERCPU_REF_ALLOW_REINIT
75  如果flags按位与PERCPU_REF_INIT_ATOMIC按位或PERCPU_REF_INIT_DEAD的值则
76  * The low bit of the pointer indicates whether the ref is in percpu * mode; if set, then get/put will manipulate the atomic_t.或等于__PERCPU_REF_ATOMIC
77  allow_reinit = true
78  否则
79  start_count加等于Initially, a percpu refcount is just a set of percpu counters
82  如果flags按位与PERCPU_REF_INIT_DEAD* The low bit of the pointer indicates whether the ref is in percpu * mode; if set, then get/put will manipulate the atomic_t.或等于__PERCPU_REF_DEAD
84  否则start_count自加
87  atomic_long_set( & count, start_count)
89  release等于release
90  confirm_switch = NULL
91  返回:0
调用者
名称描述
css_create
cgroup_createThe returned cgroup is fully initialized including its control mask, but* it isn't associated with its kernfs_node and doesn't have the control* mask applied.
cgroup_bpf_inheritgroup_bpf_inherit() - inherit effective programs from parent*@cgrp: the cgroup to modify
blkg_alloclkg_alloc - allocate a blkg*@blkcg: block cgroup the new blkg is associated with*@q: request_queue the new blkg is associated with*@gfp_mask: allocation mask to use* Allocate a new blkg assocating @blkcg and @q.
ioctx_allocx_alloc* Allocates and initializes an ioctx. Returns an ERR_PTR if it failed.
io_ring_ctx_alloc
cgroup_setup_root
hd_ref_init
blk_alloc_queue_nodelk_alloc_queue_node - allocate a request queue*@gfp_mask: memory allocation flags*@node_id: NUMA node to allocate memory from