summaryrefslogtreecommitdiffstats
path: root/fs/notify/mark.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-12-16 04:53:32 -0500
committerJan Kara <jack@suse.cz>2017-04-10 11:37:34 -0400
commitc1f33073ac1b33510e956de7181438515e438db0 (patch)
tree01feda16ddcbb3d22f9d9862e6598b6edc9d7aa0 /fs/notify/mark.c
parent43471d15df0e7c40ca4df1513fc1dcf5765396ac (diff)
fsnotify: Update comments
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 <mszeredi@redhat.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify/mark.c')
-rw-r--r--fs/notify/mark.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index 6043306e8e21..44836e539169 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -51,7 +51,7 @@
51 * 51 *
52 * LIFETIME: 52 * LIFETIME:
53 * Inode marks survive between when they are added to an inode and when their 53 * Inode marks survive between when they are added to an inode and when their
54 * refcnt==0. 54 * refcnt==0. Marks are also protected by fsnotify_mark_srcu.
55 * 55 *
56 * The inode mark can be cleared for a number of different reasons including: 56 * The inode mark can be cleared for a number of different reasons including:
57 * - The inode is unlinked for the last time. (fsnotify_inode_remove) 57 * - The inode is unlinked for the last time. (fsnotify_inode_remove)
@@ -61,17 +61,6 @@
61 * - The fsnotify_group associated with the mark is going away and all such marks 61 * - The fsnotify_group associated with the mark is going away and all such marks
62 * need to be cleaned up. (fsnotify_clear_marks_by_group) 62 * need to be cleaned up. (fsnotify_clear_marks_by_group)
63 * 63 *
64 * Worst case we are given an inode and need to clean up all the marks on that
65 * inode. We take i_lock and walk the i_fsnotify_marks safely. For each
66 * mark on the list we take a reference (so the mark can't disappear under us).
67 * We remove that mark form the inode's list of marks and we add this mark to a
68 * private list anchored on the stack using i_free_list; we walk i_free_list
69 * and before we destroy the mark we make sure that we dont race with a
70 * concurrent destroy_group by getting a ref to the marks group and taking the
71 * groups mutex.
72
73 * Very similarly for freeing by group, except we use free_g_list.
74 *
75 * This has the very interesting property of being able to run concurrently with 64 * This has the very interesting property of being able to run concurrently with
76 * any (or all) other directions. 65 * any (or all) other directions.
77 */ 66 */