1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

improve get_fs_block_size string to number

This commit is contained in:
David Teigland 2020-06-11 15:05:47 -05:00
parent 9f38e95a2f
commit 8e2938c963

View File

@ -650,11 +650,9 @@ out:
int get_fs_block_size(struct device *dev, uint32_t *fs_block_size)
{
char *block_size_str = NULL;
uint64_t block_size_val;
if ((block_size_str = blkid_get_tag_value(NULL, "BLOCK_SIZE", dev_name(dev)))) {
block_size_val = strtoull(block_size_str, NULL, 10);
*fs_block_size = (uint32_t)block_size_val;
*fs_block_size = (uint32_t)atoi(block_size_str);
free(block_size_str);
log_debug("Found blkid BLOCK_SIZE %u for fs on %s", *fs_block_size, dev_name(dev));
return 1;