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:Remove a fasync entry. If successfully removed, return* positive and clear the FASYNC flag. If no entry exists,* do nothing and return 0.* NOTE! It is very important that the FASYNC flag always* match the state "is the filp on a fasync list".

Proto:int fasync_remove_entry(struct file *filp, struct fasync_struct **fapp)

Type:int

Parameter:

TypeParameterName
struct file *filp
struct fasync_struct **fapp
870  result = 0
872  spin_lock( & * Protects f_ep_links, f_flags. * Must not be taken from IRQ context.)
873  spin_lock( & fasync_lock)
874  When (fa = * fp) != NULL cycle
875  If fa_file != filp Then Continue
878  write_lock_irq( & fa_lock)
879  fa_file = NULL
880  write_unlock_irq( & fa_lock)
882  fp = singly linked list
883  Post an RCU callback to be invoked after the end of an RCU grace* period. But since we have but one CPU, that would be after any* quiescent state.
884  f_flags &= ~FASYNC
885  result = 1
886  Break
888  spin_unlock( & fasync_lock)
889  spin_unlock( & * Protects f_ep_links, f_flags. * Must not be taken from IRQ context.)
890  Return result
Caller
NameDescribe
fasync_helperasync_helper() is used by almost all character device drivers* to set up the fasync queue, and for regular files by the file* lease code. It returns negative on error, 0 if it did no changes* and positive if it added/deleted the entry.