[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210409025131.4114078-6-willy@infradead.org>
Date: Fri, 9 Apr 2021 03:51:19 +0100
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
To: neilb@...e.de, peterz@...radead.org, mingo@...hat.com,
will@...nel.org, longman@...hat.com, boqun.feng@...il.com,
tglx@...utronix.de, bigeasy@...utronix.de
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH 05/17] dm-snap: Add dm_exceptional_lock
Allow lockdep to track the dm-snap bit spin locks.
Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
drivers/md/dm-snap.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 8f3ad87e6117..4c2a01e433de 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -644,16 +644,18 @@ static void dm_exception_table_lock_init(struct dm_snapshot *s, chunk_t chunk,
lock->pending_slot = &pending->table[exception_hash(pending, chunk)];
}
+static DEFINE_SPLIT_LOCK(dm_exception_lock);
+
static void dm_exception_table_lock(struct dm_exception_table_lock *lock)
{
- hlist_bl_lock(lock->complete_slot);
- hlist_bl_lock(lock->pending_slot);
+ hlist_bl_lock(lock->complete_slot, &dm_exception_lock);
+ hlist_bl_lock_nested(lock->pending_slot, &dm_exception_lock, 1);
}
static void dm_exception_table_unlock(struct dm_exception_table_lock *lock)
{
- hlist_bl_unlock(lock->pending_slot);
- hlist_bl_unlock(lock->complete_slot);
+ hlist_bl_unlock(lock->pending_slot, &dm_exception_lock);
+ hlist_bl_unlock(lock->complete_slot, &dm_exception_lock);
}
static int dm_exception_table_init(struct dm_exception_table *et,
--
2.30.2
Powered by blists - more mailing lists