diff options
author | Eric Paris <eparis@redhat.com> | 2010-07-28 10:18:38 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 10:18:51 -0400 |
commit | a4c6e9961fcb9da54648d98978d33c6fdcb7bb45 (patch) | |
tree | a109069ccd818ce9fd84f1ef1f0234e8452eb317 /fs/notify/inode_mark.c | |
parent | 0c6532e4e3b0c8bd18dd0a5cc1894a1944997cc6 (diff) |
fsnotify: use _rcu functions for mark list traversal
In preparation for srcu locking use all _rcu appropiete functions for mark
list addition, removal, and traversal. The operations are still done under a
spinlock at the end of this patch.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/inode_mark.c')
-rw-r--r-- | fs/notify/inode_mark.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c index 83ce6db34039..455cb41c729b 100644 --- a/fs/notify/inode_mark.c +++ b/fs/notify/inode_mark.c | |||
@@ -67,7 +67,7 @@ void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark) | |||
67 | 67 | ||
68 | spin_lock(&inode->i_lock); | 68 | spin_lock(&inode->i_lock); |
69 | 69 | ||
70 | hlist_del_init(&mark->i.i_list); | 70 | hlist_del_init_rcu(&mark->i.i_list); |
71 | mark->i.inode = NULL; | 71 | mark->i.inode = NULL; |
72 | 72 | ||
73 | /* | 73 | /* |
@@ -92,7 +92,7 @@ void fsnotify_clear_marks_by_inode(struct inode *inode) | |||
92 | spin_lock(&inode->i_lock); | 92 | spin_lock(&inode->i_lock); |
93 | hlist_for_each_entry_safe(mark, pos, n, &inode->i_fsnotify_marks, i.i_list) { | 93 | hlist_for_each_entry_safe(mark, pos, n, &inode->i_fsnotify_marks, i.i_list) { |
94 | list_add(&mark->i.free_i_list, &free_list); | 94 | list_add(&mark->i.free_i_list, &free_list); |
95 | hlist_del_init(&mark->i.i_list); | 95 | hlist_del_init_rcu(&mark->i.i_list); |
96 | fsnotify_get_mark(mark); | 96 | fsnotify_get_mark(mark); |
97 | } | 97 | } |
98 | spin_unlock(&inode->i_lock); | 98 | spin_unlock(&inode->i_lock); |
@@ -198,7 +198,7 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark, | |||
198 | 198 | ||
199 | /* is mark the first mark? */ | 199 | /* is mark the first mark? */ |
200 | if (hlist_empty(&inode->i_fsnotify_marks)) { | 200 | if (hlist_empty(&inode->i_fsnotify_marks)) { |
201 | hlist_add_head(&mark->i.i_list, &inode->i_fsnotify_marks); | 201 | hlist_add_head_rcu(&mark->i.i_list, &inode->i_fsnotify_marks); |
202 | goto out; | 202 | goto out; |
203 | } | 203 | } |
204 | 204 | ||
@@ -214,13 +214,13 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark, | |||
214 | if (mark->group < lmark->group) | 214 | if (mark->group < lmark->group) |
215 | continue; | 215 | continue; |
216 | 216 | ||
217 | hlist_add_before(&mark->i.i_list, &lmark->i.i_list); | 217 | hlist_add_before_rcu(&mark->i.i_list, &lmark->i.i_list); |
218 | goto out; | 218 | goto out; |
219 | } | 219 | } |
220 | 220 | ||
221 | BUG_ON(last == NULL); | 221 | BUG_ON(last == NULL); |
222 | /* mark should be the last entry. last is the current last entry */ | 222 | /* mark should be the last entry. last is the current last entry */ |
223 | hlist_add_after(last, &mark->i.i_list); | 223 | hlist_add_after_rcu(last, &mark->i.i_list); |
224 | out: | 224 | out: |
225 | fsnotify_recalc_inode_mask_locked(inode); | 225 | fsnotify_recalc_inode_mask_locked(inode); |
226 | spin_unlock(&inode->i_lock); | 226 | spin_unlock(&inode->i_lock); |