Commit e1ce5515 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

lib/blob: require SPDK_EXTENTS_PER_EP to be power of 2



Force number of Extents to fit into Extent Page to
be power of 2, in order to simplify calculations
on cluster allocations.

At this time SPDK_BS_PAGE_SIZE is 4k, which would
results in SPDK_EXTENTS_PER_EP to be 512.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I7e09d92b00dfe5c12d7dd10ac0fc5a9a10d526ac
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472041


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
parent f4e58993
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -385,9 +385,10 @@ SPDK_STATIC_ASSERT(SPDK_BS_PAGE_SIZE == sizeof(struct spdk_blob_md_page), "Inval

#define SPDK_BS_MAX_DESC_SIZE sizeof(((struct spdk_blob_md_page*)0)->descriptors)

/* TODO: Set to low amount for purpose of testing */
/* Maximum number of LBA's a single Extent Page can fit */
#define SPDK_EXTENTS_PER_EP 100
/* Maximum number of extents a single Extent Page can fit.
 * For an SPDK_BS_PAGE_SIZE of 4K SPDK_EXTENTS_PER_EP would be 512. */
#define SPDK_EXTENTS_PER_EP_MAX ((SPDK_BS_MAX_DESC_SIZE - sizeof(struct spdk_blob_md_descriptor_extent_page)) / sizeof(uint32_t))
#define SPDK_EXTENTS_PER_EP (spdk_align64pow2(SPDK_EXTENTS_PER_EP_MAX + 1) >> 1u)

#define SPDK_BS_SUPER_BLOCK_SIG "SPDKBLOB"