lkml.org 
[lkml]   [2021]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/17] dm-snap: Add dm_exceptional_lock
Date
Allow lockdep to track the dm-snap bit spin locks.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.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
\
 
 \ /
  Last update: 2021-04-09 04:56    [W:0.139 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site