函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\file.c Create Date:2022-07-29 10:38:43
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Expand files.* This function will expand the file structures, if the requested size exceeds* the current capacity and there is room for expansion.* Return <0 error code on error; 0 when nothing done; 1 when files were

函数原型:static int expand_files(struct files_struct *files, unsigned int nr)__releases(files->file_lock) __acquires(files->file_lock)

返回类型:int

参数:

类型参数名称
struct files_struct *files
unsigned intnr
198  expanded等于0
200  repeat :
201  fdt等于files_fdtable(files)
204  如果nr小于max_fds则返回:expanded
208  如果nr大于等于sysctl_nr_open则返回:负EMFILE
211  如果此条件成立可能性小(为编译器优化)(resize_in_progress)则
212  自旋锁解锁
213  expanded等于1
214  wait_event - sleep until a condition gets true*@wq_head: the waitqueue to wait on*@condition: a C expression for the event to wait for* The process is put to sleep (TASK_UNINTERRUPTIBLE) until the*@condition evaluates to true(resize_wait, !resize_in_progress)
215  加自旋锁
216  转到:repeat
220  resize_in_progress = true
221  expanded等于Expand the file descriptor table.* This function will allocate a new fdtable and both fd array and fdset, of* the given size.* Return <0 error code on error; 1 on successful completion.
222  resize_in_progress = false
224  wake_up_all( & resize_wait)
225  返回:expanded
调用者
名称描述
__alloc_fdallocate a file descriptor, mark it busy.
replace_fd
ksys_dup3