Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:SYSCALL_DEFINE1

Proto:SYSCALL_DEFINE1(userfaultfd, int, flags)

Type:

Parameter:Nothing

1951  If Not sysctl_unprivileged_userfaultfd && Not Check operation authority Then Return -EPERM
1954  BUG_ON(!mm)
1957  BUILD_BUG_ON - break compile if a condition is true(CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining* new flags, since they might collide with O_* ones. We want* to re-use O_* flags that couldn't possibly have a meaning* from userfaultfd, in order to leave a free define-space for != O_CLOEXEC)
1958  BUILD_BUG_ON - break compile if a condition is true(UFFD_NONBLOCK != O_NONBLOCK)
1960  If flags & ~UFFD_SHARED_FCNTL_FLAGS Then Return -EINVAL
1963  ctx = kmem_cache_alloc(userfaultfd_ctx_cachep, GFP_KERNEL)
1964  If Not ctx Then Return -ENOMEM
1967  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
1968  userfaultfd syscall flags = flags
1969  atures requested from the userspace = 0
1970  state machine = UFFD_STATE_WAIT_API
1971  leased = false
1972  memory mappings are changing because of non-cooperative event = false
1973  mm with one ore more vmas attached to this userfaultfd_ctx = mm
1975  mmgrab() - Pin a &struct mm_struct
1977  fd = anon_inode_getfd - creates a new file instance by hooking it up to an* anonymous inode, and a dentry that describe the "class"* of the file*@name: [in] name of the "class" of the new file*@fops: [in] file operations for the new file*@priv: [in] private
1979  If fd < 0 Then
1980  mmdrop(mm with one ore more vmas attached to this userfaultfd_ctx )
1981  kmem_cache_free(userfaultfd_ctx_cachep, ctx)
1983  Return fd