Commit 01affd54 authored by Jan Kara's avatar Jan Kara

fanotify: Drop fanotify_event_has_fid()

When some events have directory id and some object id,
fanotify_event_has_fid() becomes mostly useless and confusing because we
usually need to know which type of file handle the event has. So just
drop the function and use fanotify_event_object_fh() instead.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent d766b553
...@@ -387,7 +387,7 @@ init: __maybe_unused ...@@ -387,7 +387,7 @@ init: __maybe_unused
else else
event->pid = get_pid(task_tgid(current)); event->pid = get_pid(task_tgid(current));
if (fanotify_event_has_fid(event)) { if (fanotify_event_object_fh(event)) {
ffe->object_fh.len = 0; ffe->object_fh.len = 0;
if (fsid) if (fsid)
ffe->fsid = *fsid; ffe->fsid = *fsid;
......
...@@ -83,11 +83,6 @@ FANOTIFY_FE(struct fanotify_event *event) ...@@ -83,11 +83,6 @@ FANOTIFY_FE(struct fanotify_event *event)
return container_of(event, struct fanotify_fid_event, fae); return container_of(event, struct fanotify_fid_event, fae);
} }
static inline bool fanotify_event_has_fid(struct fanotify_event *event)
{
return event->type == FANOTIFY_EVENT_TYPE_FID;
}
static inline __kernel_fsid_t *fanotify_event_fsid(struct fanotify_event *event) static inline __kernel_fsid_t *fanotify_event_fsid(struct fanotify_event *event)
{ {
if (event->type == FANOTIFY_EVENT_TYPE_FID) if (event->type == FANOTIFY_EVENT_TYPE_FID)
......
...@@ -275,7 +275,7 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, ...@@ -275,7 +275,7 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
metadata.mask = event->mask & FANOTIFY_OUTGOING_EVENTS; metadata.mask = event->mask & FANOTIFY_OUTGOING_EVENTS;
metadata.pid = pid_vnr(event->pid); metadata.pid = pid_vnr(event->pid);
if (fanotify_event_has_fid(event)) { if (fanotify_event_object_fh(event)) {
metadata.event_len += fanotify_event_info_len(event); metadata.event_len += fanotify_event_info_len(event);
} else if (path && path->mnt && path->dentry) { } else if (path && path->mnt && path->dentry) {
fd = create_fd(group, path, &f); fd = create_fd(group, path, &f);
...@@ -300,7 +300,7 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, ...@@ -300,7 +300,7 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
if (f) { if (f) {
fd_install(fd, f); fd_install(fd, f);
} else if (fanotify_event_has_fid(event)) { } else if (fanotify_event_object_fh(event)) {
ret = copy_fid_to_user(fanotify_event_fsid(event), ret = copy_fid_to_user(fanotify_event_fsid(event),
fanotify_event_object_fh(event), fanotify_event_object_fh(event),
buf + FAN_EVENT_METADATA_LEN); buf + FAN_EVENT_METADATA_LEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment