| 函数逻辑报告 | 
| Source Code: fs\file.c | Create Date:2022-07-29 10:38:43 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| 首页 | 函数Tree | 
| 注解内核,赢得工具 | 下载SCCT | English | 
函数名称:Allocate a new files structure and copy contents from the* passed in files structure.* errorp will be valid only when the returned files_struct is NULL.
函数原型:struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
返回类型:struct files_struct
参数:
| 类型 | 参数 | 名称 | 
|---|---|---|
| struct files_struct * | oldf | |
| int * | errorp | 
| 284 | atomic_set( & ad mostly part, 1) | 
| 287 | resize_in_progress = false | 
| 288 | init_waitqueue_head( & resize_wait) | 
| 289 | next_fd等于0 | 
| 291 | max_fds等于The default fd array needs to be at least BITS_PER_LONG,* as this is the granularity returned by copy_fdset(). | 
| 293 | open_fds等于open_fds_init | 
| 295 | current fd array 等于fd_array[0] | 
| 297 | 加自旋锁 | 
| 298 | old_fdt等于files_fdtable(oldf) | 
| 304 | 当此条件成立可能性小(为编译器优化)(open_files > max_fds)循环 | 
| 305 | 自旋锁解锁 | 
| 307 | 如果new_fdt不等于fdtab则__free_fdtable(new_fdt) | 
| 310 | new_fdt等于alloc_fdtable(open_files - 1) | 
| 311 | 如果非new_fdt则 | 
| 313 | 转到:out_release | 
| 317 | 如果此条件成立可能性小(为编译器优化)(max_fds < open_files)则 | 
| 328 | 加自旋锁 | 
| 329 | old_fdt等于files_fdtable(oldf) | 
| 335 | old_fds等于 current fd array | 
| 336 | new_fds等于 current fd array | 
| 353 | 自旋锁解锁 | 
| 356 | memset(new_fds, 0, (max_fds - open_files) * *的长度) | 
| 360 | 返回:newf | 
| 362 | out_release : | 
| 364 | out : | 
| 365 | 返回:NULL | 
| 名称 | 描述 | 
|---|---|
| unshare_fd | Unshare file descriptor table if it is being shared | 
| copy_files | 复制打开文件信息 | 
| 源代码转换工具 开放的插件接口 | X | 
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |