函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\file_table.c Create Date:2022-07-29 10:31:55
Last Modify:2020-03-18 10:20:10 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:he real guts of fput() - releasing the last reference to file

函数原型:static void __fput(struct file *file)

返回类型:void

参数:

类型参数名称
struct file *file
256  dentry等于dentry
257  mnt等于mnt
258  inode等于 cached value
259  mode等于f_mode
261  如果此条件成立可能性小(为编译器优化)(!(f_mode & FMODE_OPENED))则转到: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  如果此条件成立可能性小(为编译器优化)(f_flags & FASYNC)则
276  如果fasyncfasync( - 1, file, 0)
279  如果releaserelease(inode, file)
281  如果此条件成立可能性小(为编译器优化)(S_ISCHR(i_mode) && i_cdev != NULL && !(mode & File is opened with O_PATH; almost nothing can be done with it ))则
283  cdev_put(i_cdev)
285  fops_put(f_op)
286  put_pid( pid or -pgrp where SIGIO should be sent )
287  如果mode按位与le is open for reading 按位或le is open for writing 的值的值恒等于le is open for reading i_readcount_dec(inode)
289  如果mode按位与Write access to underlying fs
290  put_write_access(inode)
291  __mnt_drop_write(mnt)
293  dput(dentry)
294  如果此条件成立可能性小(为编译器优化)(mode & File represents mount that needs unmounting )则dissolve_on_fput(mnt)
296  mntput(mnt)
297  out :
298  file_free(file)
调用者
名称描述
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