函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\userfaultfd.c Create Date:2022-07-29 10:52:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:userfaultfd_copy

函数原型:static int userfaultfd_copy(struct userfaultfd_ctx *ctx, unsigned long arg)

返回类型:int

参数:

类型参数名称
struct userfaultfd_ctx *ctx
unsigned longarg
1707  __useruser_uffdio_copy
1710  user_uffdio_copy等于arg
1712  ret等于负EAGAIN
1713  如果READ_ONCE(memory mappings are changing because of non-cooperative event )则转到:out
1716  ret等于负EFAULT
1717  如果copy_from_user( & uffdio_copy, user_uffdio_copy, uffdio_copy的长度 - sizeof(__s64))则转到:out
1722  ret等于validate_range(mm with one ore more vmas attached to this userfaultfd_ctx , & dst, len)
1723  如果ret则转到:out
1730  ret等于负EINVAL
1731  如果srclen小于等于src则转到:out
1733  如果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.的反则转到:out
1735  如果mmget_not_zero(mm with one ore more vmas attached to this userfaultfd_ctx )则
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  否则
1740  返回:负ESRCH
1742  如果此条件成立可能性小(为编译器优化)(put_user - 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.))则返回:负EFAULT
1744  如果ret小于0则转到:out
1746  BUG_ON(!ret)
1748  len等于ret
1749  如果非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.的值则
1750  start等于dst
1751  wake_userfault(ctx, & range)
1753  ret等于如果len恒等于len则0否则负EAGAIN
1754  out :
1755  返回:ret
调用者
名称描述
userfaultfd_ioctl