Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:copy_event_to_user

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

Type:ssize_t

Parameter:

TypeParameterName
struct fsnotify_group *group
struct fsnotify_event *fsn_event
char __user *buf
size_tcount
265  struct file * f = NULL
266  fd = No fd set in event
268  pr_debug("%s: group=%p event=%p\n", __func__, group, fsn_event)
270  event = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(fsn_event, structfanotify_event, fse)
271  event_len = Helper functions to deal with fanotify_event_metadata buffers
272  metadata_len = Helper functions to deal with fanotify_event_metadata buffers
273  vers = FANOTIFY_METADATA_VERSION
274  reserved = 0
275  mask = mask & Events that may be reported to user
276  pid = pid_vnr(pid)
278  If fanotify_event_has_path(event) Then
279  fd = create_fd(group, event, & f)
280  If fd < 0 Then Return fd
282  Else if fanotify_event_has_fid(event) Then
283  event_len += fanotify_event_info_len(event)
285  fd = fd
287  ret = -EFAULT
292  If WARN_ON_ONCE(event_len > count) Then Go to out_close_fd
295  If copy_to_user(buf, & metadata, Helper functions to deal with fanotify_event_metadata buffers ) Then Go to out_close_fd
298  If fanotify_is_perm_event(mask) Then d we passed to userspace for this event = fd
301  If fanotify_event_has_path(event) Then
302  fd_install(fd, f)
303  Else if fanotify_event_has_fid(event) Then
304  ret = copy_fid_to_user(event, buf + Helper functions to deal with fanotify_event_metadata buffers )
305  If ret < 0 Then Return ret
309  Return event_len
311  out_close_fd :
312  If fd != No fd set in event Then
313  put_unused_fd(fd)
314  fput(f)
316  Return ret
Caller
NameDescribe
fanotify_read