Commit 92b4678efa8ce0de9b1e01a74e3d13c4002a4136
1 parent
f72adfd540
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 5 additions and 8 deletions Side-by-side Diff
fs/notify/fsnotify.c
... | ... | @@ -225,7 +225,6 @@ |
225 | 225 | struct fsnotify_event *event = NULL; |
226 | 226 | struct vfsmount *mnt; |
227 | 227 | int idx, ret = 0; |
228 | - bool used_inode, used_vfsmount; | |
229 | 228 | /* global tests shouldn't care about events on child only the specific event */ |
230 | 229 | __u32 test_mask = (mask & ~FS_EVENT_ON_CHILD); |
231 | 230 | |
... | ... | @@ -260,7 +259,6 @@ |
260 | 259 | } |
261 | 260 | |
262 | 261 | while (inode_node || vfsmount_node) { |
263 | - used_inode = used_vfsmount = false; | |
264 | 262 | inode_group = vfsmount_group = NULL; |
265 | 263 | |
266 | 264 | if (inode_node) { |
267 | 265 | |
268 | 266 | |
269 | 267 | |
270 | 268 | |
... | ... | @@ -279,23 +277,22 @@ |
279 | 277 | /* handle inode */ |
280 | 278 | send_to_group(to_tell, NULL, inode_mark, NULL, mask, data, |
281 | 279 | data_is, cookie, file_name, &event); |
282 | - used_inode = true; | |
280 | + /* we didn't use the vfsmount_mark */ | |
281 | + vfsmount_group = NULL; | |
283 | 282 | } else if (vfsmount_group > inode_group) { |
284 | 283 | send_to_group(to_tell, mnt, NULL, vfsmount_mark, mask, data, |
285 | 284 | data_is, cookie, file_name, &event); |
286 | - used_vfsmount = true; | |
285 | + inode_group = NULL; | |
287 | 286 | } else { |
288 | 287 | send_to_group(to_tell, mnt, inode_mark, vfsmount_mark, |
289 | 288 | mask, data, data_is, cookie, file_name, |
290 | 289 | &event); |
291 | - used_vfsmount = true; | |
292 | - used_inode = true; | |
293 | 290 | } |
294 | 291 | |
295 | - if (used_inode) | |
292 | + if (inode_group) | |
296 | 293 | inode_node = srcu_dereference(inode_node->next, |
297 | 294 | &fsnotify_mark_srcu); |
298 | - if (used_vfsmount) | |
295 | + if (vfsmount_group) | |
299 | 296 | vfsmount_node = srcu_dereference(vfsmount_node->next, |
300 | 297 | &fsnotify_mark_srcu); |
301 | 298 | } |