| Function report | 
| Source Code: fs\userfaultfd.c | Create Date:2022-07-28 20:20:34 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:userfaultfd_ctx_read
Proto:static ssize_t userfaultfd_ctx_read(struct userfaultfd_ctx *ctx, int no_wait, struct uffd_msg *msg)
Type:ssize_t
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct userfaultfd_ctx * | ctx | |
| int | no_wait | |
| struct uffd_msg * | msg | 
| 1039 | DECLARE_WAITQUEUE(wait, current process) | 
| 1048 | LIST_HEAD(fork_event) | 
| 1049 | struct userfaultfd_ctx * fork_nctx = NULL | 
| 1052 | spin_lock_irq( & lock) | 
| 1054 | cycle | 
| 1057 | uwq = find_userfault(ctx) | 
| 1058 | If uwq Then | 
| 1090 | add_wait_queue( & waitqueue head for the userfaults , & wq) | 
| 1096 | spin_unlock( & lock) | 
| 1097 | ret = 0 | 
| 1098 | Break | 
| 1100 | spin_unlock( & lock) | 
| 1103 | uwq = find_userfault_evt(ctx) | 
| 1104 | If uwq Then | 
| 1107 | If event == UFFD_EVENT_FORK Then | 
| 1123 | userfaultfd_event_complete(ctx, uwq) | 
| 1124 | spin_unlock( & lock) | 
| 1125 | ret = 0 | 
| 1126 | Break | 
| 1128 | spin_unlock( & lock) | 
| 1130 | If signal_pending(current process) Then | 
| 1132 | Break | 
| 1134 | If no_wait Then | 
| 1138 | spin_unlock_irq( & lock) | 
| 1139 | schedule() | 
| 1140 | spin_lock_irq( & lock) | 
| 1144 | spin_unlock_irq( & lock) | 
| 1146 | If Not ret && event == UFFD_EVENT_FORK Then | 
| 1147 | ret = resolve_userfault_fork(ctx, fork_nctx, msg) | 
| 1148 | spin_lock_irq( & lock) | 
| 1149 | If Not list_empty - tests whether a list is empty*@head: the list to test. Then | 
| 1170 | __add_wait_queue( & waitqueue head for events , & wq) | 
| 1177 | If Value is more likely to compile time(!ret) Then userfaultfd_event_complete(ctx, uwq) | 
| 1179 | Else | 
| 1194 | spin_unlock_irq( & lock) | 
| 1197 | Return ret | 
| Name | Describe | 
|---|---|
| userfaultfd_read | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |