函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Install a file pointer in the fd array.* The VFS is full of places where we drop the files lock between* setting the open_fds bitmap and installing the file in the file* array. At any such point, we are vulnerable to a dup2() race

函数原型:void __fd_install(struct files_struct *files, unsigned int fd, struct file *file)

返回类型:void

参数:

类型参数名称
struct files_struct *files
unsigned intfd
struct file *file
592  _read_lock_sched() - mark the beginning of a RCU-sched critical section* This is equivalent of rcu_read_lock(), but disables preemption.* Read-side critical sections can also be introduced by anything else
594  如果此条件成立可能性小(为编译器优化)(resize_in_progress)则
595  标记rcu锁结束
596  加自旋锁
597  fdt等于files_fdtable(files)
598  BUG_ON( current fd array [fd] != NULL)
599  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization( current fd array [fd], file)
600  自旋锁解锁
601  返回
604  smp_rmb()
605  fdt等于cu_dereference_sched() - fetch RCU-sched-protected pointer for dereferencing*@p: The pointer to read, prior to dereferencing* Makes rcu_dereference_check() do the dirty work.(fdt)
606  BUG_ON( current fd array [fd] != NULL)
607  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization( current fd array [fd], file)
608  标记rcu锁结束
调用者
名称描述
fd_install