diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2009-12-17 21:24:24 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 09:58:53 -0400 |
commit | 72acc854427948efed7a83da27f7dc3239ac9afc (patch) | |
tree | 69a8f479a644701a52abe07d7bf2751cdf4cc159 /fs | |
parent | 098cf2fc77ee190c92bf9d08d69a13305f2487ec (diff) | |
download | linux-stable-72acc854427948efed7a83da27f7dc3239ac9afc.tar.gz linux-stable-72acc854427948efed7a83da27f7dc3239ac9afc.tar.bz2 linux-stable-72acc854427948efed7a83da27f7dc3239ac9afc.zip |
fsnotify: kill FSNOTIFY_EVENT_FILE
Some fsnotify operations send a struct file. This is more information than
we technically need. We instead send a struct path in all cases instead of
sometimes a path and sometimes a file.
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/notify/fsnotify.c | 12 | ||||
-rw-r--r-- | fs/notify/notification.c | 9 |
2 files changed, 5 insertions, 16 deletions
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index 78c440c343a8..60e84fd338dd 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c @@ -79,15 +79,15 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode) } /* Notify this dentry's parent about a child's events. */ -void __fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask) +void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) { struct dentry *parent; struct inode *p_inode; bool send = false; bool should_update_children = false; - if (file) - dentry = file->f_path.dentry; + if (!dentry) + dentry = path->dentry; if (!(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED)) return; @@ -119,8 +119,8 @@ void __fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask) * specifies these are events which came from a child. */ mask |= FS_EVENT_ON_CHILD; - if (file) - fsnotify(p_inode, mask, file, FSNOTIFY_EVENT_FILE, + if (path) + fsnotify(p_inode, mask, path, FSNOTIFY_EVENT_PATH, dentry->d_name.name, 0); else fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE, @@ -194,8 +194,6 @@ void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, const if (data_is == FSNOTIFY_EVENT_PATH) mnt = ((struct path *)data)->mnt; - else if (data_is == FSNOTIFY_EVENT_FILE) - mnt = ((struct file *)data)->f_path.mnt; /* if this inode's directed listeners don't care and nothing on the vfsmount * listeners list cares, nothing to do */ diff --git a/fs/notify/notification.c b/fs/notify/notification.c index dafd0b7687b8..066f1f988bac 100644 --- a/fs/notify/notification.c +++ b/fs/notify/notification.c @@ -390,15 +390,6 @@ struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, event->data_type = data_type; switch (data_type) { - case FSNOTIFY_EVENT_FILE: { - struct file *file = data; - struct path *path = &file->f_path; - event->path.dentry = path->dentry; - event->path.mnt = path->mnt; - path_get(&event->path); - event->data_type = FSNOTIFY_EVENT_PATH; - break; - } case FSNOTIFY_EVENT_PATH: { struct path *path = data; event->path.dentry = path->dentry; |