diff options
author | Alexander Aring <aahringo@redhat.com> | 2024-04-02 15:17:59 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2024-04-09 11:44:49 -0500 |
commit | 29e345f3c68e2bcf094162fc36394d348ccfb9ff (patch) | |
tree | dd960a9e323f605078f588fa85e3292b9182ce01 /fs/dlm/recover.c | |
parent | 455597a55f402e52e1c577c921bf5fe3aa4d2281 (diff) |
dlm: move root_list functionality to recover.c
Move dlm_create_root_list() and dlm_release_root_list() to
recover.c and declare them static because they are only used
there.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/recover.c')
-rw-r--r-- | fs/dlm/recover.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/fs/dlm/recover.c b/fs/dlm/recover.c index ce6dc914cb86..6abc283f8f36 100644 --- a/fs/dlm/recover.c +++ b/fs/dlm/recover.c @@ -889,48 +889,6 @@ void dlm_recover_rsbs(struct dlm_ls *ls) /* Create a single list of all root rsb's to be used during recovery */ -int dlm_create_root_list(struct dlm_ls *ls) -{ - struct rb_node *n; - struct dlm_rsb *r; - int i, error = 0; - - down_write(&ls->ls_root_sem); - if (!list_empty(&ls->ls_root_list)) { - log_error(ls, "root list not empty"); - error = -EINVAL; - goto out; - } - - for (i = 0; i < ls->ls_rsbtbl_size; i++) { - spin_lock(&ls->ls_rsbtbl[i].lock); - for (n = rb_first(&ls->ls_rsbtbl[i].keep); n; n = rb_next(n)) { - r = rb_entry(n, struct dlm_rsb, res_hashnode); - list_add(&r->res_root_list, &ls->ls_root_list); - dlm_hold_rsb(r); - } - - if (!RB_EMPTY_ROOT(&ls->ls_rsbtbl[i].toss)) - log_error(ls, "dlm_create_root_list toss not empty"); - spin_unlock(&ls->ls_rsbtbl[i].lock); - } - out: - up_write(&ls->ls_root_sem); - return error; -} - -void dlm_release_root_list(struct dlm_ls *ls) -{ - struct dlm_rsb *r, *safe; - - down_write(&ls->ls_root_sem); - list_for_each_entry_safe(r, safe, &ls->ls_root_list, res_root_list) { - list_del_init(&r->res_root_list); - dlm_put_rsb(r); - } - up_write(&ls->ls_root_sem); -} - void dlm_clear_toss(struct dlm_ls *ls) { struct rb_node *n, *next; |