Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\file_table.c Create Date:2022-07-28 20:01:52
Last Modify:2020-03-18 10:20:10 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:he real guts of fput() - releasing the last reference to file

Proto:static void __fput(struct file *file)

Type:void

Parameter:

TypeParameterName
struct file *file
256  dentry = dentry
257  mnt = mnt
258  inode = cached value
259  mode = f_mode
261  If Value for the false possibility is greater at compile time(!(f_mode & FMODE_OPENED)) Then Go to out
264  might_sleep()
266  snotify_close - file was closed
271  This is called from inside fs/file_table.c:__fput() to unlink files* from the eventpoll interface. We need to have this facility to cleanup* correctly files that are closed without being removed from the eventpoll* interface.
272  locks_remove_file(file)
274  ima_file_free(file)
275  If Value for the false possibility is greater at compile time(f_flags & FASYNC) Then
276  If fasync Then fasync( - 1, file, 0)
279  If release Then release(inode, file)
281  If Value for the false possibility is greater at compile time(S_ISCHR(i_mode) && i_cdev != NULL && !(mode & File is opened with O_PATH; almost nothing can be done with it )) Then
283  cdev_put(i_cdev)
285  fops_put(f_op)
286  put_pid( pid or -pgrp where SIGIO should be sent )
287  If (mode & (le is open for reading | le is open for writing )) == le is open for reading Then i_readcount_dec(inode)
289  If mode & Write access to underlying fs Then
290  releases this write permission
291  __mnt_drop_write(mnt)
293  dput(dentry)
294  If Value for the false possibility is greater at compile time(mode & File represents mount that needs unmounting ) Then dissolve_on_fput(mnt)
296  mntput(mnt)
297  out :
298  file_free(file)
Caller
NameDescribe
delayed_fput
____fput
__fput_syncsynchronous analog of fput(); for kernel threads that might be needed* in some umount() (and thus can't use flush_delayed_fput() without* risking deadlocks), need to wait for completion of __fput() and know* for this specific struct file it won't involve