函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\userfaultfd.c Create Date:2022-07-29 10:52:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:userfaultfd_release

函数原型:static int userfaultfd_release(struct inode *inode, struct file *file)

返回类型:int

参数:

类型参数名称
struct inode *inode
struct file *file
877  ctx等于 needed for tty driver, and maybe others
878  mm等于mm with one ore more vmas attached to this userfaultfd_ctx
881  struct userfaultfd_wake_range range = {len = 0, }
885  WRITE_ONCE(leased , true)
887  如果非mmget_not_zero(mm)则转到:wakeup
898  lock for writing
899  still_valid等于This has to be called after a get_task_mm()/mmget_not_zero()* followed by taking the mmap_sem for writing before modifying the* vmas or anything the coredump pretends not to change from under it
900  prev = NULL
901 vma循环
902  cond_resched()
903  BUG_ON(!!ctx ^ !!(Flags, see mm.h. & (missing pages tracking | wrprotect pages tracking )))
905  如果ctx不等于ctx
906  prev等于vma
907  继续下一循环
909  new_flags等于Flags, see mm.h. 按位与missing pages tracking 按位或wrprotect pages tracking 的值的反
910  如果still_valid
916  如果prevvma等于prev
918  否则prev等于vma
921  Flags, see mm.h. 等于new_flags
922  vm_userfaultfd_ctx等于NULL_VM_UFFD_CTX
924  lease a write lock
925  Decrement the use count and release all resources for an mm.
926  wakeup :
932  spin_lock_irq( & lock)
933  __wake_up_locked_key( & waitqueue head for the pending (i.e. not read) userfaults , Convenience macros for the sake of wake_up(): , & range)
934  __wake_up - wake up threads blocked on a waitqueue
935  spin_unlock_irq( & lock)
938  wake_up_all( & waitqueue head for events )
940  wake_up_poll( & waitqueue head for the pseudo fd to wakeup poll/read , EPOLLHUP)
941  serfaultfd_ctx_put - Releases a reference to the internal userfaultfd* context.*@ctx: [in] Pointer to userfaultfd context.* The userfaultfd context reference must have been previously acquired either* with userfaultfd_ctx_get() or userfaultfd_ctx_fdget().
942  返回:0