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:userfaultfd_zeropage

Proto:static int userfaultfd_zeropage(struct userfaultfd_ctx *ctx, unsigned long arg)

Type:int

Parameter:

TypeParameterName
struct userfaultfd_ctx *ctx
unsigned longarg
1763  __user * user_uffdio_zeropage
1766  user_uffdio_zeropage = arg
1768  ret = -EAGAIN
1769  If READ_ONCE(memory mappings are changing because of non-cooperative event ) Then Go to out
1772  ret = -EFAULT
1773  If copy_from_user( & uffdio_zeropage, user_uffdio_zeropage, size of uffdio_zeropage - sizeof(__s64)) Then Go to out
1778  ret = validate_range(mm with one ore more vmas attached to this userfaultfd_ctx , & start, len)
1780  If ret Then Go to out
1782  ret = -EINVAL
1783  If mode & ~UFFDIO_ZEROPAGE_MODE_DONTWAKE Then Go to out
1786  If mmget_not_zero(mm with one ore more vmas attached to this userfaultfd_ctx ) Then
1787  ret = mfill_zeropage(mm with one ore more vmas attached to this userfaultfd_ctx , start, len, & memory mappings are changing because of non-cooperative event )
1790  Decrement the use count and release all resources for an mm.
1791  Else
1792  Return -ESRCH
1794  If Value for the false possibility is greater at compile time(Write a simple value into user space(ret, & * "zeropage" is written by the ioctl and must be at the end: * the copy_from_user will not read the last 8 bytes.)) Then Return -EFAULT
1796  If ret < 0 Then Go to out
1799  BUG_ON(!ret)
1800  len = ret
1801  If Not (mode & UFFDIO_ZEROPAGE_MODE_DONTWAKE) Then
1802  start = start
1803  wake_userfault(ctx, & range)
1805  ret = If len == len Then 0 Else -EAGAIN
1806  out :
1807  Return ret
Caller
NameDescribe
userfaultfd_ioctl