diff options
author | Eric Paris <eparis@redhat.com> | 2009-05-21 17:01:47 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2009-06-11 14:57:54 -0400 |
commit | 47882c6f51e8ef41fbbe2bbb746a1ea3228dd7ca (patch) | |
tree | d3dd3e8d0e4d3e3793f32107077839f787e35fcd /include/linux/fsnotify_backend.h | |
parent | 62ffe5dfba056f7ba81d710fee9f28c58a42fdd6 (diff) |
fsnotify: add correlations between events
As part of the standard inotify events it includes a correlation cookie
between two dentry move operations. This patch includes the same behaviour
in fsnotify events. It is needed so that inotify userspace can be
implemented on top of fsnotify.
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/fsnotify_backend.h')
-rw-r--r-- | include/linux/fsnotify_backend.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 52692f405890..b78b5573d227 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -193,6 +193,7 @@ struct fsnotify_event { | |||
193 | atomic_t refcnt; /* how many groups still are using/need to send this event */ | 193 | atomic_t refcnt; /* how many groups still are using/need to send this event */ |
194 | __u32 mask; /* the type of access, bitwise OR for FS_* event types */ | 194 | __u32 mask; /* the type of access, bitwise OR for FS_* event types */ |
195 | 195 | ||
196 | u32 sync_cookie; /* used to corrolate events, namely inotify mv events */ | ||
196 | char *file_name; | 197 | char *file_name; |
197 | size_t name_len; | 198 | size_t name_len; |
198 | }; | 199 | }; |
@@ -227,9 +228,11 @@ struct fsnotify_mark_entry { | |||
227 | /* called from the vfs helpers */ | 228 | /* called from the vfs helpers */ |
228 | 229 | ||
229 | /* main fsnotify call to send events */ | 230 | /* main fsnotify call to send events */ |
230 | extern void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, const char *name); | 231 | extern void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, |
232 | const char *name, u32 cookie); | ||
231 | extern void __fsnotify_parent(struct dentry *dentry, __u32 mask); | 233 | extern void __fsnotify_parent(struct dentry *dentry, __u32 mask); |
232 | extern void __fsnotify_inode_delete(struct inode *inode); | 234 | extern void __fsnotify_inode_delete(struct inode *inode); |
235 | extern u32 fsnotify_get_cookie(void); | ||
233 | 236 | ||
234 | static inline int fsnotify_inode_watches_children(struct inode *inode) | 237 | static inline int fsnotify_inode_watches_children(struct inode *inode) |
235 | { | 238 | { |
@@ -322,12 +325,13 @@ extern void fsnotify_put_mark(struct fsnotify_mark_entry *entry); | |||
322 | 325 | ||
323 | /* put here because inotify does some weird stuff when destroying watches */ | 326 | /* put here because inotify does some weird stuff when destroying watches */ |
324 | extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, | 327 | extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, |
325 | void *data, int data_is, const char *name); | 328 | void *data, int data_is, const char *name, |
329 | u32 cookie); | ||
326 | 330 | ||
327 | #else | 331 | #else |
328 | 332 | ||
329 | static inline void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | 333 | static inline void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, |
330 | const char *name); | 334 | const char *name, u32 cookie) |
331 | {} | 335 | {} |
332 | 336 | ||
333 | static inline void __fsnotify_parent(struct dentry *dentry, __u32 mask) | 337 | static inline void __fsnotify_parent(struct dentry *dentry, __u32 mask) |
@@ -342,6 +346,11 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) | |||
342 | static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode) | 346 | static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode) |
343 | {} | 347 | {} |
344 | 348 | ||
349 | static inline u32 fsnotify_get_cookie(void) | ||
350 | { | ||
351 | return 0; | ||
352 | } | ||
353 | |||
345 | #endif /* CONFIG_FSNOTIFY */ | 354 | #endif /* CONFIG_FSNOTIFY */ |
346 | 355 | ||
347 | #endif /* __KERNEL __ */ | 356 | #endif /* __KERNEL __ */ |