函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Copy an event to user space, returning how much we copied.* We already checked that the event size is smaller than the* buffer we had in "get_one_event()" above.

函数原型:static ssize_t copy_event_to_user(struct fsnotify_group *group, struct fsnotify_event *fsn_event, char __user *buf)

返回类型:ssize_t

参数:

类型参数名称
struct fsnotify_group *group
struct fsnotify_event *fsn_event
char __user *buf
168  event_size等于inotify_event的长度
172  pr_debug("%s: group=%p event=%p\n", __func__, group, fsn_event)
174  event等于INOTIFY_E(fsn_event)
175  name_len等于name_len
180  pad_name_len等于round_event_name_len(fsn_event)
181  length (including nulls) of name 等于pad_name_len
182  watch mask 等于inotify_mask_to_arg(mask)
183  watch descriptor 等于wd
184  cookie to synchronize two events 等于sync_cookie
187  如果copy_to_user(buf, & inotify_event, event_size)则返回:负EFAULT
190  buf加等于event_size
197  如果pad_name_len
199  如果copy_to_user(buf, name, name_len)则返回:负EFAULT
201  buf加等于name_len
204  如果用户内存块清零则返回:负EFAULT
206  event_size加等于pad_name_len
209  返回:event_size
调用者
名称描述
inotify_read
fanotify_read