diff options
Diffstat (limited to 'include/linux/fsnotify.h')
| -rw-r--r-- | include/linux/fsnotify.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 03b8e7932b83..11438eff4d44 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
| @@ -15,6 +15,26 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/dnotify.h> | 16 | #include <linux/dnotify.h> |
| 17 | #include <linux/inotify.h> | 17 | #include <linux/inotify.h> |
| 18 | #include <linux/audit.h> | ||
| 19 | |||
| 20 | /* | ||
| 21 | * fsnotify_d_instantiate - instantiate a dentry for inode | ||
| 22 | * Called with dcache_lock held. | ||
| 23 | */ | ||
| 24 | static inline void fsnotify_d_instantiate(struct dentry *entry, | ||
| 25 | struct inode *inode) | ||
| 26 | { | ||
| 27 | inotify_d_instantiate(entry, inode); | ||
| 28 | } | ||
| 29 | |||
| 30 | /* | ||
| 31 | * fsnotify_d_move - entry has been moved | ||
| 32 | * Called with dcache_lock and entry->d_lock held. | ||
| 33 | */ | ||
| 34 | static inline void fsnotify_d_move(struct dentry *entry) | ||
| 35 | { | ||
| 36 | inotify_d_move(entry); | ||
| 37 | } | ||
| 18 | 38 | ||
| 19 | /* | 39 | /* |
| 20 | * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir | 40 | * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir |
| @@ -45,6 +65,8 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
| 45 | if (source) { | 65 | if (source) { |
| 46 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL); | 66 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL); |
| 47 | } | 67 | } |
| 68 | audit_inode_child(old_name, source, old_dir->i_ino); | ||
| 69 | audit_inode_child(new_name, target, new_dir->i_ino); | ||
| 48 | } | 70 | } |
| 49 | 71 | ||
| 50 | /* | 72 | /* |
| @@ -70,19 +92,22 @@ static inline void fsnotify_inoderemove(struct inode *inode) | |||
| 70 | /* | 92 | /* |
| 71 | * fsnotify_create - 'name' was linked in | 93 | * fsnotify_create - 'name' was linked in |
| 72 | */ | 94 | */ |
| 73 | static inline void fsnotify_create(struct inode *inode, const char *name) | 95 | static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) |
| 74 | { | 96 | { |
| 75 | inode_dir_notify(inode, DN_CREATE); | 97 | inode_dir_notify(inode, DN_CREATE); |
| 76 | inotify_inode_queue_event(inode, IN_CREATE, 0, name); | 98 | inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name); |
| 99 | audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); | ||
| 77 | } | 100 | } |
| 78 | 101 | ||
| 79 | /* | 102 | /* |
| 80 | * fsnotify_mkdir - directory 'name' was created | 103 | * fsnotify_mkdir - directory 'name' was created |
| 81 | */ | 104 | */ |
| 82 | static inline void fsnotify_mkdir(struct inode *inode, const char *name) | 105 | static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) |
| 83 | { | 106 | { |
| 84 | inode_dir_notify(inode, DN_CREATE); | 107 | inode_dir_notify(inode, DN_CREATE); |
| 85 | inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, name); | 108 | inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, |
| 109 | dentry->d_name.name); | ||
| 110 | audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); | ||
| 86 | } | 111 | } |
| 87 | 112 | ||
| 88 | /* | 113 | /* |
