diff options
author | John McCutchan <ttb@tentacle.dhs.org> | 2005-08-08 13:52:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-08 14:53:47 -0400 |
commit | 7a91bf7f5c22c8407a9991cbd9ce5bb87caa6b4a (patch) | |
tree | ffd77cfbf621a990052c1277d8a18451b9363dda /include/linux/fsnotify.h | |
parent | 1963c907b21e140082d081b1c8f8c2154593c7d7 (diff) |
[PATCH] fsnotify_name/inoderemove
The patch below unhooks fsnotify from vfs_unlink & vfs_rmdir. It
introduces two new fsnotify calls, that are hooked in at the dcache
level. This not only more closely matches how the VFS layer works, it
also avoids the problem with locking and inode lifetimes.
The two functions are
- fsnotify_nameremove -- called when a directory entry is going away.
It notifies the PARENT of the deletion. This is called from
d_delete().
- inoderemove -- called when the files inode itself is going away. It
notifies the inode that is being deleted. This is called from
dentry_iput().
Signed-off-by: John McCutchan <ttb@tentacle.dhs.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/fsnotify.h')
-rw-r--r-- | include/linux/fsnotify.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 1cb4935348d8..9db31d251c20 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -68,6 +68,26 @@ static inline void fsnotify_rmdir(struct dentry *dentry, struct inode *inode, | |||
68 | } | 68 | } |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * fsnotify_nameremove - a filename was removed from a directory | ||
72 | */ | ||
73 | static inline void fsnotify_nameremove(struct dentry *dentry, int isdir) | ||
74 | { | ||
75 | if (isdir) | ||
76 | isdir = IN_ISDIR; | ||
77 | dnotify_parent(dentry, DN_DELETE); | ||
78 | inotify_dentry_parent_queue_event(dentry, IN_DELETE|isdir, 0, dentry->d_name.name); | ||
79 | } | ||
80 | |||
81 | /* | ||
82 | * fsnotify_inoderemove - an inode is going away | ||
83 | */ | ||
84 | static inline void fsnotify_inoderemove(struct inode *inode) | ||
85 | { | ||
86 | inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL); | ||
87 | inotify_inode_is_dead(inode); | ||
88 | } | ||
89 | |||
90 | /* | ||
71 | * fsnotify_create - 'name' was linked in | 91 | * fsnotify_create - 'name' was linked in |
72 | */ | 92 | */ |
73 | static inline void fsnotify_create(struct inode *inode, const char *name) | 93 | static inline void fsnotify_create(struct inode *inode, const char *name) |