diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-25 04:57:57 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-02-08 14:38:36 -0500 |
commit | 123df2944c436c80640c4281c5bc9c7950b18687 (patch) | |
tree | a4fe67a9ce7cd4ae7d54ec94577916d38a0603e6 | |
parent | 6339204ecc2aa2067a99595522de0403f0854bb8 (diff) |
Lose the new_name argument of fsnotify_move()
it's always new_dentry->d_name.name
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/debugfs/inode.c | 2 | ||||
-rw-r--r-- | fs/namei.c | 6 | ||||
-rw-r--r-- | include/linux/fsnotify.h | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 274ac865bae8..049d6c36da09 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c | |||
@@ -496,7 +496,7 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, | |||
496 | } | 496 | } |
497 | d_move(old_dentry, dentry); | 497 | d_move(old_dentry, dentry); |
498 | fsnotify_move(old_dir->d_inode, new_dir->d_inode, old_name, | 498 | fsnotify_move(old_dir->d_inode, new_dir->d_inode, old_name, |
499 | old_dentry->d_name.name, S_ISDIR(old_dentry->d_inode->i_mode), | 499 | S_ISDIR(old_dentry->d_inode->i_mode), |
500 | NULL, old_dentry); | 500 | NULL, old_dentry); |
501 | fsnotify_oldname_free(old_name); | 501 | fsnotify_oldname_free(old_name); |
502 | unlock_rename(new_dir, old_dir); | 502 | unlock_rename(new_dir, old_dir); |
diff --git a/fs/namei.c b/fs/namei.c index d62fdc875f22..f69df876fac3 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2661,11 +2661,9 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
2661 | error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry); | 2661 | error = vfs_rename_dir(old_dir,old_dentry,new_dir,new_dentry); |
2662 | else | 2662 | else |
2663 | error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry); | 2663 | error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry); |
2664 | if (!error) { | 2664 | if (!error) |
2665 | const char *new_name = old_dentry->d_name.name; | 2665 | fsnotify_move(old_dir, new_dir, old_name, is_dir, |
2666 | fsnotify_move(old_dir, new_dir, old_name, new_name, is_dir, | ||
2667 | new_dentry->d_inode, old_dentry); | 2666 | new_dentry->d_inode, old_dentry); |
2668 | } | ||
2669 | fsnotify_oldname_free(old_name); | 2667 | fsnotify_oldname_free(old_name); |
2670 | 2668 | ||
2671 | return error; | 2669 | return error; |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 936f9aa8bb97..2d755c49c324 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -65,7 +65,7 @@ static inline void fsnotify_link_count(struct inode *inode) | |||
65 | * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir | 65 | * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir |
66 | */ | 66 | */ |
67 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | 67 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, |
68 | const char *old_name, const char *new_name, | 68 | const char *old_name, |
69 | int isdir, struct inode *target, struct dentry *moved) | 69 | int isdir, struct inode *target, struct dentry *moved) |
70 | { | 70 | { |
71 | struct inode *source = moved->d_inode; | 71 | struct inode *source = moved->d_inode; |
@@ -73,6 +73,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
73 | u32 fs_cookie = fsnotify_get_cookie(); | 73 | u32 fs_cookie = fsnotify_get_cookie(); |
74 | __u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM); | 74 | __u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM); |
75 | __u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO); | 75 | __u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO); |
76 | const char *new_name = moved->d_name.name; | ||
76 | 77 | ||
77 | if (old_dir == new_dir) | 78 | if (old_dir == new_dir) |
78 | old_dir_mask |= FS_DN_RENAME; | 79 | old_dir_mask |= FS_DN_RENAME; |