X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=fs%2Focfs2%2Fdlm%2Fdlmconvert.c;h=8285228d9e3778659df0ca4f5324b9108e941ac1;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=c764dc8e40a25eaa4c79a6491a388fb3e93060cd;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/fs/ocfs2/dlm/dlmconvert.c b/fs/ocfs2/dlm/dlmconvert.c index c764dc8e4..8285228d9 100644 --- a/fs/ocfs2/dlm/dlmconvert.c +++ b/fs/ocfs2/dlm/dlmconvert.c @@ -214,9 +214,6 @@ grant: if (lock->ml.node == dlm->node_num) mlog(0, "doing in-place convert for nonlocal lock\n"); lock->ml.type = type; - if (lock->lksb->flags & DLM_LKSB_PUT_LVB) - memcpy(res->lvb, lock->lksb->lvb, DLM_LVB_LEN); - status = DLM_NORMAL; *call_ast = 1; goto unlock_exit; @@ -234,7 +231,8 @@ switch_queues: lock->ml.convert_type = type; /* do not alter lock refcount. switching lists. */ - list_move_tail(&lock->list, &res->converting); + list_del_init(&lock->list); + list_add_tail(&lock->list, &res->converting); unlock_exit: spin_unlock(&lock->spinlock); @@ -250,7 +248,8 @@ void dlm_revert_pending_convert(struct dlm_lock_resource *res, struct dlm_lock *lock) { /* do not alter lock refcount. switching lists. */ - list_move_tail(&lock->list, &res->granted); + list_del_init(&lock->list); + list_add_tail(&lock->list, &res->granted); lock->ml.convert_type = LKM_IVMODE; lock->lksb->flags &= ~(DLM_LKSB_GET_LVB|DLM_LKSB_PUT_LVB); } @@ -295,7 +294,8 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, res->state |= DLM_LOCK_RES_IN_PROGRESS; /* move lock to local convert queue */ /* do not alter lock refcount. switching lists. */ - list_move_tail(&lock->list, &res->converting); + list_del_init(&lock->list); + list_add_tail(&lock->list, &res->converting); lock->convert_pending = 1; lock->ml.convert_type = type; @@ -464,12 +464,6 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data) } spin_lock(&res->spinlock); - status = __dlm_lockres_state_to_status(res); - if (status != DLM_NORMAL) { - spin_unlock(&res->spinlock); - dlm_error(status); - goto leave; - } list_for_each(iter, &res->granted) { lock = list_entry(iter, struct dlm_lock, list); if (lock->ml.cookie == cnv->cookie && @@ -479,21 +473,6 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data) } lock = NULL; } - if (!lock) { - __dlm_print_one_lock_resource(res); - list_for_each(iter, &res->granted) { - lock = list_entry(iter, struct dlm_lock, list); - if (lock->ml.node == cnv->node_idx) { - mlog(ML_ERROR, "There is something here " - "for node %u, lock->ml.cookie=%llu, " - "cnv->cookie=%llu\n", cnv->node_idx, - (unsigned long long)lock->ml.cookie, - (unsigned long long)cnv->cookie); - break; - } - } - lock = NULL; - } spin_unlock(&res->spinlock); if (!lock) { status = DLM_IVLOCKID;