diff options
author | Eric Paris <eparis@redhat.com> | 2010-07-28 10:18:39 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 10:18:54 -0400 |
commit | ce8f76fb7320297ccbe7c950fd9a2d727dd6a5a0 (patch) | |
tree | fb870e9564bfef438e46ba3c39be2999e246b179 /fs/notify/dnotify | |
parent | 613a807fe7c793ceb7d6f059773527a5a6c84a96 (diff) |
fsnotify: pass both the vfsmount mark and inode mark
should_send_event() and handle_event() will both need to look up the inode
event if they get a vfsmount event. Lets just pass both at the same time
since we have them both after walking the lists in lockstep.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/dnotify')
-rw-r--r-- | fs/notify/dnotify/dnotify.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c index e92b2c87ae94..bda588b831ad 100644 --- a/fs/notify/dnotify/dnotify.c +++ b/fs/notify/dnotify/dnotify.c | |||
@@ -83,7 +83,8 @@ static void dnotify_recalc_inode_mask(struct fsnotify_mark *fsn_mark) | |||
83 | * events. | 83 | * events. |
84 | */ | 84 | */ |
85 | static int dnotify_handle_event(struct fsnotify_group *group, | 85 | static int dnotify_handle_event(struct fsnotify_group *group, |
86 | struct fsnotify_mark *mark, | 86 | struct fsnotify_mark *inode_mark, |
87 | struct fsnotify_mark *vfsmount_mark, | ||
87 | struct fsnotify_event *event) | 88 | struct fsnotify_event *event) |
88 | { | 89 | { |
89 | struct dnotify_mark *dn_mark; | 90 | struct dnotify_mark *dn_mark; |
@@ -93,11 +94,13 @@ static int dnotify_handle_event(struct fsnotify_group *group, | |||
93 | struct fown_struct *fown; | 94 | struct fown_struct *fown; |
94 | __u32 test_mask = event->mask & ~FS_EVENT_ON_CHILD; | 95 | __u32 test_mask = event->mask & ~FS_EVENT_ON_CHILD; |
95 | 96 | ||
97 | BUG_ON(vfsmount_mark); | ||
98 | |||
96 | to_tell = event->to_tell; | 99 | to_tell = event->to_tell; |
97 | 100 | ||
98 | dn_mark = container_of(mark, struct dnotify_mark, fsn_mark); | 101 | dn_mark = container_of(inode_mark, struct dnotify_mark, fsn_mark); |
99 | 102 | ||
100 | spin_lock(&mark->lock); | 103 | spin_lock(&inode_mark->lock); |
101 | prev = &dn_mark->dn; | 104 | prev = &dn_mark->dn; |
102 | while ((dn = *prev) != NULL) { | 105 | while ((dn = *prev) != NULL) { |
103 | if ((dn->dn_mask & test_mask) == 0) { | 106 | if ((dn->dn_mask & test_mask) == 0) { |
@@ -111,11 +114,11 @@ static int dnotify_handle_event(struct fsnotify_group *group, | |||
111 | else { | 114 | else { |
112 | *prev = dn->dn_next; | 115 | *prev = dn->dn_next; |
113 | kmem_cache_free(dnotify_struct_cache, dn); | 116 | kmem_cache_free(dnotify_struct_cache, dn); |
114 | dnotify_recalc_inode_mask(mark); | 117 | dnotify_recalc_inode_mask(inode_mark); |
115 | } | 118 | } |
116 | } | 119 | } |
117 | 120 | ||
118 | spin_unlock(&mark->lock); | 121 | spin_unlock(&inode_mark->lock); |
119 | 122 | ||
120 | return 0; | 123 | return 0; |
121 | } | 124 | } |
@@ -126,8 +129,9 @@ static int dnotify_handle_event(struct fsnotify_group *group, | |||
126 | */ | 129 | */ |
127 | static bool dnotify_should_send_event(struct fsnotify_group *group, | 130 | static bool dnotify_should_send_event(struct fsnotify_group *group, |
128 | struct inode *inode, struct vfsmount *mnt, | 131 | struct inode *inode, struct vfsmount *mnt, |
129 | struct fsnotify_mark *mark, __u32 mask, | 132 | struct fsnotify_mark *inode_mark, |
130 | void *data, int data_type) | 133 | struct fsnotify_mark *vfsmount_mark, |
134 | __u32 mask, void *data, int data_type) | ||
131 | { | 135 | { |
132 | /* not a dir, dnotify doesn't care */ | 136 | /* not a dir, dnotify doesn't care */ |
133 | if (!S_ISDIR(inode->i_mode)) | 137 | if (!S_ISDIR(inode->i_mode)) |