[dm-devel] [PATCH 02/30] block: add a bdev_nr_bytes helper

2021-10-18 Thread Christoph Hellwig
Add a helper to query the size of a block device in bytes. This will be used to remove open coded access to ->bd_inode. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook --- include/linux/genhd.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git

Re: [dm-devel] [PATCH 02/30] block: add a bdev_nr_bytes helper

2021-10-18 Thread Anton Altaparmakov
Hi Christoph, > On 15 Oct 2021, at 14:26, Christoph Hellwig wrote: > > Add a helpe to query the size of a block device in bytes. This > will be used to remove open coded access to ->bd_inode. Matthew already pointed out the return type for bdev_nr_bytes() but also your commit message has a

Re: [dm-devel] [PATCH 02/30] block: add a bdev_nr_bytes helper

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 02:37:41PM +, Anton Altaparmakov wrote: > Hi Christoph, > > > On 15 Oct 2021, at 14:26, Christoph Hellwig wrote: > > > > Add a helpe to query the size of a block device in bytes. This > > will be used to remove open coded access to ->bd_inode. > > Matthew already

Re: [dm-devel] [PATCH 02/30] block: add a bdev_nr_bytes helper

2021-10-15 Thread Matthew Wilcox
On Fri, Oct 15, 2021 at 03:26:15PM +0200, Christoph Hellwig wrote: > +static inline sector_t bdev_nr_bytes(struct block_device *bdev) > +{ > + return i_size_read(bdev->bd_inode); Uh. loff_t, surely? -- dm-devel mailing list dm-devel@redhat.com

[dm-devel] [PATCH 02/30] block: add a bdev_nr_bytes helper

2021-10-15 Thread Christoph Hellwig
Add a helpe to query the size of a block device in bytes. This will be used to remove open coded access to ->bd_inode. Signed-off-by: Christoph Hellwig --- include/linux/genhd.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/genhd.h

Re: [dm-devel] [PATCH 02/30] block: add a bdev_nr_bytes helper

2021-10-15 Thread Christoph Hellwig
On Fri, Oct 15, 2021 at 02:35:15PM +0100, Matthew Wilcox wrote: > On Fri, Oct 15, 2021 at 03:26:15PM +0200, Christoph Hellwig wrote: > > +static inline sector_t bdev_nr_bytes(struct block_device *bdev) > > +{ > > + return i_size_read(bdev->bd_inode); > > Uh. loff_t, surely? Yes, that wuld be