函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mempolicy.c Create Date:2022-07-27 17:04:58
Last Modify:2020-03-17 22:28:11 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Copy a node mask from user space.

函数原型:static int get_nodes(nodemask_t *nodes, const unsigned long __user *nmask, unsigned long maxnode)

返回类型:int

参数:

类型参数名称
nodemask_t *nodes
const unsigned long __user *nmask
unsigned longmaxnode
1350  maxnode先自减
1351  nodes_clear( * nodes)
1352  如果maxnode恒等于0或非nmask则返回:0
1354  如果maxnode大于PAGE_SIZEBITS_PER_BYTE则返回:负EINVAL
1357  nlongs等于BITS_TO_LONGS(maxnode)
1358  如果maxnode取模BITS_PER_LONG恒等于0则endmask等于0UL的反
1360  否则endmask等于1UL左移maxnode取模BITS_PER_LONG位的值减1
1372  如果nlongs大于BITS_TO_LONGS(MAX_NUMNODES)则
1373 k小于nlongs循环
1376  如果k恒等于nlongs减1则
1377  如果t按位与endmask则返回:负EINVAL
1379  否则如果t则返回:负EINVAL
1382  nlongs等于BITS_TO_LONGS(MAX_NUMNODES)
1383  endmask等于0UL的反
1386  如果maxnode大于MAX_NUMNODESMAX_NUMNODES取模BITS_PER_LONG不等于0则
1387  valid_mask等于endmask
1389  valid_mask与等于1UL左移MAX_NUMNODES取模BITS_PER_LONG位的值减1的差的反
1390  如果Careful: we have to cast the result to the type of the pointer* for sign reasons(t, nmask + nlongs - 1)则返回:负EFAULT
1392  如果t按位与valid_mask则返回:负EINVAL
1396  如果copy_from_user(nodes_addr( * nodes), nmask, nlongs * sizeof(unsignedlong))则返回:负EFAULT
1398  nodes_addr( * nodes)[nlongs - 1]与等于endmask
1399  返回:0
调用者
名称描述
kernel_mbind
kernel_set_mempolicySet the process memory policy
kernel_migrate_pages