From 1e302a929e2da6e8448e2058e4b07b07252b57fe Mon Sep 17 00:00:00 2001 From: Jonathan Brassow Date: Thu, 2 Apr 2009 19:55:35 +0100 Subject: dm snapshot: move status to exception store Let the exception store types print out their status through the new API, rather than having the snapshot code do it. Adjust the buffer position to allow for the preceding DMEMIT in the arguments to type->status(). Signed-off-by: Jonathan Brassow Signed-off-by: Alasdair G Kergon --- drivers/md/dm-snap-transient.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'drivers/md/dm-snap-transient.c') diff --git a/drivers/md/dm-snap-transient.c b/drivers/md/dm-snap-transient.c index a883d6e658be..cde5aa558e6d 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; } -- cgit v1.2.3