summaryrefslogtreecommitdiffstats
path: root/include/linux/fsnotify_backend.h
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-05-21 17:01:47 -0400
committerEric Paris <eparis@redhat.com>2009-06-11 14:57:54 -0400
commit47882c6f51e8ef41fbbe2bbb746a1ea3228dd7ca (patch)
treed3dd3e8d0e4d3e3793f32107077839f787e35fcd /include/linux/fsnotify_backend.h
parent62ffe5dfba056f7ba81d710fee9f28c58a42fdd6 (diff)
downloadlinux-47882c6f51e8ef41fbbe2bbb746a1ea3228dd7ca.tar.gz
linux-47882c6f51e8ef41fbbe2bbb746a1ea3228dd7ca.tar.bz2
linux-47882c6f51e8ef41fbbe2bbb746a1ea3228dd7ca.zip
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.h15
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 {
atomic_t refcnt; /* how many groups still are using/need to send this event */
__u32 mask; /* the type of access, bitwise OR for FS_* event types */
+ u32 sync_cookie; /* used to corrolate events, namely inotify mv events */
char *file_name;
size_t name_len;
};
@@ -227,9 +228,11 @@ struct fsnotify_mark_entry {
/* called from the vfs helpers */
/* main fsnotify call to send events */
-extern void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, const char *name);
+extern void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
+ const char *name, u32 cookie);
extern void __fsnotify_parent(struct dentry *dentry, __u32 mask);
extern void __fsnotify_inode_delete(struct inode *inode);
+extern u32 fsnotify_get_cookie(void);
static inline int fsnotify_inode_watches_children(struct inode *inode)
{
@@ -322,12 +325,13 @@ extern void fsnotify_put_mark(struct fsnotify_mark_entry *entry);
/* put here because inotify does some weird stuff when destroying watches */
extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask,
- void *data, int data_is, const char *name);
+ void *data, int data_is, const char *name,
+ u32 cookie);
#else
static inline void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
- const char *name);
+ const char *name, u32 cookie)
{}
static inline void __fsnotify_parent(struct dentry *dentry, __u32 mask)
@@ -342,6 +346,11 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry)
static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode)
{}
+static inline u32 fsnotify_get_cookie(void)
+{
+ return 0;
+}
+
#endif /* CONFIG_FSNOTIFY */
#endif /* __KERNEL __ */