mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-29 11:44:39 -04:00
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: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
557d001aa5
commit
dff162689a
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user