函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_eventfd

函数原型:static int do_eventfd(unsigned int count, int flags)

返回类型:int

参数:

类型参数名称
unsigned intcount
intflags
412  BUILD_BUG_ON - break compile if a condition is true(EFD_CLOEXEC != O_CLOEXEC)
413  BUILD_BUG_ON - break compile if a condition is true(EFD_NONBLOCK != O_NONBLOCK)
415  如果flags按位与EFD_FLAGS_SET的反则返回:负EINVAL
418  ctx等于开辟内存
419  如果非ctx则返回:负ENOMEM
422  初始化对象
423  init_waitqueue_head( & wqh)
424  * Every time that a write(2) is performed on an eventfd, the * value of the __u64 being written is added to "count" and a * wakeup is performed on "wqh". A read(2) will return the "count" * value to userspace, and will reset "count" to zero. The kernel * s等于count
425  flags等于flags
426  id等于ida_simple_get( & eventfd_ida, 0, 0, GFP_KERNEL)
428  fd等于anon_inode_getfd - creates a new file instance by hooking it up to an* anonymous inode, and a dentry that describe the "class"* of the file*@name: [in] name of the "class" of the new file*@fops: [in] file operations for the new file*@priv: [in] private
430  如果fd小于0则eventfd_free_ctx(ctx)
433  返回:fd
调用者
名称描述
SYSCALL_DEFINE2
SYSCALL_DEFINE1