[LTP] [PATCH] syscalls/ioctl_loop05: Get the logic_block_size dynamically
Yang Xu
xuyang2018.jy@cn.fujitsu.com
Wed Jun 10 03:19:26 CEST 2020
Hi Jan
>
>
> ----- Original Message -----
>>>>> Would BLKSSZGET work? It returns bdev_logical_block_size().
>>>>
>>>> But it needs a blockdev, in user space, we can specify bdev, but how can
>>>> we
>>>> figure out this inode->i_sb->s_bdev block dev.
>>>
>>> Isn't that the block device "test.img" is on?
>> Do you mean the test.img belong to some block dev, such as /dev/sda1 or
>> our mounted block_dev? If so, I think it is.
>
> The former. Say if test.img is in /tmp, then I'd assume "s_bdev" is
> /dev/mapper/rhel-root (/dev/dm-0)
>
> $ df -T /tmp/test.img
> Filesystem Type 1K-blocks Used Available Use% Mounted on
> /dev/mapper/rhel-root xfs 66789516 33211340 33578176 50% /
I try this, it is ok on my machine. I will send a v2 patch by using
BLKSSZGET.
>
>
>
More information about the ltp
mailing list