diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2009-04-02 19:55:34 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-04-02 19:55:34 +0100 |
commit | 2e4a31df2b10cbcaf43c333112f6f7440a035c69 (patch) | |
tree | fbfcde3d358e615b500c22219190654825e48a26 | |
parent | ccc45ea8aeffec49fa5985efc3649aa67bb4fcb7 (diff) |
dm snapshot: use DMEMIT macro for status
Use DMEMIT in place of snprintf. This makes it easier later when
other modules are helping to populate our status output.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
-rw-r--r-- | drivers/md/dm-snap.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index bb28f9782bdd..fcb1ac12119f 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -1214,24 +1214,25 @@ static void snapshot_resume(struct dm_target *ti) static int snapshot_status(struct dm_target *ti, status_type_t type, char *result, unsigned int maxlen) { + unsigned sz = 0; struct dm_snapshot *snap = ti->private; switch (type) { case STATUSTYPE_INFO: if (!snap->valid) - snprintf(result, maxlen, "Invalid"); + DMEMIT("Invalid"); else { if (snap->store->type->fraction_full) { sector_t numerator, denominator; snap->store->type->fraction_full(snap->store, &numerator, &denominator); - snprintf(result, maxlen, "%llu/%llu", - (unsigned long long)numerator, - (unsigned long long)denominator); + DMEMIT("%llu/%llu", + (unsigned long long)numerator, + (unsigned long long)denominator); } else - snprintf(result, maxlen, "Unknown"); + DMEMIT("Unknown"); } break; @@ -1241,10 +1242,10 @@ static int snapshot_status(struct dm_target *ti, status_type_t type, * to make private copies if the output is to * make sense. */ - snprintf(result, maxlen, "%s %s %s %llu", - snap->origin->name, snap->store->cow->name, - snap->store->type->name, - (unsigned long long)snap->store->chunk_size); + DMEMIT("%s", snap->origin->name); + DMEMIT(" %s %s %llu", snap->store->cow->name, + snap->store->type->name, + (unsigned long long)snap->store->chunk_size); break; } |