fsnotify: Determine lock in fsnotify_destroy_marks()
[sfrench/cifs-2.6.git] / fs / notify / mark.c
index 0830e0af997a5df9ce67469a7112b8fc483ae3d4..f32ca924c44ed7cea2df8ebed52d0fcc19eda62a 100644 (file)
@@ -572,14 +572,19 @@ void fsnotify_detach_group_marks(struct fsnotify_group *group)
        }
 }
 
-void fsnotify_destroy_marks(struct fsnotify_mark_connector *conn,
-                           spinlock_t *lock)
+void fsnotify_destroy_marks(struct fsnotify_mark_connector *conn)
 {
        struct fsnotify_mark *mark;
+       spinlock_t *lock;
 
        if (!conn)
                return;
 
+       if (conn->flags & FSNOTIFY_OBJ_TYPE_INODE)
+               lock = &conn->inode->i_lock;
+       else
+               lock = &conn->mnt->mnt_root->d_lock;
+
        while (1) {
                /*
                 * We have to be careful since we can race with e.g.