函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\file_table.c Create Date:2022-07-29 10:31:54
Last Modify:2020-03-18 10:20:10 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__alloc_file

函数原型:static struct file *__alloc_file(int flags, const struct cred *cred)

返回类型:struct file

参数:

类型参数名称
intflags
const struct cred *cred
101  f等于Shortcuts
102  如果此条件成立可能性小(为编译器优化)(!f)则返回:错误号
105  f_cred等于get_cred - Get a reference on a set of credentials*@cred: The credentials to reference* Get a reference on the specified set of credentials. The caller must* release the reference. If %NULL is passed, it is returned with no action.
106  error等于security_file_alloc(f)
107  如果此条件成立可能性小(为编译器优化)(error)则
108  file_free_rcu( & fu_rcuhead)
109  返回:错误号
112  atomic_long_set( & f_count, 1)
113  rwlock_init( & lock)
114  spin_lock_init( & * Protects f_ep_links, f_flags. * Must not be taken from IRQ context.)
115  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & f_pos_lock)
116  Used to initialize the epoll bits inside the "struct file"
117  f_flags等于flags
118  f_mode等于OPEN_FMODE(flags)
121  返回:f
调用者
名称描述
alloc_empty_fileFind an unused file structure and return a pointer to it
alloc_empty_file_noaccountVariant of alloc_empty_file() that doesn't check and modify nr_files.* Should not be used unless there's a very good reason to do so.