/* simple call site for access decisions */
static inline int fsnotify_perm(struct file *file, int mask)
{
- struct path *path = &file->f_path;
+ const struct path *path = &file->f_path;
/*
* Do not use file_inode() here or anywhere in this file to get the
* inode. That would break *notity on overlayfs.
*/
static inline void fsnotify_access(struct file *file)
{
- struct path *path = &file->f_path;
+ const struct path *path = &file->f_path;
struct inode *inode = path->dentry->d_inode;
__u32 mask = FS_ACCESS;
*/
static inline void fsnotify_modify(struct file *file)
{
- struct path *path = &file->f_path;
+ const struct path *path = &file->f_path;
struct inode *inode = path->dentry->d_inode;
__u32 mask = FS_MODIFY;
*/
static inline void fsnotify_open(struct file *file)
{
- struct path *path = &file->f_path;
+ const struct path *path = &file->f_path;
struct inode *inode = path->dentry->d_inode;
__u32 mask = FS_OPEN;
*/
static inline void fsnotify_close(struct file *file)
{
- struct path *path = &file->f_path;
+ const struct path *path = &file->f_path;
struct inode *inode = path->dentry->d_inode;
fmode_t mode = file->f_mode;
__u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE;