diff options
author | Eric Paris <eparis@redhat.com> | 2010-08-27 21:42:11 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-08-27 21:42:11 -0400 |
commit | 92b4678efa8ce0de9b1e01a74e3d13c4002a4136 (patch) | |
tree | 97febbafb1798324802325c22c3693902a47323d /fs | |
parent | f72adfd540bacc4f6ff57a7d708b1a6c8906bdb4 (diff) |
fsnotify: drop two useless bools in the fnsotify main loop
The fsnotify main loop has 2 bools which indicated if we processed the
inode or vfsmount mark in that particular pass through the loop. These
bool can we replaced with the inode_group and vfsmount_group variables
and actually make the code a little easier to understand.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/notify/fsnotify.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index 2169aa593d5f..36802420d69a 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c | |||
@@ -225,7 +225,6 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | |||
225 | struct fsnotify_event *event = NULL; | 225 | struct fsnotify_event *event = NULL; |
226 | struct vfsmount *mnt; | 226 | struct vfsmount *mnt; |
227 | int idx, ret = 0; | 227 | int idx, ret = 0; |
228 | bool used_inode, used_vfsmount; | ||
229 | /* global tests shouldn't care about events on child only the specific event */ | 228 | /* global tests shouldn't care about events on child only the specific event */ |
230 | __u32 test_mask = (mask & ~FS_EVENT_ON_CHILD); | 229 | __u32 test_mask = (mask & ~FS_EVENT_ON_CHILD); |
231 | 230 | ||
@@ -260,7 +259,6 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | |||
260 | } | 259 | } |
261 | 260 | ||
262 | while (inode_node || vfsmount_node) { | 261 | while (inode_node || vfsmount_node) { |
263 | used_inode = used_vfsmount = false; | ||
264 | inode_group = vfsmount_group = NULL; | 262 | inode_group = vfsmount_group = NULL; |
265 | 263 | ||
266 | if (inode_node) { | 264 | if (inode_node) { |
@@ -279,23 +277,22 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | |||
279 | /* handle inode */ | 277 | /* handle inode */ |
280 | send_to_group(to_tell, NULL, inode_mark, NULL, mask, data, | 278 | send_to_group(to_tell, NULL, inode_mark, NULL, mask, data, |
281 | data_is, cookie, file_name, &event); | 279 | data_is, cookie, file_name, &event); |
282 | used_inode = true; | 280 | /* we didn't use the vfsmount_mark */ |
281 | vfsmount_group = NULL; | ||
283 | } else if (vfsmount_group > inode_group) { | 282 | } else if (vfsmount_group > inode_group) { |
284 | send_to_group(to_tell, mnt, NULL, vfsmount_mark, mask, data, | 283 | send_to_group(to_tell, mnt, NULL, vfsmount_mark, mask, data, |
285 | data_is, cookie, file_name, &event); | 284 | data_is, cookie, file_name, &event); |
286 | used_vfsmount = true; | 285 | inode_group = NULL; |
287 | } else { | 286 | } else { |
288 | send_to_group(to_tell, mnt, inode_mark, vfsmount_mark, | 287 | send_to_group(to_tell, mnt, inode_mark, vfsmount_mark, |
289 | mask, data, data_is, cookie, file_name, | 288 | mask, data, data_is, cookie, file_name, |
290 | &event); | 289 | &event); |
291 | used_vfsmount = true; | ||
292 | used_inode = true; | ||
293 | } | 290 | } |
294 | 291 | ||
295 | if (used_inode) | 292 | if (inode_group) |
296 | inode_node = srcu_dereference(inode_node->next, | 293 | inode_node = srcu_dereference(inode_node->next, |
297 | &fsnotify_mark_srcu); | 294 | &fsnotify_mark_srcu); |
298 | if (used_vfsmount) | 295 | if (vfsmount_group) |
299 | vfsmount_node = srcu_dereference(vfsmount_node->next, | 296 | vfsmount_node = srcu_dereference(vfsmount_node->next, |
300 | &fsnotify_mark_srcu); | 297 | &fsnotify_mark_srcu); |
301 | } | 298 | } |