summaryrefslogtreecommitdiff
path: root/drivers/md/dm-exception-store.h
diff options
context:
space:
mode:
authorNikos Tsironis <ntsironis@arrikto.com>2019-03-17 15:22:57 +0300
committerMike Snitzer <snitzer@redhat.com>2019-04-18 23:18:29 +0300
commitf79ae415b64c35d9ecca159fe796cf98d2ff9e9c (patch)
tree83b3ccd0c5cb27d1b696602c57834d003b8bcc65 /drivers/md/dm-exception-store.h
parent4ad8d880b6c4497e365fb6fd16bab52e9974a3f6 (diff)
downloadlinux-f79ae415b64c35d9ecca159fe796cf98d2ff9e9c.tar.xz
dm snapshot: Make exception tables scalable
Use list_bl to implement the exception hash tables' buckets. This change permits concurrent access, to distinct buckets, by multiple threads. Also, implement helper functions to lock and unlock the exception tables based on the chunk number of the exception at hand. We retain the global locking, by means of down_write(), which is replaced by the next commit. Still, we must acquire the per-bucket spinlocks when accessing the hash tables, since list_bl does not allow modification on unlocked lists. Co-developed-by: Ilias Tsitsimpis <iliastsi@arrikto.com> Signed-off-by: Nikos Tsironis <ntsironis@arrikto.com> Acked-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-exception-store.h')
-rw-r--r--drivers/md/dm-exception-store.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h
index 12b5216c2cfe..5a3c696c057f 100644
--- a/drivers/md/dm-exception-store.h
+++ b/drivers/md/dm-exception-store.h
@@ -11,6 +11,7 @@
#define _LINUX_DM_EXCEPTION_STORE
#include <linux/blkdev.h>
+#include <linux/list_bl.h>
#include <linux/device-mapper.h>
/*
@@ -27,7 +28,7 @@ typedef sector_t chunk_t;
* chunk within the device.
*/
struct dm_exception {
- struct list_head hash_list;
+ struct hlist_bl_node hash_list;
chunk_t old_chunk;
chunk_t new_chunk;