aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2009-12-10 18:52:11 -0500
committerAlasdair G Kergon <agk@redhat.com>2009-12-10 18:52:11 -0500
commit985903bb3a6d98623360ab6c855417f638840029 (patch)
tree64e7582e0b7827aa318c4fe1c497ebc541d9ce8b /drivers/md/dm-snap.c
parent3510cb94ff7b04b016bd22bfee913e2c1c05c066 (diff)
dm snapshot: add allocated metadata to snapshot status
Add number of sectors used by metadata to the end of the snapshot's status line. Renamed dm_exception_store_type's 'fraction_full' to 'usage'. Renamed arguments to be clearer about what is being returned. Also added 'metadata_sectors'. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r--drivers/md/dm-snap.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index cb4c2c3a43f..8bd77cbd7e4 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1174,14 +1174,17 @@ static int snapshot_status(struct dm_target *ti, status_type_t type,
1174 if (!snap->valid) 1174 if (!snap->valid)
1175 DMEMIT("Invalid"); 1175 DMEMIT("Invalid");
1176 else { 1176 else {
1177 if (snap->store->type->fraction_full) { 1177 if (snap->store->type->usage) {
1178 sector_t numerator, denominator; 1178 sector_t total_sectors, sectors_allocated,
1179 snap->store->type->fraction_full(snap->store, 1179 metadata_sectors;
1180 &numerator, 1180 snap->store->type->usage(snap->store,
1181 &denominator); 1181 &total_sectors,
1182 DMEMIT("%llu/%llu", 1182 &sectors_allocated,
1183 (unsigned long long)numerator, 1183 &metadata_sectors);
1184 (unsigned long long)denominator); 1184 DMEMIT("%llu/%llu %llu",
1185 (unsigned long long)sectors_allocated,
1186 (unsigned long long)total_sectors,
1187 (unsigned long long)metadata_sectors);
1185 } 1188 }
1186 else 1189 else
1187 DMEMIT("Unknown"); 1190 DMEMIT("Unknown");
@@ -1462,7 +1465,7 @@ static struct target_type origin_target = {
1462 1465
1463static struct target_type snapshot_target = { 1466static struct target_type snapshot_target = {
1464 .name = "snapshot", 1467 .name = "snapshot",
1465 .version = {1, 7, 0}, 1468 .version = {1, 8, 0},
1466 .module = THIS_MODULE, 1469 .module = THIS_MODULE,
1467 .ctr = snapshot_ctr, 1470 .ctr = snapshot_ctr,
1468 .dtr = snapshot_dtr, 1471 .dtr = snapshot_dtr,