summaryrefslogtreecommitdiffstats
path: root/fs/dlm/lockspace.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2012-05-15 16:07:49 -0500
committerDavid Teigland <teigland@redhat.com>2012-07-16 14:17:52 -0500
commit1d7c484eeb167fc374294e38ae402de4097c8611 (patch)
tree82ed8a279b8f399205a15951c50c22aea67d7323 /fs/dlm/lockspace.c
parentc04fecb4d9f7753e0cbff7edd03ec68f8721cdce (diff)
downloadtalos-obmc-linux-1d7c484eeb167fc374294e38ae402de4097c8611.tar.gz
talos-obmc-linux-1d7c484eeb167fc374294e38ae402de4097c8611.zip
dlm: use idr instead of list for recovered rsbs
When a large number of resources are being recovered, a linear search of the recover_list takes a long time. Use an idr in place of a list. Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/lockspace.c')
-rw-r--r--fs/dlm/lockspace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 065bb75ed609..d4d3b3165c6c 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -565,6 +565,8 @@ static int new_lockspace(const char *name, const char *cluster,
INIT_LIST_HEAD(&ls->ls_recover_list);
spin_lock_init(&ls->ls_recover_list_lock);
+ idr_init(&ls->ls_recover_idr);
+ spin_lock_init(&ls->ls_recover_idr_lock);
ls->ls_recover_list_count = 0;
ls->ls_local_handle = ls;
init_waitqueue_head(&ls->ls_wait_general);
@@ -636,6 +638,7 @@ static int new_lockspace(const char *name, const char *cluster,
spin_lock(&lslist_lock);
list_del(&ls->ls_list);
spin_unlock(&lslist_lock);
+ idr_destroy(&ls->ls_recover_idr);
kfree(ls->ls_recover_buf);
out_lkbfree:
idr_destroy(&ls->ls_lkbidr);
OpenPOWER on IntegriCloud