diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h index 023a707503c438476c2875d38ce922745920b6aa..0a2e6e7f67b3c5b6ac4c4cbd7dc2ca6811eaa30c 100644 --- a/drivers/md/dm-exception-store.h +++ b/drivers/md/dm-exception-store.h @@ -79,8 +79,9 @@ struct dm_exception_store_type { */ void (*drop_snapshot) (struct dm_exception_store *store); - int (*status) (struct dm_exception_store *store, status_type_t status, - char *result, unsigned int maxlen); + unsigned (*status) (struct dm_exception_store *store, + status_type_t status, char *result, + unsigned maxlen); /* * Return how full the snapshot is. diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index 3907c4ce2ae541d545e978e95d8e9ed51cc85228..1799205cd945745e548106479ddd3d32ad1b7853 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c @@ -688,11 +688,19 @@ static int persistent_ctr(struct dm_exception_store *store, return 0; } -static int persistent_status(struct dm_exception_store *store, - status_type_t status, char *result, - unsigned int maxlen) +static unsigned persistent_status(struct dm_exception_store *store, + status_type_t status, char *result, + unsigned maxlen) { - int sz = 0; + unsigned sz = 0; + + switch (status) { + case STATUSTYPE_INFO: + break; + case STATUSTYPE_TABLE: + DMEMIT(" %s P %llu", store->cow->name, + (unsigned long long)store->chunk_size); + } return sz; } diff --git a/drivers/md/dm-snap-transient.c b/drivers/md/dm-snap-transient.c index a883d6e658beeca358bc65c34a246ce3efb1bf15..cde5aa558e6d77b7d1130777762f8aec84c86ab1 100644 --- a/drivers/md/dm-snap-transient.c +++ b/drivers/md/dm-snap-transient.c @@ -81,11 +81,19 @@ static int transient_ctr(struct dm_exception_store *store, return 0; } -static int transient_status(struct dm_exception_store *store, - status_type_t status, char *result, - unsigned maxlen) +static unsigned transient_status(struct dm_exception_store *store, + status_type_t status, char *result, + unsigned maxlen) { - int sz = 0; + unsigned sz = 0; + + switch (status) { + case STATUSTYPE_INFO: + break; + case STATUSTYPE_TABLE: + DMEMIT(" %s N %llu", store->cow->name, + (unsigned long long)store->chunk_size); + } return sz; } diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 974916b9ea214cd96614a23eb7c348445e213e6d..981a0413068f8028c90e7da039cf5d48fcc27b9b 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -70,9 +70,6 @@ struct dm_snapshot { /* Origin writes don't trigger exceptions until this is set */ int active; - /* Used for display of table */ - char type; - mempool_t *pending_pool; atomic_t pending_exceptions_count; @@ -1166,9 +1163,8 @@ static int snapshot_status(struct dm_target *ti, status_type_t type, * make sense. */ DMEMIT("%s", snap->origin->name); - DMEMIT(" %s %s %llu", snap->store->cow->name, - snap->store->type->name, - (unsigned long long)snap->store->chunk_size); + snap->store->type->status(snap->store, type, result + sz, + maxlen - sz); break; }