You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Alasdair G Kergon
parent
3510cb94ff
commit
985903bb3a
@@ -59,11 +59,14 @@ static void transient_commit_exception(struct dm_exception_store *store,
|
||||
callback(callback_context, 1);
|
||||
}
|
||||
|
||||
static void transient_fraction_full(struct dm_exception_store *store,
|
||||
sector_t *numerator, sector_t *denominator)
|
||||
static void transient_usage(struct dm_exception_store *store,
|
||||
sector_t *total_sectors,
|
||||
sector_t *sectors_allocated,
|
||||
sector_t *metadata_sectors)
|
||||
{
|
||||
*numerator = ((struct transient_c *) store->context)->next_free;
|
||||
*denominator = get_dev_size(store->cow->bdev);
|
||||
*sectors_allocated = ((struct transient_c *) store->context)->next_free;
|
||||
*total_sectors = get_dev_size(store->cow->bdev);
|
||||
*metadata_sectors = 0;
|
||||
}
|
||||
|
||||
static int transient_ctr(struct dm_exception_store *store,
|
||||
@@ -106,7 +109,7 @@ static struct dm_exception_store_type _transient_type = {
|
||||
.read_metadata = transient_read_metadata,
|
||||
.prepare_exception = transient_prepare_exception,
|
||||
.commit_exception = transient_commit_exception,
|
||||
.fraction_full = transient_fraction_full,
|
||||
.usage = transient_usage,
|
||||
.status = transient_status,
|
||||
};
|
||||
|
||||
@@ -118,7 +121,7 @@ static struct dm_exception_store_type _transient_compat_type = {
|
||||
.read_metadata = transient_read_metadata,
|
||||
.prepare_exception = transient_prepare_exception,
|
||||
.commit_exception = transient_commit_exception,
|
||||
.fraction_full = transient_fraction_full,
|
||||
.usage = transient_usage,
|
||||
.status = transient_status,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user