* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011, Whamcloud, Inc.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
const struct cl_lock_descr *d, int idx)
{
struct cl_lock *parent;
- struct cl_lock *child;
struct lovsub_object *subobj;
struct cl_lock_descr *pd;
struct cl_lock_descr *parent_descr;
parent_descr = &parent->cll_descr;
LASSERT(cl_lock_mode_match(d->cld_mode, parent_descr->cld_mode));
- child = sublock->lss_cl.cls_lock;
subobj = cl2lovsub(sublock->lss_cl.cls_obj);
pd = &lov_env_info(env)->lti_ldescr;
result = 0;
switch (parent->cll_state) {
- case CLS_NEW:
case CLS_QUEUING:
- case CLS_ENQUEUED:
case CLS_FREEING:
cl_lock_signal(env, parent);
break;
* enqueues missing sub-lock.
*/
cl_lock_state_set(env, parent, CLS_NEW);
+ /* fall through */
+ case CLS_NEW:
/*
* if last sub-lock is canceled, destroy the top-lock (which
* is now `empty') proactively.
}
}
break;
+ case CLS_ENQUEUED:
case CLS_HELD:
CL_LOCK_DEBUG(D_ERROR, env, parent, "Delete CLS_HELD lock\n");
default:
- CERROR("Impossible state: %i\n", parent->cll_state);
+ CERROR("Impossible state: %d\n", parent->cll_state);
LBUG();
break;
}