Skip to content

Commit d3b3d2d

Browse files
Alexander Aringteigland
authored andcommitted
dlm: remove unnecessary refcounts
This patch removes unnecessary refcounts that are obviously not necessary because either when the pointer is passed as parameter or it is part of a list we should already hold a reference to it. Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent 1169788 commit d3b3d2d

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

fs/dlm/lock.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,18 +1442,6 @@ static void deactivate_rsb(struct kref *kref)
14421442
}
14431443
}
14441444

1445-
/* See comment for unhold_lkb */
1446-
1447-
static void unhold_rsb(struct dlm_rsb *r)
1448-
{
1449-
int rv;
1450-
1451-
/* inactive rsbs are not ref counted */
1452-
WARN_ON(rsb_flag(r, RSB_INACTIVE));
1453-
rv = kref_put(&r->res_ref, deactivate_rsb);
1454-
DLM_ASSERT(!rv, dlm_dump_rsb(r););
1455-
}
1456-
14571445
void free_inactive_rsb(struct dlm_rsb *r)
14581446
{
14591447
WARN_ON_ONCE(!rsb_flag(r, RSB_INACTIVE));
@@ -1675,10 +1663,8 @@ static void del_lkb(struct dlm_rsb *r, struct dlm_lkb *lkb)
16751663

16761664
static void move_lkb(struct dlm_rsb *r, struct dlm_lkb *lkb, int sts)
16771665
{
1678-
hold_lkb(lkb);
16791666
del_lkb(r, lkb);
16801667
add_lkb(r, lkb, sts);
1681-
unhold_lkb(lkb);
16821668
}
16831669

16841670
static int msg_reply_type(int mstype)
@@ -5409,7 +5395,6 @@ void dlm_recover_purge(struct dlm_ls *ls, const struct list_head *root_list)
54095395
return;
54105396

54115397
list_for_each_entry(r, root_list, res_root_list) {
5412-
hold_rsb(r);
54135398
lock_rsb(r);
54145399
if (is_master(r)) {
54155400
purge_dead_list(ls, r, &r->res_grantqueue,
@@ -5420,7 +5405,7 @@ void dlm_recover_purge(struct dlm_ls *ls, const struct list_head *root_list)
54205405
nodeid_gone, &lkb_count);
54215406
}
54225407
unlock_rsb(r);
5423-
unhold_rsb(r);
5408+
54245409
cond_resched();
54255410
}
54265411

0 commit comments

Comments
 (0)