Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:userfaultfd_copy

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

Type:int

Parameter:

TypeParameterName
struct userfaultfd_ctx *ctx
unsigned longarg
1707  __user * user_uffdio_copy
1710  user_uffdio_copy = arg
1712  ret = -EAGAIN
1713  If READ_ONCE(memory mappings are changing because of non-cooperative event ) Then Go to out
1716  ret = -EFAULT
1717  If copy_from_user( & uffdio_copy, user_uffdio_copy, size of uffdio_copy - sizeof(__s64)) Then Go to out
1722  ret = validate_range(mm with one ore more vmas attached to this userfaultfd_ctx , & dst, len)
1723  If ret Then Go to out
1730  ret = -EINVAL
1731  If src + len <= src Then Go to out
1733  If mode & ~There will be a wrprotection flag later that allows to map* pages wrprotected on the fly. And such a flag will be* available if the wrprotection ioctl are implemented for the* range according to the uffdio_register.ioctls. Then Go to out
1735  If mmget_not_zero(mm with one ore more vmas attached to this userfaultfd_ctx ) Then
1736  ret = mcopy_atomic(mm with one ore more vmas attached to this userfaultfd_ctx , dst, src, len, & memory mappings are changing because of non-cooperative event )
1738  Decrement the use count and release all resources for an mm.
1739  Else
1740  Return -ESRCH
1742  If Value for the false possibility is greater at compile time(Write a simple value into user space(ret, & * "copy" 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
1744  If ret < 0 Then Go to out
1746  BUG_ON(!ret)
1748  len = ret
1749  If Not (mode & There will be a wrprotection flag later that allows to map* pages wrprotected on the fly. And such a flag will be* available if the wrprotection ioctl are implemented for the* range according to the uffdio_register.ioctls.) Then
1750  start = dst
1751  wake_userfault(ctx, & range)
1753  ret = If len == len Then 0 Else -EAGAIN
1754  out :
1755  Return ret
Caller
NameDescribe
userfaultfd_ioctl