Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:static ssize_t copy_event_to_user(struct fsnotify_group *group, struct fsnotify_event *fsn_event, char __user *buf)

Type:ssize_t

Parameter:

TypeParameterName
struct fsnotify_group *group
struct fsnotify_event *fsn_event
char __user *buf
168  event_size = size of 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  If copy_to_user(buf, & inotify_event, event_size) Then Return -EFAULT
190  buf += event_size
197  If pad_name_len Then
199  If copy_to_user(buf, name, name_len) Then Return -EFAULT
201  buf += name_len
204  If lear_user - Zero a block of memory in user space.*@to: Destination address, in user space.*@n: Number of bytes to zero.* Zero a block of memory in user space.* Return: number of bytes that could not be cleared.* On success, this will be zero. Then Return -EFAULT
206  event_size += pad_name_len
209  Return event_size
Caller
NameDescribe
inotify_read