mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Update vdev_is_spacemap_addressable() for new spacemap encoding
Since the new spacemap encoding was ported to ZoL that's no longer a limitation. This patch updates vdev_is_spacemap_addressable() that was performing that check. It also updates the appropriate test to ensure that the same functionality is tested. The test does so by creating pools that don't have the new spacemap encoding enabled - just the checkpoint feature. This patch also reorganizes that same tests in order to cut in half its memory consumption. Reviewed by: Matt Ahrens <mahrens@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com> Closes #8286
This commit is contained in:
committed by
Brian Behlendorf
parent
64bdf63f5c
commit
419ba59145
+9
-5
@@ -3804,13 +3804,17 @@ vdev_get_child_stat_ex(vdev_t *cvd, vdev_stat_ex_t *vsx, vdev_stat_ex_t *cvsx)
|
||||
boolean_t
|
||||
vdev_is_spacemap_addressable(vdev_t *vd)
|
||||
{
|
||||
if (spa_feature_is_active(vd->vdev_spa, SPA_FEATURE_SPACEMAP_V2))
|
||||
return (B_TRUE);
|
||||
|
||||
/*
|
||||
* Assuming 47 bits of the space map entry dedicated for the entry's
|
||||
* offset (see description in space_map.h), we calculate the maximum
|
||||
* address that can be described by a space map entry for the given
|
||||
* device.
|
||||
* If double-word space map entries are not enabled we assume
|
||||
* 47 bits of the space map entry are dedicated to the entry's
|
||||
* offset (see SM_OFFSET_BITS in space_map.h). We then use that
|
||||
* to calculate the maximum address that can be described by a
|
||||
* space map entry for the given device.
|
||||
*/
|
||||
uint64_t shift = vd->vdev_ashift + 47;
|
||||
uint64_t shift = vd->vdev_ashift + SM_OFFSET_BITS;
|
||||
|
||||
if (shift >= 63) /* detect potential overflow */
|
||||
return (B_TRUE);
|
||||
|
||||
Reference in New Issue
Block a user