]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/fsnotify.h
Merge master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6-omap-h63xx.git] / include / linux / fsnotify.h
index eb581b6cfca9d0c13d882eb9201a70ebfcebb9ba..9db31d251c205358fc528eee3bfa774a3af3ff33 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)
+                                int isdir, struct inode *target)
 {
        u32 cookie = inotify_get_cookie();
 
@@ -36,15 +36,18 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
                isdir = IN_ISDIR;
        inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name);
        inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name);
+
+       if (target) {
+               inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL);
+               inotify_inode_is_dead(target);
+       }
 }
 
 /*
  * fsnotify_unlink - file was unlinked
  */
-static inline void fsnotify_unlink(struct dentry *dentry, struct inode *dir)
+static inline void fsnotify_unlink(struct dentry *dentry, struct inode *inode, struct inode *dir)
 {
-       struct inode *inode = dentry->d_inode;
-
        inode_dir_notify(dir, DN_DELETE);
        inotify_inode_queue_event(dir, IN_DELETE, 0, dentry->d_name.name);
        inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL);
@@ -64,6 +67,26 @@ static inline void fsnotify_rmdir(struct dentry *dentry, struct inode *inode,
        inotify_inode_is_dead(inode);
 }
 
+/*
+ * fsnotify_nameremove - a filename was removed from a directory
+ */
+static inline void fsnotify_nameremove(struct dentry *dentry, int isdir)
+{
+       if (isdir)
+               isdir = IN_ISDIR;
+       dnotify_parent(dentry, DN_DELETE);
+       inotify_dentry_parent_queue_event(dentry, IN_DELETE|isdir, 0, dentry->d_name.name);
+}
+
+/*
+ * fsnotify_inoderemove - an inode is going away
+ */
+static inline void fsnotify_inoderemove(struct inode *inode)
+{
+       inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL);
+       inotify_inode_is_dead(inode);
+}
+
 /*
  * fsnotify_create - 'name' was linked in
  */
@@ -125,8 +148,8 @@ static inline void fsnotify_open(struct dentry *dentry)
        if (S_ISDIR(inode->i_mode))
                mask |= IN_ISDIR;
 
-       inotify_inode_queue_event(inode, mask, 0, NULL);
        inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
+       inotify_inode_queue_event(inode, mask, 0, NULL);        
 }
 
 /*