Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\eventpoll.c Create Date:2022-07-28 20:19:07
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ep_alloc

Proto:static int ep_alloc(struct eventpoll **pep)

Type:int

Parameter:

TypeParameterName
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 = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
1001  If Value for the false possibility is greater at compile time(!ep) Then Go to 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  Initialization list head
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  Return 0
1017  free_uid :
1018  free_uid(user)
1019  Return error
Caller
NameDescribe
do_epoll_createOpen an eventpoll file descriptor.