Function report |
Source Code:mm\mempolicy.c |
Create Date:2022-07-28 15:32:04 |
| Last Modify:2020-03-17 22:28:11 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Copy a node mask from user space.
Proto:static int get_nodes(nodemask_t *nodes, const unsigned long __user *nmask, unsigned long maxnode)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| nodemask_t * | nodes | |
| const unsigned long __user * | nmask | |
| unsigned long | maxnode |
| 1350 | --maxnode |
| 1351 | nodes_clear( * nodes) |
| 1354 | If maxnode > PAGE_SIZE * BITS_PER_BYTE Then Return -EINVAL |
| 1357 | nlongs = BITS_TO_LONGS(maxnode) |
| 1358 | If maxnode % BITS_PER_LONG == 0 Then endmask = ~0UL |
| 1360 | Else endmask = (1UL << maxnode % BITS_PER_LONG ) - 1 |
| 1372 | If nlongs > BITS_TO_LONGS(MAX_NUMNODES) Then |
| 1374 | If Get a simple variable from user space(t, nmask + k) Then Return -EFAULT |
| 1382 | nlongs = BITS_TO_LONGS(MAX_NUMNODES) |
| 1383 | endmask = ~0UL |
| 1386 | If maxnode > MAX_NUMNODES && MAX_NUMNODES % BITS_PER_LONG != 0 Then |
| 1387 | valid_mask = endmask |
| 1389 | valid_mask &= ~((1UL << MAX_NUMNODES % BITS_PER_LONG ) - 1) |
| 1390 | If Get a simple variable from user space(t, nmask + nlongs - 1) Then Return -EFAULT |
| 1392 | If t & valid_mask Then Return -EINVAL |
| 1396 | If copy_from_user(nodes_addr( * nodes), nmask, nlongs * sizeof(unsignedlong)) Then Return -EFAULT |
| 1398 | nodes_addr( * nodes)[nlongs - 1] &= endmask |
| 1399 | Return 0 |
| Name | Describe |
|---|---|
| kernel_mbind | |
| kernel_set_mempolicy | Set the process memory policy |
| kernel_migrate_pages |
| 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 |