btrfs: Document locking requirement via lockdep_assert_held
authorNikolay Borisov <nborisov@suse.com>
Wed, 27 Jun 2018 13:38:23 +0000 (16:38 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:54 +0000 (13:12 +0200)
Remove stale comment since there is no longer an eb->eb_lock and
document the locking expectation with a lockdep_assert_held statement.
No functional changes.

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

index 6a4013ddcf7339971f720f1f8f7d3d520c2506a5..5ab401f79683896865474a4ffd0ea768b1263255 100644 (file)
@@ -5066,9 +5066,10 @@ static inline void btrfs_release_extent_buffer_rcu(struct rcu_head *head)
        __free_extent_buffer(eb);
 }
 
-/* Expects to have eb->eb_lock already held */
 static int release_extent_buffer(struct extent_buffer *eb)
 {
+       lockdep_assert_held(&eb->refs_lock);
+
        WARN_ON(atomic_read(&eb->refs) == 0);
        if (atomic_dec_and_test(&eb->refs)) {
                if (test_and_clear_bit(EXTENT_BUFFER_IN_TREE, &eb->bflags)) {