These don't change, no need to declare them all over the place.
Signed-off-by: Sage Weil <sage@redhat.com>
if (r < 0)
goto fail_close;
}
+
+ // initialize global block parameters
+ block_size = bdev->get_block_size();
+ block_mask = ~(block_size - 1);
+ block_size_order = 0;
+ for (uint64_t t = 1; t < block_size; ++t) {
+ ++block_size_order;
+ }
return 0;
fail_close:
int BlueStore::statfs(struct statfs *buf)
{
memset(buf, 0, sizeof(*buf));
- uint64_t block_size = bdev->get_block_size();
uint64_t bluefs_len = 0;
for (interval_set<uint64_t>::iterator p = bluefs_extents.begin();
p != bluefs_extents.end(); p++)
Checksummer *checksummer;
int csum_type;
+ uint64_t block_size; ///< block size of block device (power of 2)
+ uint64_t block_mask; ///< mask to get just the block offset
+ size_t block_size_order; ///< bits to shift to get block size
+
// --------------------------------------------------------
// private methods