diff options
author | Mike Snitzer <snitzer@redhat.com> | 2012-03-28 13:41:28 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-03-28 13:41:28 -0400 |
commit | c4a69ecdb463a901b4645230613961e134e897cd (patch) | |
tree | c53e0a569f3d390ea2a97f964225d5383c6401ec /drivers/md/dm-thin-metadata.h | |
parent | 71fd5ae25d88841c08d5bbea90c0f0a12ca05509 (diff) |
dm thin: relax hard limit on the maximum size of a metadata device
The thin metadata format can only make use of a device that is <=
THIN_METADATA_MAX_SECTORS (currently 15.9375 GB). Therefore, there is no
practical benefit to using a larger device.
However, it may be that other factors impose a certain granularity for
the space that is allocated to a device (E.g. lvm2 can impose a coarse
granularity through the use of large, >= 1 GB, physical extents).
Rather than reject a larger metadata device, during thin-pool device
construction, switch to allowing it but issue a warning if a device
larger than THIN_METADATA_MAX_SECTORS_WARNING (16 GB) is
provided. Any space over 15.9375 GB will not be used.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-thin-metadata.h')
-rw-r--r-- | drivers/md/dm-thin-metadata.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/md/dm-thin-metadata.h b/drivers/md/dm-thin-metadata.h index 859c16896877..ed4725e67c96 100644 --- a/drivers/md/dm-thin-metadata.h +++ b/drivers/md/dm-thin-metadata.h | |||
@@ -11,6 +11,19 @@ | |||
11 | 11 | ||
12 | #define THIN_METADATA_BLOCK_SIZE 4096 | 12 | #define THIN_METADATA_BLOCK_SIZE 4096 |
13 | 13 | ||
14 | /* | ||
15 | * The metadata device is currently limited in size. | ||
16 | * | ||
17 | * We have one block of index, which can hold 255 index entries. Each | ||
18 | * index entry contains allocation info about 16k metadata blocks. | ||
19 | */ | ||
20 | #define THIN_METADATA_MAX_SECTORS (255 * (1 << 14) * (THIN_METADATA_BLOCK_SIZE / (1 << SECTOR_SHIFT))) | ||
21 | |||
22 | /* | ||
23 | * A metadata device larger than 16GB triggers a warning. | ||
24 | */ | ||
25 | #define THIN_METADATA_MAX_SECTORS_WARNING (16 * (1024 * 1024 * 1024 >> SECTOR_SHIFT)) | ||
26 | |||
14 | /*----------------------------------------------------------------*/ | 27 | /*----------------------------------------------------------------*/ |
15 | 28 | ||
16 | struct dm_pool_metadata; | 29 | struct dm_pool_metadata; |