From 38affc080b46174ae1617c0d8964dd7e9f1bdb88 Mon Sep 17 00:00:00 2001 From: Paul Jimenez Date: Fri, 8 Feb 2008 02:09:59 +0000 Subject: [PATCH] --- yaml --- r: 84559 b: refs/heads/master c: afb24528f9012e5c6361ca9a9128c7c089c1cc7c h: refs/heads/master i: 84557: fc39db457dc42903ce96c79573d49fcaa49012c7 84555: 4871180ebe6fb16feaa6df3a8fb88650472c9b65 84551: 2b47b89c7c093602531a2de04c2ba9b77a56493b 84543: d7c18b18832d0617e5026f955a3b8323404994cf v: v3 --- [refs] | 2 +- trunk/drivers/md/dm-table.c | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 752b0eb21c81..a8569cdc44c3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 76c072b48e39e9291fbf02d6c912cf27d65e093d +refs/heads/master: afb24528f9012e5c6361ca9a9128c7c089c1cc7c diff --git a/trunk/drivers/md/dm-table.c b/trunk/drivers/md/dm-table.c index 47818d8249cb..d2eb3c593682 100644 --- a/trunk/drivers/md/dm-table.c +++ b/trunk/drivers/md/dm-table.c @@ -287,9 +287,8 @@ static void free_devices(struct list_head *devices) { struct list_head *tmp, *next; - for (tmp = devices->next; tmp != devices; tmp = next) { + list_for_each_safe(tmp, next, devices) { struct dm_dev *dd = list_entry(tmp, struct dm_dev, list); - next = tmp->next; kfree(dd); } } @@ -993,12 +992,11 @@ int dm_table_resume_targets(struct dm_table *t) int dm_table_any_congested(struct dm_table *t, int bdi_bits) { - struct list_head *d, *devices; + struct dm_dev *dd; + struct list_head *devices = dm_table_get_devices(t); int r = 0; - devices = dm_table_get_devices(t); - for (d = devices->next; d != devices; d = d->next) { - struct dm_dev *dd = list_entry(d, struct dm_dev, list); + list_for_each_entry(dd, devices, list) { struct request_queue *q = bdev_get_queue(dd->bdev); r |= bdi_congested(&q->backing_dev_info, bdi_bits); } @@ -1008,10 +1006,10 @@ int dm_table_any_congested(struct dm_table *t, int bdi_bits) void dm_table_unplug_all(struct dm_table *t) { - struct list_head *d, *devices = dm_table_get_devices(t); + struct dm_dev *dd; + struct list_head *devices = dm_table_get_devices(t); - for (d = devices->next; d != devices; d = d->next) { - struct dm_dev *dd = list_entry(d, struct dm_dev, list); + list_for_each_entry(dd, devices, list) { struct request_queue *q = bdev_get_queue(dd->bdev); blk_unplug(q);