Commit 988b9ea9 authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman

staging: lustre: obdclass: simplify cl_lock_fini()

Using list_first_entry_or_null() makes this (slightly)
simpler.
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dff16268
......@@ -79,13 +79,12 @@ EXPORT_SYMBOL(cl_lock_slice_add);
void cl_lock_fini(const struct lu_env *env, struct cl_lock *lock)
{
struct cl_lock_slice *slice;
cl_lock_trace(D_DLMTRACE, env, "destroy lock", lock);
while (!list_empty(&lock->cll_layers)) {
struct cl_lock_slice *slice;
slice = list_entry(lock->cll_layers.next,
struct cl_lock_slice, cls_linkage);
while ((slice = list_first_entry_or_null(&lock->cll_layers,
struct cl_lock_slice,
cls_linkage)) != NULL) {
list_del_init(lock->cll_layers.next);
slice->cls_ops->clo_fini(env, slice);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment