函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ep_alloc

函数原型:static int ep_alloc(struct eventpoll **pep)

返回类型:int

参数:

类型参数名称
struct eventpoll **pep
998  user等于get_current_user - Get the current task's user_struct* Get the user record of the current task, pinning it so that it can't go* away.()
999  error等于负ENOMEM
1000  ep等于分配内存并置零
1001  如果此条件成立可能性小(为编译器优化)(!ep)则转到:free_uid
1004  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & * This mutex is used to ensure that files are not removed * while epoll is using them. This is held during the event * collection loop, the file cleanup path, the epoll file exit * code and the ctl operations.)
1005  rwlock_init( & Lock which protects rdllist and ovflist )
1006  init_waitqueue_head( & Wait queue used by sys_epoll_wait() )
1007  init_waitqueue_head( & Wait queue used by file->poll() )
1008  初始化链表头
1009  RB tree root used to store monitored fd structs =
1010  * This is a single linked list that chains all the "struct epitem" that * happened while transferring ready events to userspace w/out * holding ->lock.等于EP_UNACTIVE_PTR
1011  The user that created the eventpoll descriptor 等于user
1013  pep等于ep
1015  返回:0
1017  free_uid :
1018  free_uid(user)
1019  返回:error
调用者
名称描述
do_epoll_createOpen an eventpoll file descriptor.