* [PATCH] block: return unsigned int from bdev_io_min
@ 2024-11-19 7:26 Christoph Hellwig
2024-11-19 11:23 ` Martin K. Petersen
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Christoph Hellwig @ 2024-11-19 7:26 UTC (permalink / raw)
To: axboe; +Cc: linux-block
The underlying limit is defined as an unsigned int, so return that from
bdev_io_min as well.
Fixes: ac481c20ef8f ("block: Topology ioctls")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
include/linux/blkdev.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 00212e96261a..4825469c2fa1 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1261,7 +1261,7 @@ static inline unsigned int queue_io_min(const struct request_queue *q)
return q->limits.io_min;
}
-static inline int bdev_io_min(struct block_device *bdev)
+static inline unsigned int bdev_io_min(struct block_device *bdev)
{
return queue_io_min(bdev_get_queue(bdev));
}
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] block: return unsigned int from bdev_io_min
2024-11-19 7:26 [PATCH] block: return unsigned int from bdev_io_min Christoph Hellwig
@ 2024-11-19 11:23 ` Martin K. Petersen
2024-11-19 12:52 ` John Garry
2024-11-19 14:20 ` Jens Axboe
2 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2024-11-19 11:23 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: axboe, linux-block
Christoph,
> The underlying limit is defined as an unsigned int, so return that
> from bdev_io_min as well.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] block: return unsigned int from bdev_io_min
2024-11-19 7:26 [PATCH] block: return unsigned int from bdev_io_min Christoph Hellwig
2024-11-19 11:23 ` Martin K. Petersen
@ 2024-11-19 12:52 ` John Garry
2024-11-19 12:54 ` Christoph Hellwig
2024-11-19 14:20 ` Jens Axboe
2 siblings, 1 reply; 5+ messages in thread
From: John Garry @ 2024-11-19 12:52 UTC (permalink / raw)
To: Christoph Hellwig, axboe; +Cc: linux-block
On 19/11/2024 07:26, Christoph Hellwig wrote:
> The underlying limit is defined as an unsigned int, so return that from
> bdev_io_min as well.
>
There seem to be other helpers with the same condition.
Even bdev_io_opt() is defined as returning an int, but actually returns
an unsigned int. And even though not a bdev helper,
queue_dma_alignment() is similar.
> Fixes: ac481c20ef8f ("block: Topology ioctls")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Garry <john.g.garry@oracle.com>
> ---
> include/linux/blkdev.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 00212e96261a..4825469c2fa1 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1261,7 +1261,7 @@ static inline unsigned int queue_io_min(const struct request_queue *q)
> return q->limits.io_min;
> }
>
> -static inline int bdev_io_min(struct block_device *bdev)
> +static inline unsigned int bdev_io_min(struct block_device *bdev)
> {
> return queue_io_min(bdev_get_queue(bdev));
> }
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] block: return unsigned int from bdev_io_min
2024-11-19 12:52 ` John Garry
@ 2024-11-19 12:54 ` Christoph Hellwig
0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2024-11-19 12:54 UTC (permalink / raw)
To: John Garry; +Cc: Christoph Hellwig, axboe, linux-block
On Tue, Nov 19, 2024 at 12:52:40PM +0000, John Garry wrote:
> On 19/11/2024 07:26, Christoph Hellwig wrote:
>> The underlying limit is defined as an unsigned int, so return that from
>> bdev_io_min as well.
>>
>
> There seem to be other helpers with the same condition.
>
> Even bdev_io_opt() is defined as returning an int, but actually returns an
> unsigned int. And even though not a bdev helper, queue_dma_alignment() is
> similar.
True. I'll cook up patches - I just noticed this one because of a
series that added casts to the return value which made me look there.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] block: return unsigned int from bdev_io_min
2024-11-19 7:26 [PATCH] block: return unsigned int from bdev_io_min Christoph Hellwig
2024-11-19 11:23 ` Martin K. Petersen
2024-11-19 12:52 ` John Garry
@ 2024-11-19 14:20 ` Jens Axboe
2 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2024-11-19 14:20 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-block
On Tue, 19 Nov 2024 08:26:02 +0100, Christoph Hellwig wrote:
> The underlying limit is defined as an unsigned int, so return that from
> bdev_io_min as well.
>
>
Applied, thanks!
[1/1] block: return unsigned int from bdev_io_min
commit: 46fd48ab3ea3eb3bb215684bd66ea3d260b091a9
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-11-19 14:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19 7:26 [PATCH] block: return unsigned int from bdev_io_min Christoph Hellwig
2024-11-19 11:23 ` Martin K. Petersen
2024-11-19 12:52 ` John Garry
2024-11-19 12:54 ` Christoph Hellwig
2024-11-19 14:20 ` Jens Axboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.