summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2009-12-10 23:52:11 +0000
committerAlasdair G Kergon <agk@redhat.com>2009-12-10 23:52:11 +0000
commit985903bb3a6d98623360ab6c855417f638840029 (patch)
tree64e7582e0b7827aa318c4fe1c497ebc541d9ce8b /drivers/md/dm-snap.c
parent3510cb94ff7b04b016bd22bfee913e2c1c05c066 (diff)
downloadlinux-985903bb3a6d98623360ab6c855417f638840029.tar.bz2
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 cb4c2c3a43f0..8bd77cbd7e45 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,
if (!snap->valid)
DMEMIT("Invalid");
else {
- if (snap->store->type->fraction_full) {
- sector_t numerator, denominator;
- snap->store->type->fraction_full(snap->store,
- &numerator,
- &denominator);
- DMEMIT("%llu/%llu",
- (unsigned long long)numerator,
- (unsigned long long)denominator);
+ if (snap->store->type->usage) {
+ sector_t total_sectors, sectors_allocated,
+ metadata_sectors;
+ snap->store->type->usage(snap->store,
+ &total_sectors,
+ &sectors_allocated,
+ &metadata_sectors);
+ DMEMIT("%llu/%llu %llu",
+ (unsigned long long)sectors_allocated,
+ (unsigned long long)total_sectors,
+ (unsigned long long)metadata_sectors);
}
else
DMEMIT("Unknown");
@@ -1462,7 +1465,7 @@ static struct target_type origin_target = {
static struct target_type snapshot_target = {
.name = "snapshot",
- .version = {1, 7, 0},
+ .version = {1, 8, 0},
.module = THIS_MODULE,
.ctr = snapshot_ctr,
.dtr = snapshot_dtr,