提交 dff16268 编写于 作者: N NeilBrown 提交者: Greg Kroah-Hartman

staging: lustre: simplfy lov_finish_set()

When deleting everything from a list, a while loop
is cleaner than list_for_each_safe().
Signed-off-by: NNeilBrown <neilb@suse.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 557d001a
......@@ -49,15 +49,13 @@ static void lov_init_set(struct lov_request_set *set)
static void lov_finish_set(struct lov_request_set *set)
{
struct list_head *pos, *n;
struct lov_request *req;
LASSERT(set);
list_for_each_safe(pos, n, &set->set_list) {
struct lov_request *req = list_entry(pos,
struct lov_request,
rq_link);
while ((req = list_first_entry_or_null(&set->set_list,
struct lov_request,
rq_link)) != NULL) {
list_del_init(&req->rq_link);
kfree(req->rq_oi.oi_osfs);
kfree(req);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册