[PATCH] Pass dentry, not just name, in fsnotify creation hooks.
[powerpc.git] / include / linux / fsnotify.h
index 602c305..b5ff64d 100644 (file)
@@ -21,7 +21,7 @@
  */
 static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
                                 const char *old_name, const char *new_name,
-                                int isdir, struct inode *target)
+                                int isdir, struct inode *target, struct inode *source)
 {
        u32 cookie = inotify_get_cookie();
 
@@ -41,6 +41,10 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
                inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL);
                inotify_inode_is_dead(target);
        }
+
+       if (source) {
+               inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL);
+       }
 }
 
 /*
@@ -66,19 +70,20 @@ static inline void fsnotify_inoderemove(struct inode *inode)
 /*
  * fsnotify_create - 'name' was linked in
  */
-static inline void fsnotify_create(struct inode *inode, const char *name)
+static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
 {
        inode_dir_notify(inode, DN_CREATE);
-       inotify_inode_queue_event(inode, IN_CREATE, 0, name);
+       inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name);
 }
 
 /*
  * fsnotify_mkdir - directory 'name' was created
  */
-static inline void fsnotify_mkdir(struct inode *inode, const char *name)
+static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
 {
        inode_dir_notify(inode, DN_CREATE);
-       inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, name);
+       inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, 
+                                 dentry->d_name.name);
 }
 
 /*