aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap-transient.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-transient.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-transient.c')
-rw-r--r--drivers/md/dm-snap-transient.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/md/dm-snap-transient.c b/drivers/md/dm-snap-transient.c
index 267801b34ff6..245a50c7337e 100644
--- a/drivers/md/dm-snap-transient.c
+++ b/drivers/md/dm-snap-transient.c
@@ -59,11 +59,14 @@ static void transient_commit_exception(struct dm_exception_store *store,
59 callback(callback_context, 1); 59 callback(callback_context, 1);
60} 60}
61 61
62static void transient_fraction_full(struct dm_exception_store *store, 62static void transient_usage(struct dm_exception_store *store,
63 sector_t *numerator, sector_t *denominator) 63 sector_t *total_sectors,
64 sector_t *sectors_allocated,
65 sector_t *metadata_sectors)
64{ 66{
65 *numerator = ((struct transient_c *) store->context)->next_free; 67 *sectors_allocated = ((struct transient_c *) store->context)->next_free;
66 *denominator = get_dev_size(store->cow->bdev); 68 *total_sectors = get_dev_size(store->cow->bdev);
69 *metadata_sectors = 0;
67} 70}
68 71
69static int transient_ctr(struct dm_exception_store *store, 72static int transient_ctr(struct dm_exception_store *store,
@@ -106,7 +109,7 @@ static struct dm_exception_store_type _transient_type = {
106 .read_metadata = transient_read_metadata, 109 .read_metadata = transient_read_metadata,
107 .prepare_exception = transient_prepare_exception, 110 .prepare_exception = transient_prepare_exception,
108 .commit_exception = transient_commit_exception, 111 .commit_exception = transient_commit_exception,
109 .fraction_full = transient_fraction_full, 112 .usage = transient_usage,
110 .status = transient_status, 113 .status = transient_status,
111}; 114};
112 115
@@ -118,7 +121,7 @@ static struct dm_exception_store_type _transient_compat_type = {
118 .read_metadata = transient_read_metadata, 121 .read_metadata = transient_read_metadata,
119 .prepare_exception = transient_prepare_exception, 122 .prepare_exception = transient_prepare_exception,
120 .commit_exception = transient_commit_exception, 123 .commit_exception = transient_commit_exception,
121 .fraction_full = transient_fraction_full, 124 .usage = transient_usage,
122 .status = transient_status, 125 .status = transient_status,
123}; 126};
124 127