Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / fs / notify / inode_mark.c
index 83ce6db3403961c12ff8296c5f3d66c026772559..33297c00506050afb6bbe6227f8d47e4eb9cdd11 100644 (file)
@@ -67,7 +67,7 @@ void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark)
 
        spin_lock(&inode->i_lock);
 
-       hlist_del_init(&mark->i.i_list);
+       hlist_del_init_rcu(&mark->i.i_list);
        mark->i.inode = NULL;
 
        /*
@@ -92,7 +92,7 @@ void fsnotify_clear_marks_by_inode(struct inode *inode)
        spin_lock(&inode->i_lock);
        hlist_for_each_entry_safe(mark, pos, n, &inode->i_fsnotify_marks, i.i_list) {
                list_add(&mark->i.free_i_list, &free_list);
-               hlist_del_init(&mark->i.i_list);
+               hlist_del_init_rcu(&mark->i.i_list);
                fsnotify_get_mark(mark);
        }
        spin_unlock(&inode->i_lock);
@@ -187,7 +187,7 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark,
        struct hlist_node *node, *last = NULL;
        int ret = 0;
 
-       mark->flags = FSNOTIFY_MARK_FLAG_INODE;
+       mark->flags |= FSNOTIFY_MARK_FLAG_INODE;
 
        assert_spin_locked(&mark->lock);
        assert_spin_locked(&group->mark_lock);
@@ -198,7 +198,7 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark,
 
        /* is mark the first mark? */
        if (hlist_empty(&inode->i_fsnotify_marks)) {
-               hlist_add_head(&mark->i.i_list, &inode->i_fsnotify_marks);
+               hlist_add_head_rcu(&mark->i.i_list, &inode->i_fsnotify_marks);
                goto out;
        }
 
@@ -214,13 +214,13 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark,
                if (mark->group < lmark->group)
                        continue;
 
-               hlist_add_before(&mark->i.i_list, &lmark->i.i_list);
+               hlist_add_before_rcu(&mark->i.i_list, &lmark->i.i_list);
                goto out;
        }
 
        BUG_ON(last == NULL);
        /* mark should be the last entry.  last is the current last entry */
-       hlist_add_after(last, &mark->i.i_list);
+       hlist_add_after_rcu(last, &mark->i.i_list);
 out:
        fsnotify_recalc_inode_mask_locked(inode);
        spin_unlock(&inode->i_lock);
@@ -244,11 +244,11 @@ void fsnotify_unmount_inodes(struct list_head *list)
                struct inode *need_iput_tmp;
 
                /*
-                * We cannot __iget() an inode in state I_CLEAR, I_FREEING,
+                * We cannot __iget() an inode in state I_FREEING,
                 * I_WILL_FREE, or I_NEW which is fine because by that point
                 * the inode cannot have any associated watches.
                 */
-               if (inode->i_state & (I_CLEAR|I_FREEING|I_WILL_FREE|I_NEW))
+               if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
                        continue;
 
                /*
@@ -272,7 +272,7 @@ void fsnotify_unmount_inodes(struct list_head *list)
                /* In case the dropping of a reference would nuke next_i. */
                if ((&next_i->i_sb_list != list) &&
                    atomic_read(&next_i->i_count) &&
-                   !(next_i->i_state & (I_CLEAR | I_FREEING | I_WILL_FREE))) {
+                   !(next_i->i_state & (I_FREEING | I_WILL_FREE))) {
                        __iget(next_i);
                        need_iput = next_i;
                }