diff mbox series

[01/13] block: add bdev_max_segments() helper

Message ID a3eed5d77f1cd3c7768780356f1528f9ce6e540a.1656909695.git.naohiro.aota@wdc.com (mailing list archive)
State New, archived
Headers show
Series btrfs: zoned: fix active zone tracking issues | expand

Commit Message

Naohiro Aota July 4, 2022, 4:58 a.m. UTC
Add bdev_max_segments() like other queue parameters.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 include/linux/blkdev.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Johannes Thumshirn July 4, 2022, 6:57 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Christoph Hellwig July 4, 2022, 8:23 a.m. UTC | #2
Please Cc the block list.

On Mon, Jul 04, 2022 at 01:58:05PM +0900, Naohiro Aota wrote:
> Add bdev_max_segments() like other queue parameters.
> 
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> ---
>  include/linux/blkdev.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 2f7b43444c5f..62e3ff52ab03 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1206,6 +1206,11 @@ bdev_max_zone_append_sectors(struct block_device *bdev)
>  	return queue_max_zone_append_sectors(bdev_get_queue(bdev));
>  }
>  
> +static inline unsigned int bdev_max_segments(struct block_device *bdev)
> +{
> +	return queue_max_segments(bdev_get_queue(bdev));
> +}
> +
>  static inline unsigned queue_logical_block_size(const struct request_queue *q)
>  {
>  	int retval = 512;
> -- 
> 2.35.1
> 
---end quoted text---
Naohiro Aota July 4, 2022, 1:27 p.m. UTC | #3
On Mon, Jul 04, 2022 at 01:23:44AM -0700, Christoph Hellwig wrote:
> Please Cc the block list.

Oops, I completely forgot about it. I will do so from the next version.

> On Mon, Jul 04, 2022 at 01:58:05PM +0900, Naohiro Aota wrote:
> > Add bdev_max_segments() like other queue parameters.
> > 
> > Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> > ---
> >  include/linux/blkdev.h | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> > index 2f7b43444c5f..62e3ff52ab03 100644
> > --- a/include/linux/blkdev.h
> > +++ b/include/linux/blkdev.h
> > @@ -1206,6 +1206,11 @@ bdev_max_zone_append_sectors(struct block_device *bdev)
> >  	return queue_max_zone_append_sectors(bdev_get_queue(bdev));
> >  }
> >  
> > +static inline unsigned int bdev_max_segments(struct block_device *bdev)
> > +{
> > +	return queue_max_segments(bdev_get_queue(bdev));
> > +}
> > +
> >  static inline unsigned queue_logical_block_size(const struct request_queue *q)
> >  {
> >  	int retval = 512;
> > -- 
> > 2.35.1
> > 
> ---end quoted text---
diff mbox series

Patch

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2f7b43444c5f..62e3ff52ab03 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1206,6 +1206,11 @@  bdev_max_zone_append_sectors(struct block_device *bdev)
 	return queue_max_zone_append_sectors(bdev_get_queue(bdev));
 }
 
+static inline unsigned int bdev_max_segments(struct block_device *bdev)
+{
+	return queue_max_segments(bdev_get_queue(bdev));
+}
+
 static inline unsigned queue_logical_block_size(const struct request_queue *q)
 {
 	int retval = 512;