Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\file_table.c Create Date:2022-07-28 20:01:51
Last Modify:2020-03-18 10:20:10 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Find an unused file structure and return a pointer to it

Proto:struct file *alloc_empty_file(int flags, const struct cred *cred)

Type:struct file

Parameter:

TypeParameterName
intflags
const struct cred *cred
142  If Return the total number of open files in the system >= unable && Not Check operation authority Then
147  If percpu_counter_sum_positive( & nr_files) >= unable Then Go to over
151  f = __alloc_file(flags, cred)
152  If Not IS_ERR(f) Then percpu_counter_inc( & nr_files)
155  Return f
157  over :
159  If Return the total number of open files in the system > old_max Then
160  pr_info("VFS: file-max limit %lu reached\n", Return the maximum number of open files in the system)
161  old_max = Return the total number of open files in the system
163  Return ERR_PTR( - ENFILE)
Caller
NameDescribe
alloc_filealloc_file - allocate and initialize a 'struct file'*@path: the (dentry, vfsmount) pair for the new file*@flags: O_... flags with which the new file will be opened*@fop: the 'struct file_operations' for the new file
path_openat