btrfs: assert delayed ref lock in btrfs_find_delayed_ref_head
authorDavid Sterba <dsterba@suse.com>
Wed, 27 Mar 2019 15:19:55 +0000 (16:19 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 2 Jul 2019 10:30:47 +0000 (12:30 +0200)
Turn the comment about required lock into an assertion.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-ref.c

index a73fc23e29618700d6bc800c897b6da7cf616341..a94fae897b3f96f99112c74ea864db09f4fedb1e 100644 (file)
@@ -957,13 +957,14 @@ int btrfs_add_delayed_extent_op(struct btrfs_trans_handle *trans,
 }
 
 /*
- * this does a simple search for the head node for a given extent.
- * It must be called with the delayed ref spinlock held, and it returns
- * the head node if any where found, or NULL if not.
+ * This does a simple search for the head node for a given extent.  Returns the
+ * head node if found, or NULL if not.
  */
 struct btrfs_delayed_ref_head *
 btrfs_find_delayed_ref_head(struct btrfs_delayed_ref_root *delayed_refs, u64 bytenr)
 {
+       lockdep_assert_held(&delayed_refs->lock);
+
        return find_ref_head(delayed_refs, bytenr, false);
 }