]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/fsnotify_backend.h
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
[mv-sheeva.git] / include / linux / fsnotify_backend.h
index d2c0ee30e618454d20c096f1783285c6a174ef24..6c3de999fb3486b56bc677c3a359f23a4a2b66bf 100644 (file)
@@ -9,6 +9,7 @@
 
 #ifdef __KERNEL__
 
+#include <linux/idr.h> /* inotify uses this */
 #include <linux/fs.h> /* struct inode */
 #include <linux/list.h>
 #include <linux/path.h> /* struct path */
@@ -59,6 +60,7 @@
 
 /* listeners that hard code group numbers near the top */
 #define DNOTIFY_GROUP_NUM      UINT_MAX
+#define INOTIFY_GROUP_NUM      (DNOTIFY_GROUP_NUM-1)
 
 struct fsnotify_group;
 struct fsnotify_event;
@@ -141,6 +143,15 @@ struct fsnotify_group {
        /* groups can define private fields here or use the void *private */
        union {
                void *private;
+#ifdef CONFIG_INOTIFY_USER
+               struct inotify_group_private_data {
+                       spinlock_t      idr_lock;
+                       struct idr      idr;
+                       u32             last_wd;
+                       struct fasync_struct    *fa;    /* async notification */
+                       struct user_struct      *user;
+               } inotify_data;
+#endif
        };
 };
 
@@ -269,7 +280,7 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry)
        assert_spin_locked(&dentry->d_lock);
 
        parent = dentry->d_parent;
-       if (fsnotify_inode_watches_children(parent->d_inode))
+       if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode))
                dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED;
        else
                dentry->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED;