Commit 5af443a7 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Alasdair G Kergon

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: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 494b3ee7
...@@ -22,6 +22,7 @@ struct dm_io_client { ...@@ -22,6 +22,7 @@ struct dm_io_client {
/* FIXME: can we shrink this ? */ /* FIXME: can we shrink this ? */
struct io { struct io {
unsigned long error_bits; unsigned long error_bits;
unsigned long eopnotsupp_bits;
atomic_t count; atomic_t count;
struct task_struct *sleeper; struct task_struct *sleeper;
struct dm_io_client *client; struct dm_io_client *client;
...@@ -107,8 +108,11 @@ static inline unsigned bio_get_region(struct bio *bio) ...@@ -107,8 +108,11 @@ static inline unsigned bio_get_region(struct bio *bio)
*---------------------------------------------------------------*/ *---------------------------------------------------------------*/
static void dec_count(struct io *io, unsigned int region, int error) static void dec_count(struct io *io, unsigned int region, int error)
{ {
if (error) if (error) {
set_bit(region, &io->error_bits); set_bit(region, &io->error_bits);
if (error == -EOPNOTSUPP)
set_bit(region, &io->eopnotsupp_bits);
}
if (atomic_dec_and_test(&io->count)) { if (atomic_dec_and_test(&io->count)) {
if (io->sleeper) if (io->sleeper)
...@@ -361,6 +365,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions, ...@@ -361,6 +365,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions,
} }
io.error_bits = 0; io.error_bits = 0;
io.eopnotsupp_bits = 0;
atomic_set(&io.count, 1); /* see dispatch_io() */ atomic_set(&io.count, 1); /* see dispatch_io() */
io.sleeper = current; io.sleeper = current;
io.client = client; io.client = client;
...@@ -397,6 +402,7 @@ static int async_io(struct dm_io_client *client, unsigned int num_regions, ...@@ -397,6 +402,7 @@ static int async_io(struct dm_io_client *client, unsigned int num_regions,
io = mempool_alloc(client->pool, GFP_NOIO); io = mempool_alloc(client->pool, GFP_NOIO);
io->error_bits = 0; io->error_bits = 0;
io->eopnotsupp_bits = 0;
atomic_set(&io->count, 1); /* see dispatch_io() */ atomic_set(&io->count, 1); /* see dispatch_io() */
io->sleeper = NULL; io->sleeper = NULL;
io->client = client; io->client = client;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment