[LTP] [PATCH] syscalls/ioctl_loop05: Get the logic_block_size dynamically
Jan Stancek
jstancek@redhat.com
Tue Jun 9 12:16:42 CEST 2020
----- Original Message -----
> Hi Jan
>
> >
> > ----- Original Message -----
> >> In loop driver code, the sb_bsize was calculated as below
> >> sb_bsize = bdev_logical_block_size(inode->i_sb->s_bdev),
> >>
> >> it is the super block's block size that the backing file's inode belongs
> >> to,
> >> not by using the st_blksize member of stat struct(it uses
> >> inode->i_blkbits).
> > I'm not sure I follow the above, are you saying the difference is bdev
> > blksize
> > vs. filesystem blksize?
>
> I said the loop driver used dev_logical_block_size(inode->i_sb->s_bdev) but
> not using
> st_blksize.
I know, but I'm trying to understand what the difference is between those two.
> > 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?
More information about the ltp
mailing list