* [PATCH] block: add a loff_t cast to bdev_nr_bytes
@ 2021-11-04 17:20 Christoph Hellwig
2021-11-04 17:28 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2021-11-04 17:20 UTC (permalink / raw)
To: axboe; +Cc: linux-block
Not really needed as both loff_t and sector_t are always 64-bits wide,
but this documents the different types a bit better.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
include/linux/genhd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 59eabbc3a36b7..462634b4b48fb 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -250,7 +250,7 @@ static inline sector_t bdev_nr_sectors(struct block_device *bdev)
static inline loff_t bdev_nr_bytes(struct block_device *bdev)
{
- return bdev_nr_sectors(bdev) << SECTOR_SHIFT;
+ return (loff_t)bdev_nr_sectors(bdev) << SECTOR_SHIFT;
}
static inline sector_t get_capacity(struct gendisk *disk)
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] block: add a loff_t cast to bdev_nr_bytes
2021-11-04 17:20 [PATCH] block: add a loff_t cast to bdev_nr_bytes Christoph Hellwig
@ 2021-11-04 17:28 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-11-04 17:28 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-block
On Thu, 4 Nov 2021 18:20:37 +0100, Christoph Hellwig wrote:
> Not really needed as both loff_t and sector_t are always 64-bits wide,
> but this documents the different types a bit better.
>
>
Applied, thanks!
[1/1] block: add a loff_t cast to bdev_nr_bytes
commit: 2116274af46b12df7cea1dc5698f3cf2f231f8a9
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-04 17:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-04 17:20 [PATCH] block: add a loff_t cast to bdev_nr_bytes Christoph Hellwig
2021-11-04 17:28 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox