Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:userfaultfd_release

Proto:static int userfaultfd_release(struct inode *inode, struct file *file)

Type:int

Parameter:

TypeParameterName
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  If Not mmget_not_zero(mm) Then Go to 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  When vma cycle
902  cond_resched()
903  BUG_ON(!!ctx ^ !!(Flags, see mm.h. & (missing pages tracking | wrprotect pages tracking )))
905  If ctx != ctx Then
906  prev = vma
907  Continue
909  new_flags = Flags, see mm.h. & ~(missing pages tracking | wrprotect pages tracking )
910  If still_valid Then
916  If prev Then vma = prev
918  Else 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  Return 0