aboutsummaryrefslogtreecommitdiff
path: root/drivers/md/dm-table.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 19:30:50 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 19:30:50 -0800
commita4ffc0a0b240a29cbe489f6db9dae112a49ef1c1 (patch)
tree9719c706444f4b720aff2bb4bdf23a4be3f4b1e3 /drivers/md/dm-table.c
parentd7511ec8115487ccea2ce93bf58d5e5cd2c1c0a3 (diff)
parentaf195ac82e38ba802fd86b5a014ed05ef6dd88bb (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: (44 commits) dm raid1: report fault status dm raid1: handle read failures dm raid1: fix EIO after log failure dm raid1: handle recovery failures dm raid1: handle write failures dm snapshot: combine consecutive exceptions in memory dm: stripe enhanced status return dm: stripe trigger event on failure dm log: auto load modules dm: move deferred bio flushing to workqueue dm crypt: use async crypto dm crypt: prepare async callback fn dm crypt: add completion for async dm crypt: add async request mempool dm crypt: extract scatterlist processing dm crypt: tidy io ref counting dm crypt: introduce crypt_write_io_loop dm crypt: abstract crypt_write_done dm crypt: store sector mapping in dm_crypt_io dm crypt: move queue functions ...
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r--drivers/md/dm-table.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 47818d8249c..f1606298238 100644
--- a/drivers/md/dm-table.c
+++ b/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);
}
}
@@ -476,7 +475,7 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti,
int mode, struct dm_dev **result)
{
int r;
- dev_t dev;
+ dev_t uninitialized_var(dev);
struct dm_dev *dd;
unsigned int major, minor;
@@ -805,7 +804,7 @@ static int setup_indexes(struct dm_table *t)
return -ENOMEM;
/* set up internal nodes, bottom-up */
- for (i = t->depth - 2, total = 0; i >= 0; i--) {
+ for (i = t->depth - 2; i >= 0; i--) {
t->index[i] = indexes;
indexes += (KEYS_PER_NODE * t->counts[i]);
setup_btree_index(i, t);
@@ -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);