diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-06-22 05:12:25 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-06-22 05:12:25 -0400 |
commit | 5af443a7e1c0864100cc44525a9821aa2a2f4719 (patch) | |
tree | 87ab19984e94c8aaba743e47ab62cf084afbdf2c /drivers/md | |
parent | 494b3ee7d4f69210def80aecce28d08c3f0755d5 (diff) |
dm io: record eopnotsupp
Add another field, eopnotsupp_bits. It is subset of error_bits, representing
regions that returned -EOPNOTSUPP. (The bit is set in both error_bits and
eopnotsupp_bits).
This value will be used in further patches.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-io.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index e73aabd61cd7..a89f41f00757 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c | |||
@@ -22,6 +22,7 @@ struct dm_io_client { | |||
22 | /* FIXME: can we shrink this ? */ | 22 | /* FIXME: can we shrink this ? */ |
23 | struct io { | 23 | struct io { |
24 | unsigned long error_bits; | 24 | unsigned long error_bits; |
25 | unsigned long eopnotsupp_bits; | ||
25 | atomic_t count; | 26 | atomic_t count; |
26 | struct task_struct *sleeper; | 27 | struct task_struct *sleeper; |
27 | struct dm_io_client *client; | 28 | struct dm_io_client *client; |
@@ -107,8 +108,11 @@ static inline unsigned bio_get_region(struct bio *bio) | |||
107 | *---------------------------------------------------------------*/ | 108 | *---------------------------------------------------------------*/ |
108 | static void dec_count(struct io *io, unsigned int region, int error) | 109 | static void dec_count(struct io *io, unsigned int region, int error) |
109 | { | 110 | { |
110 | if (error) | 111 | if (error) { |
111 | set_bit(region, &io->error_bits); | 112 | set_bit(region, &io->error_bits); |
113 | if (error == -EOPNOTSUPP) | ||
114 | set_bit(region, &io->eopnotsupp_bits); | ||
115 | } | ||
112 | 116 | ||
113 | if (atomic_dec_and_test(&io->count)) { | 117 | if (atomic_dec_and_test(&io->count)) { |
114 | if (io->sleeper) | 118 | if (io->sleeper) |
@@ -361,6 +365,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions, | |||
361 | } | 365 | } |
362 | 366 | ||
363 | io.error_bits = 0; | 367 | io.error_bits = 0; |
368 | io.eopnotsupp_bits = 0; | ||
364 | atomic_set(&io.count, 1); /* see dispatch_io() */ | 369 | atomic_set(&io.count, 1); /* see dispatch_io() */ |
365 | io.sleeper = current; | 370 | io.sleeper = current; |
366 | io.client = client; | 371 | io.client = client; |
@@ -397,6 +402,7 @@ static int async_io(struct dm_io_client *client, unsigned int num_regions, | |||
397 | 402 | ||
398 | io = mempool_alloc(client->pool, GFP_NOIO); | 403 | io = mempool_alloc(client->pool, GFP_NOIO); |
399 | io->error_bits = 0; | 404 | io->error_bits = 0; |
405 | io->eopnotsupp_bits = 0; | ||
400 | atomic_set(&io->count, 1); /* see dispatch_io() */ | 406 | atomic_set(&io->count, 1); /* see dispatch_io() */ |
401 | io->sleeper = NULL; | 407 | io->sleeper = NULL; |
402 | io->client = client; | 408 | io->client = client; |