diff options
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 3aa8a7e980d8..a15a2e1f5520 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/string.h> | 19 | #include <linux/string.h> |
20 | #include <linux/mm.h> | 20 | #include <linux/mm.h> |
21 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
22 | #include <linux/fsnotify.h> | ||
22 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
23 | #include <linux/init.h> | 24 | #include <linux/init.h> |
24 | #include <linux/smp_lock.h> | 25 | #include <linux/smp_lock.h> |
@@ -101,6 +102,7 @@ static inline void dentry_iput(struct dentry * dentry) | |||
101 | list_del_init(&dentry->d_alias); | 102 | list_del_init(&dentry->d_alias); |
102 | spin_unlock(&dentry->d_lock); | 103 | spin_unlock(&dentry->d_lock); |
103 | spin_unlock(&dcache_lock); | 104 | spin_unlock(&dcache_lock); |
105 | fsnotify_inoderemove(inode); | ||
104 | if (dentry->d_op && dentry->d_op->d_iput) | 106 | if (dentry->d_op && dentry->d_op->d_iput) |
105 | dentry->d_op->d_iput(dentry, inode); | 107 | dentry->d_op->d_iput(dentry, inode); |
106 | else | 108 | else |
@@ -1165,13 +1167,16 @@ out: | |||
1165 | 1167 | ||
1166 | void d_delete(struct dentry * dentry) | 1168 | void d_delete(struct dentry * dentry) |
1167 | { | 1169 | { |
1170 | int isdir = 0; | ||
1168 | /* | 1171 | /* |
1169 | * Are we the only user? | 1172 | * Are we the only user? |
1170 | */ | 1173 | */ |
1171 | spin_lock(&dcache_lock); | 1174 | spin_lock(&dcache_lock); |
1172 | spin_lock(&dentry->d_lock); | 1175 | spin_lock(&dentry->d_lock); |
1176 | isdir = S_ISDIR(dentry->d_inode->i_mode); | ||
1173 | if (atomic_read(&dentry->d_count) == 1) { | 1177 | if (atomic_read(&dentry->d_count) == 1) { |
1174 | dentry_iput(dentry); | 1178 | dentry_iput(dentry); |
1179 | fsnotify_nameremove(dentry, isdir); | ||
1175 | return; | 1180 | return; |
1176 | } | 1181 | } |
1177 | 1182 | ||
@@ -1180,6 +1185,8 @@ void d_delete(struct dentry * dentry) | |||
1180 | 1185 | ||
1181 | spin_unlock(&dentry->d_lock); | 1186 | spin_unlock(&dentry->d_lock); |
1182 | spin_unlock(&dcache_lock); | 1187 | spin_unlock(&dcache_lock); |
1188 | |||
1189 | fsnotify_nameremove(dentry, isdir); | ||
1183 | } | 1190 | } |
1184 | 1191 | ||
1185 | static void __d_rehash(struct dentry * entry, struct hlist_head *list) | 1192 | static void __d_rehash(struct dentry * entry, struct hlist_head *list) |