函数逻辑报告 |
Source Code:fs\userfaultfd.c |
Create Date:2022-07-29 10:52:38 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:userfaultfd_register
函数原型:static int userfaultfd_register(struct userfaultfd_ctx *ctx, unsigned long arg)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct userfaultfd_ctx * | ctx | |
unsigned long | arg |
1315 | user_uffdio_register等于arg |
1318 | 如果copy_from_user( & uffdio_register, user_uffdio_register, uffdio_register的长度 - sizeof(__u64))则转到:out |
1325 | 如果mode按位与UFFDIO_REGISTER_MODE_MISSING按位或UFFDIO_REGISTER_MODE_WP的值的反则转到:out |
1328 | vm_flags等于0 |
1331 | 如果mode按位与UFFDIO_REGISTER_MODE_WP则 |
1341 | ret等于validate_range(mm, & start, len) |
1350 | 如果非mmget_not_zero(mm)则转到:out |
1353 | lock for writing |
1357 | 如果非vma则转到:out_unlock |
1362 | 如果Our start address within vm_mm. 大于等于end则转到:out_unlock |
1369 | 如果is_vm_hugetlb_page(vma)则 |
1370 | vma_hpagesize等于Return the size of the pages allocated when backing a VMA. In the majority* cases this will be same size as used by the page table entries. |
1372 | 如果start按位与vma_hpagesize减1则转到:out_unlock |
1379 | found = false |
1380 | basic_ioctls = false |
1381 | 以cur且Our start address within vm_mm. 小于end循环 |
1382 | cond_resched() |
1384 | BUG_ON(!!ctx ^ !!(Flags, see mm.h. & (missing pages tracking | wrprotect pages tracking ))) |
1389 | 如果非vma_can_userfault(cur)则转到:out_unlock |
1401 | 如果此条件成立可能性小(为编译器优化)(!(Flags, see mm.h. & VM_MAYWRITE))则转到:out_unlock |
1410 | vma_hpagesize等于Return the size of the pages allocated when backing a VMA. In the majority* cases this will be same size as used by the page table entries. |
1414 | 如果end按位与vma_hpagesize减1则转到:out_unlock |
1425 | 如果ctx且ctx不等于ctx则转到:out_unlock |
1432 | 如果is_vm_hugetlb_page(cur)则basic_ioctls = true |
1435 | found = true |
1439 | 如果Our start address within vm_mm. 小于start则prev等于vma |
1442 | ret等于0 |
1443 | 循环 |
1444 | cond_resched() |
1446 | BUG_ON(!vma_can_userfault(vma)) |
1449 | WARN_ON(!(Flags, see mm.h. & VM_MAYWRITE)) |
1463 | new_flags等于Flags, see mm.h. 按位与missing pages tracking 按位或wrprotect pages tracking 的值的反按位或vm_flags |
1465 | prev等于Given a mapping request (addr,end,vm_flags,file,pgoff), figure out* whether that can be merged with its predecessor or its successor |
1469 | 如果prev则 |
1473 | 如果Our start address within vm_mm. 小于start则 |
1483 | next : |
1489 | Flags, see mm.h. 等于new_flags |
1492 | skip : |
1496 | 当vma且Our start address within vm_mm. 小于end循环 |
1497 | out_unlock : |
1498 | lease a write lock |
1500 | 如果非ret则 |
1511 | out : |
1512 | 返回:ret |
名称 | 描述 |
---|---|
userfaultfd_ioctl |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |