From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 2/4] btrfs: Document locking require via lockdep_assert_held
Date: Wed, 27 Jun 2018 16:38:23 +0300 [thread overview]
Message-ID: <1530106705-27186-3-git-send-email-nborisov@suse.com> (raw)
In-Reply-To: <1530106705-27186-1-git-send-email-nborisov@suse.com>
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>
---
fs/btrfs/extent_io.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 4180a3b7e725..6ac15804bab1 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -5064,9 +5064,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)) {
--
2.7.4
next prev parent reply other threads:[~2018-06-27 13:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 13:38 [PATCH 0/4] Misc cleanups Nikolay Borisov
2018-06-27 13:38 ` [PATCH 1/4] btrfs: Refactor loop in btrfs_release_extent_buffer_page Nikolay Borisov
2018-06-29 12:35 ` David Sterba
2018-07-02 10:03 ` Nikolay Borisov
2018-07-19 15:19 ` David Sterba
2018-06-27 13:38 ` Nikolay Borisov [this message]
2018-06-27 13:38 ` [PATCH 3/4] btrfs: Rename EXTENT_BUFFER_DUMMY to EXTENT_BUFFER_PRIVATE Nikolay Borisov
2018-06-29 12:46 ` David Sterba
2018-06-29 13:07 ` Qu Wenruo
2018-06-29 13:42 ` Nikolay Borisov
2018-07-19 15:40 ` David Sterba
2018-06-29 13:53 ` David Sterba
2018-06-27 13:38 ` [PATCH 4/4] btrfs: Remove unnecessary locking code in qgroup_rescan_leaf Nikolay Borisov
2018-07-02 13:32 ` Nikolay Borisov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1530106705-27186-3-git-send-email-nborisov@suse.com \
--to=nborisov@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).