Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\file.c Create Date:2022-07-28 20:08:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:variant of __close_fd that gets a ref on the file for later fput

Proto:int __close_fd_get_file(unsigned int fd, struct file **res)

Type:int

Parameter:

TypeParameterName
unsigned intfd
struct file **res
649  files = files
653  spin_lock( & written part on a separate cache line in SMP)
654  fdt = files_fdtable(files)
655  If fd >= max_fds Then Go to out_unlock
657  file = current fd array [fd]
658  If Not file Then Go to out_unlock
660  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], NULL)
661  __put_unused_fd(files, fd)
662  spin_unlock( & written part on a separate cache line in SMP)
663  get_file(file)
664  res = file
665  Return "id" is the POSIX thread ID. We use the* files pointer for this..
667  out_unlock :
668  spin_unlock( & written part on a separate cache line in SMP)
669  * res = NULL
670  Return -ENOENT