summaryrefslogtreecommitdiffstats
path: root/fs/notify
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-02-01 09:23:48 +0100
committerJan Kara <jack@suse.cz>2017-04-10 17:37:35 +0200
commit0810b4f9f207910d90aee56d312d25f334796363 (patch)
tree80694c7bb741091b13e6f53e31e28db3f3dbe1d9 /fs/notify
parent755b5bc681eb46de7bfaec196f85e30efd95bd9f (diff)
downloadlinux-0810b4f9f207910d90aee56d312d25f334796363.tar.bz2
fsnotify: Move fsnotify_destroy_marks()
Move fsnotify_destroy_marks() to be later in the fs/notify/mark.c. It will need some functions that are declared after its current declaration. No functional change. 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')
-rw-r--r--fs/notify/mark.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index e8c2f829ce65..b3f83ed6e8be 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -224,42 +224,6 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark,
fsnotify_free_mark(mark);
}
-void fsnotify_destroy_marks(struct fsnotify_mark_connector *conn,
- spinlock_t *lock)
-{
- struct fsnotify_mark *mark;
-
- if (!conn)
- return;
-
- while (1) {
- /*
- * We have to be careful since we can race with e.g.
- * fsnotify_clear_marks_by_group() and once we drop 'lock',
- * mark can get removed from the obj_list and destroyed. But
- * we are holding mark reference so mark cannot be freed and
- * calling fsnotify_destroy_mark() more than once is fine.
- */
- spin_lock(lock);
- if (hlist_empty(&conn->list)) {
- spin_unlock(lock);
- break;
- }
- mark = hlist_entry(conn->list.first, struct fsnotify_mark,
- obj_list);
- /*
- * We don't update i_fsnotify_mask / mnt_fsnotify_mask here
- * since inode / mount is going away anyway. So just remove
- * mark from the list.
- */
- hlist_del_init_rcu(&mark->obj_list);
- fsnotify_get_mark(mark);
- spin_unlock(lock);
- fsnotify_destroy_mark(mark, mark->group);
- fsnotify_put_mark(mark);
- }
-}
-
void fsnotify_connector_free(struct fsnotify_mark_connector **connp)
{
if (*connp) {
@@ -580,6 +544,42 @@ void fsnotify_detach_group_marks(struct fsnotify_group *group)
}
}
+void fsnotify_destroy_marks(struct fsnotify_mark_connector *conn,
+ spinlock_t *lock)
+{
+ struct fsnotify_mark *mark;
+
+ if (!conn)
+ return;
+
+ while (1) {
+ /*
+ * We have to be careful since we can race with e.g.
+ * fsnotify_clear_marks_by_group() and once we drop 'lock',
+ * mark can get removed from the obj_list and destroyed. But
+ * we are holding mark reference so mark cannot be freed and
+ * calling fsnotify_destroy_mark() more than once is fine.
+ */
+ spin_lock(lock);
+ if (hlist_empty(&conn->list)) {
+ spin_unlock(lock);
+ break;
+ }
+ mark = hlist_entry(conn->list.first, struct fsnotify_mark,
+ obj_list);
+ /*
+ * We don't update i_fsnotify_mask / mnt_fsnotify_mask here
+ * since inode / mount is going away anyway. So just remove
+ * mark from the list.
+ */
+ hlist_del_init_rcu(&mark->obj_list);
+ fsnotify_get_mark(mark);
+ spin_unlock(lock);
+ fsnotify_destroy_mark(mark, mark->group);
+ fsnotify_put_mark(mark);
+ }
+}
+
/*
* Nothing fancy, just initialize lists and locks and counters.
*/