Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140172
b: refs/heads/master
c: 2e4a31d
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Brassow authored and Alasdair G Kergon committed Apr 2, 2009
1 parent 17f160c commit 7fbe88a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ccc45ea8aeffec49fa5985efc3649aa67bb4fcb7
refs/heads/master: 2e4a31df2b10cbcaf43c333112f6f7440a035c69
19 changes: 10 additions & 9 deletions trunk/drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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

Expand Down

0 comments on commit 7fbe88a

Please sign in to comment.