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 <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:
Jonathan Brassow
2009-04-02 19:55:35 +01:00
committed by Alasdair G Kergon
parent fee1998e9c
commit 1e302a929e
4 changed files with 29 additions and 16 deletions

View File

@ -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;
}