Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Insert a new entry into the fasync list. Return the pointer to the* old one if we didn't use the new one.* NOTE! It is very important that the FASYNC flag always* match the state "is the filp on a fasync list".

Proto:struct fasync_struct *fasync_insert_entry(int fd, struct file *filp, struct fasync_struct **fapp, struct fasync_struct *new)

Type:struct fasync_struct

Parameter:

TypeParameterName
intfd
struct file *filp
struct fasync_struct **fapp
struct fasync_struct *new
919  spin_lock( & * Protects f_ep_links, f_flags. * Must not be taken from IRQ context.)
920  spin_lock( & fasync_lock)
921  When (fa = * fp) != NULL cycle
922  If fa_file != filp Then Continue
925  write_lock_irq( & fa_lock)
926  fa_fd = fd
927  write_unlock_irq( & fa_lock)
928  Go to out
931  rwlock_init( & fa_lock)
932  magic = FASYNC_MAGIC
933  fa_file = filp
934  fa_fd = fd
935  singly linked list = fapp
936  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( * fapp, new)
937  f_flags |= FASYNC
939  out :
940  spin_unlock( & fasync_lock)
941  spin_unlock( & * Protects f_ep_links, f_flags. * Must not be taken from IRQ context.)
942  Return fa
Caller
NameDescribe
fasync_add_entryAdd a fasync entry. Return negative on error, positive if* added, and zero if did nothing but change an existing one.
lease_setup