Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:dup_userfaultfd

Proto:int dup_userfaultfd(struct vm_area_struct *vma, struct list_head *fcs)

Type:int

Parameter:

TypeParameterName
struct vm_area_struct *vma
struct list_head *fcs
673  ctx = NULL
676  octx = ctx
677  If Not octx || Not (atures requested from the userspace & UFFD_FEATURE_EVENT_FORK) Then
678  vm_userfaultfd_ctx = NULL_VM_UFFD_CTX
679  Flags, see mm.h. &= ~(wrprotect pages tracking | missing pages tracking )
680  Return 0
683  list_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the list_head within the struct.(fctx, fcs, list)
684  If orig == octx Then
685  ctx = new
686  Break
689  If Not ctx Then
690  fctx = Allocation memory
691  If Not fctx Then Return -ENOMEM
694  ctx = kmem_cache_alloc(userfaultfd_ctx_cachep, GFP_KERNEL)
695  If Not ctx Then
696  kfree(fctx)
697  Return -ENOMEM
700  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
701  userfaultfd syscall flags = userfaultfd syscall flags
702  state machine = UFFD_STATE_RUNNING
703  atures requested from the userspace = atures requested from the userspace
704  leased = false
705  memory mappings are changing because of non-cooperative event = false
706  mm with one ore more vmas attached to this userfaultfd_ctx = The address space we belong to.
707  mmgrab() - Pin a &struct mm_struct
709  serfaultfd_ctx_get - Acquires a reference to the internal userfaultfd* context.*@ctx: [in] Pointer to the userfaultfd context.
710  WRITE_ONCE(memory mappings are changing because of non-cooperative event , true)
711  orig = octx
712  new = ctx
713  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
716  ctx = ctx
717  Return 0