瀏覽代碼

fsnotify: constify the places working with ->f_path

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro 8 年之前
父節點
當前提交
40212d531d
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      include/linux/fsnotify.h

+ 5 - 5
include/linux/fsnotify.h

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