[dm-devel] [PATCH] 6/9: Use a bio_list for failed_ios
Kevin Corry
kevcorry at us.ibm.com
Tue Jan 13 17:00:02 UTC 2004
Change the failed_ios list in the multipath structure from a stack to a queue
using the new bio_list services.
--- diff/drivers/md/dm-mpath.c 2004-01-13 15:12:18.000000000 -0600
+++ source/drivers/md/dm-mpath.c 2004-01-13 15:15:12.000000000 -0600
@@ -7,6 +7,7 @@
#include "dm.h"
#include "dm-daemon.h"
#include "dm-path-selector.h"
+#include "dm-bio-list.h"
#include <linux/ctype.h>
#include <linux/init.h>
@@ -59,7 +60,7 @@
unsigned min_io;
spinlock_t failed_lock;
- struct bio *failed_ios;
+ struct bio_list failed_ios;
unsigned test_interval;
atomic_t trigger_event;
@@ -238,8 +239,7 @@
struct bio *bio, *next_bio;
spin_lock_irqsave(&m->failed_lock, flags);
- bio = m->failed_ios;
- m->failed_ios = NULL;
+ bio = bio_list_get(&m->failed_ios);
spin_unlock_irqrestore(&m->failed_lock, flags);
while (bio) {
@@ -690,8 +690,7 @@
if (!r) {
/* queue for the daemon to resubmit */
spin_lock_irqsave(&m->failed_lock, flags);
- bio->bi_next = m->failed_ios;
- m->failed_ios = bio;
+ bio_list_add(&m->failed_ios, bio);
spin_unlock_irqrestore(&m->failed_lock, flags);
dm_daemon_wake(&_kmpathd);
More information about the dm-devel
mailing list