Skip to content

Commit

Permalink
fsnotify: Update comments
Browse files Browse the repository at this point in the history
Add a comment that lifetime of a notification mark is protected by SRCU
and remove a comment about clearing of marks attached to the inode. It
is stale and more uptodate version is at fsnotify_destroy_marks() which
is the function handling this case.

Reviewed-by: Miklos Szeredi <[email protected]>
Reviewed-by: Amir Goldstein <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
jankara committed Apr 10, 2017
1 parent 43471d1 commit c1f3307
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions fs/notify/mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*
* LIFETIME:
* Inode marks survive between when they are added to an inode and when their
* refcnt==0.
* refcnt==0. Marks are also protected by fsnotify_mark_srcu.
*
* The inode mark can be cleared for a number of different reasons including:
* - The inode is unlinked for the last time. (fsnotify_inode_remove)
Expand All @@ -61,17 +61,6 @@
* - The fsnotify_group associated with the mark is going away and all such marks
* need to be cleaned up. (fsnotify_clear_marks_by_group)
*
* Worst case we are given an inode and need to clean up all the marks on that
* inode. We take i_lock and walk the i_fsnotify_marks safely. For each
* mark on the list we take a reference (so the mark can't disappear under us).
* We remove that mark form the inode's list of marks and we add this mark to a
* private list anchored on the stack using i_free_list; we walk i_free_list
* and before we destroy the mark we make sure that we dont race with a
* concurrent destroy_group by getting a ref to the marks group and taking the
* groups mutex.
* Very similarly for freeing by group, except we use free_g_list.
*
* This has the very interesting property of being able to run concurrently with
* any (or all) other directions.
*/
Expand Down

0 comments on commit c1f3307

Please sign in to comment.