diff options
Diffstat (limited to 'include/linux/fsnotify.h')
-rw-r--r-- | include/linux/fsnotify.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 936f9aa8bb9..01755909ce8 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/inotify.h> | 15 | #include <linux/inotify.h> |
16 | #include <linux/fsnotify_backend.h> | 16 | #include <linux/fsnotify_backend.h> |
17 | #include <linux/audit.h> | 17 | #include <linux/audit.h> |
18 | #include <linux/slab.h> | ||
18 | 19 | ||
19 | /* | 20 | /* |
20 | * fsnotify_d_instantiate - instantiate a dentry for inode | 21 | * fsnotify_d_instantiate - instantiate a dentry for inode |
@@ -65,7 +66,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 | 66 | * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir |
66 | */ | 67 | */ |
67 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | 68 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, |
68 | const char *old_name, const char *new_name, | 69 | const char *old_name, |
69 | int isdir, struct inode *target, struct dentry *moved) | 70 | int isdir, struct inode *target, struct dentry *moved) |
70 | { | 71 | { |
71 | struct inode *source = moved->d_inode; | 72 | struct inode *source = moved->d_inode; |
@@ -73,6 +74,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
73 | u32 fs_cookie = fsnotify_get_cookie(); | 74 | u32 fs_cookie = fsnotify_get_cookie(); |
74 | __u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM); | 75 | __u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM); |
75 | __u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO); | 76 | __u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO); |
77 | const char *new_name = moved->d_name.name; | ||
76 | 78 | ||
77 | if (old_dir == new_dir) | 79 | if (old_dir == new_dir) |
78 | old_dir_mask |= FS_DN_RENAME; | 80 | old_dir_mask |= FS_DN_RENAME; |
@@ -103,7 +105,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
103 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); | 105 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); |
104 | fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 106 | fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
105 | } | 107 | } |
106 | audit_inode_child(new_name, moved, new_dir); | 108 | audit_inode_child(moved, new_dir); |
107 | } | 109 | } |
108 | 110 | ||
109 | /* | 111 | /* |
@@ -146,7 +148,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) | |||
146 | { | 148 | { |
147 | inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, | 149 | inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, |
148 | dentry->d_inode); | 150 | dentry->d_inode); |
149 | audit_inode_child(dentry->d_name.name, dentry, inode); | 151 | audit_inode_child(dentry, inode); |
150 | 152 | ||
151 | fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); | 153 | fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); |
152 | } | 154 | } |
@@ -161,7 +163,7 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct | |||
161 | inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name, | 163 | inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name, |
162 | inode); | 164 | inode); |
163 | fsnotify_link_count(inode); | 165 | fsnotify_link_count(inode); |
164 | audit_inode_child(new_dentry->d_name.name, new_dentry, dir); | 166 | audit_inode_child(new_dentry, dir); |
165 | 167 | ||
166 | fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name, 0); | 168 | fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name, 0); |
167 | } | 169 | } |
@@ -175,7 +177,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
175 | struct inode *d_inode = dentry->d_inode; | 177 | struct inode *d_inode = dentry->d_inode; |
176 | 178 | ||
177 | inotify_inode_queue_event(inode, mask, 0, dentry->d_name.name, d_inode); | 179 | inotify_inode_queue_event(inode, mask, 0, dentry->d_name.name, d_inode); |
178 | audit_inode_child(dentry->d_name.name, dentry, inode); | 180 | audit_inode_child(dentry, inode); |
179 | 181 | ||
180 | fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); | 182 | fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); |
181 | } | 183 | } |