]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/fsnotify.h
[PATCH] mark f_ops const in the inode
[linux-2.6-omap-h63xx.git] / include / linux / fsnotify.h
index 602c305c8585fcb6b175bfd27750fe09ca718da8..11438eff4d4455573f76789edfd5ffb0cc646473 100644 (file)
 
 #include <linux/dnotify.h>
 #include <linux/inotify.h>
+#include <linux/audit.h>
+
+/*
+ * fsnotify_d_instantiate - instantiate a dentry for inode
+ * Called with dcache_lock held.
+ */
+static inline void fsnotify_d_instantiate(struct dentry *entry,
+                                               struct inode *inode)
+{
+       inotify_d_instantiate(entry, inode);
+}
+
+/*
+ * fsnotify_d_move - entry has been moved
+ * Called with dcache_lock and entry->d_lock held.
+ */
+static inline void fsnotify_d_move(struct dentry *entry)
+{
+       inotify_d_move(entry);
+}
 
 /*
  * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir
  */
 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 +61,12 @@ 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);
+       }
+       audit_inode_child(old_name, source, old_dir->i_ino);
+       audit_inode_child(new_name, target, new_dir->i_ino);
 }
 
 /*
@@ -66,19 +92,22 @@ 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);
+       audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino);
 }
 
 /*
  * 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);
+       audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino);
 }
 
 /*