fs/notify: constify path

[ Upstream commit d5bf88895f ]

Reviewed-by: Matthew Bobrowski <repnop@google.com>
Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
Al Viro 2022-08-04 12:57:38 -04:00 committed by Greg Kroah-Hartman
parent 3af497e3f7
commit 6029a4f7ad
3 changed files with 5 additions and 5 deletions

View file

@ -18,7 +18,7 @@
#include "fanotify.h" #include "fanotify.h"
static bool fanotify_path_equal(struct path *p1, struct path *p2) static bool fanotify_path_equal(const struct path *p1, const struct path *p2)
{ {
return p1->mnt == p2->mnt && p1->dentry == p2->dentry; return p1->mnt == p2->mnt && p1->dentry == p2->dentry;
} }

View file

@ -458,7 +458,7 @@ static inline bool fanotify_event_has_path(struct fanotify_event *event)
event->type == FANOTIFY_EVENT_TYPE_PATH_PERM; event->type == FANOTIFY_EVENT_TYPE_PATH_PERM;
} }
static inline struct path *fanotify_event_path(struct fanotify_event *event) static inline const struct path *fanotify_event_path(struct fanotify_event *event)
{ {
if (event->type == FANOTIFY_EVENT_TYPE_PATH) if (event->type == FANOTIFY_EVENT_TYPE_PATH)
return &FANOTIFY_PE(event)->path; return &FANOTIFY_PE(event)->path;

View file

@ -245,7 +245,7 @@ static struct fanotify_event *get_one_event(struct fsnotify_group *group,
return event; return event;
} }
static int create_fd(struct fsnotify_group *group, struct path *path, static int create_fd(struct fsnotify_group *group, const struct path *path,
struct file **file) struct file **file)
{ {
int client_fd; int client_fd;
@ -615,7 +615,7 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
char __user *buf, size_t count) char __user *buf, size_t count)
{ {
struct fanotify_event_metadata metadata; struct fanotify_event_metadata metadata;
struct path *path = fanotify_event_path(event); const struct path *path = fanotify_event_path(event);
struct fanotify_info *info = fanotify_event_info(event); struct fanotify_info *info = fanotify_event_info(event);
unsigned int info_mode = FAN_GROUP_FLAG(group, FANOTIFY_INFO_MODES); unsigned int info_mode = FAN_GROUP_FLAG(group, FANOTIFY_INFO_MODES);
unsigned int pidfd_mode = info_mode & FAN_REPORT_PIDFD; unsigned int pidfd_mode = info_mode & FAN_REPORT_PIDFD;
@ -1549,7 +1549,7 @@ static int fanotify_test_fid(struct dentry *dentry)
} }
static int fanotify_events_supported(struct fsnotify_group *group, static int fanotify_events_supported(struct fsnotify_group *group,
struct path *path, __u64 mask, const struct path *path, __u64 mask,
unsigned int flags) unsigned int flags)
{ {
unsigned int mark_type = flags & FANOTIFY_MARK_TYPE_BITS; unsigned int mark_type = flags & FANOTIFY_MARK_TYPE_BITS;