Linux block layer
 help / color / mirror / Atom feed
* [PATCH v4] block: get wp_offset by bdev_offset_from_zone_start
@ 2024-11-07  2:04 LongPing Wei
  2024-11-07 17:44 ` Bart Van Assche
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: LongPing Wei @ 2024-11-07  2:04 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, bvanassche, dlemoal, LongPing Wei

Call bdev_offset_from_zone_start() instead of open-coding it.

Fixes: dd291d77cc90 ("block: Introduce zone write plugging")
Signed-off-by: LongPing Wei <weilongping@oppo.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
---
v4: update commit message
---
 block/blk-zoned.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index af19296fa50d..77a448952bbd 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -537,7 +537,7 @@ static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk,
 	spin_lock_init(&zwplug->lock);
 	zwplug->flags = 0;
 	zwplug->zone_no = zno;
-	zwplug->wp_offset = sector & (disk->queue->limits.chunk_sectors - 1);
+	zwplug->wp_offset = bdev_offset_from_zone_start(disk->part0, sector);
 	bio_list_init(&zwplug->bio_list);
 	INIT_WORK(&zwplug->bio_work, blk_zone_wplug_bio_work);
 	zwplug->disk = disk;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v4] block: get wp_offset by bdev_offset_from_zone_start
  2024-11-07  2:04 [PATCH v4] block: get wp_offset by bdev_offset_from_zone_start LongPing Wei
@ 2024-11-07 17:44 ` Bart Van Assche
  2024-12-10 20:23 ` Bart Van Assche
  2024-12-10 20:24 ` Jens Axboe
  2 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2024-11-07 17:44 UTC (permalink / raw)
  To: LongPing Wei, axboe; +Cc: linux-block, dlemoal

On 11/6/24 6:04 PM, LongPing Wei wrote:
> Call bdev_offset_from_zone_start() instead of open-coding it.
> 
> Fixes: dd291d77cc90 ("block: Introduce zone write plugging")

This is not a bug fix so the "Fixes:" tag probably should be left out.
Anyway:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4] block: get wp_offset by bdev_offset_from_zone_start
  2024-11-07  2:04 [PATCH v4] block: get wp_offset by bdev_offset_from_zone_start LongPing Wei
  2024-11-07 17:44 ` Bart Van Assche
@ 2024-12-10 20:23 ` Bart Van Assche
  2024-12-10 20:25   ` Jens Axboe
  2024-12-10 20:24 ` Jens Axboe
  2 siblings, 1 reply; 5+ messages in thread
From: Bart Van Assche @ 2024-12-10 20:23 UTC (permalink / raw)
  To: LongPing Wei, axboe; +Cc: linux-block, bvanassche, dlemoal

On 11/6/24 6:04 PM, LongPing Wei wrote:
> Call bdev_offset_from_zone_start() instead of open-coding it.
> 
> Fixes: dd291d77cc90 ("block: Introduce zone write plugging")
> Signed-off-by: LongPing Wei <weilongping@oppo.com>
> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
> ---
> v4: update commit message
> ---
>   block/blk-zoned.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/blk-zoned.c b/block/blk-zoned.c
> index af19296fa50d..77a448952bbd 100644
> --- a/block/blk-zoned.c
> +++ b/block/blk-zoned.c
> @@ -537,7 +537,7 @@ static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk,
>   	spin_lock_init(&zwplug->lock);
>   	zwplug->flags = 0;
>   	zwplug->zone_no = zno;
> -	zwplug->wp_offset = sector & (disk->queue->limits.chunk_sectors - 1);
> +	zwplug->wp_offset = bdev_offset_from_zone_start(disk->part0, sector);
>   	bio_list_init(&zwplug->bio_list);
>   	INIT_WORK(&zwplug->bio_work, blk_zone_wplug_bio_work);
>   	zwplug->disk = disk;

Hi LongPing Wei,

Since this patch has not yet been merged, how about reposting it?

Thanks,

Bart.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4] block: get wp_offset by bdev_offset_from_zone_start
  2024-11-07  2:04 [PATCH v4] block: get wp_offset by bdev_offset_from_zone_start LongPing Wei
  2024-11-07 17:44 ` Bart Van Assche
  2024-12-10 20:23 ` Bart Van Assche
@ 2024-12-10 20:24 ` Jens Axboe
  2 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2024-12-10 20:24 UTC (permalink / raw)
  To: LongPing Wei; +Cc: linux-block, bvanassche, dlemoal


On Thu, 07 Nov 2024 10:04:41 +0800, LongPing Wei wrote:
> Call bdev_offset_from_zone_start() instead of open-coding it.
> 
> 

Applied, thanks!

[1/1] block: get wp_offset by bdev_offset_from_zone_start
      commit: 790eb09e59709a1ffc1c64fe4aae2789120851b0

Best regards,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4] block: get wp_offset by bdev_offset_from_zone_start
  2024-12-10 20:23 ` Bart Van Assche
@ 2024-12-10 20:25   ` Jens Axboe
  0 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2024-12-10 20:25 UTC (permalink / raw)
  To: Bart Van Assche, LongPing Wei; +Cc: linux-block, bvanassche, dlemoal

On 12/10/24 1:23 PM, Bart Van Assche wrote:
> On 11/6/24 6:04 PM, LongPing Wei wrote:
>> Call bdev_offset_from_zone_start() instead of open-coding it.
>>
>> Fixes: dd291d77cc90 ("block: Introduce zone write plugging")
>> Signed-off-by: LongPing Wei <weilongping@oppo.com>
>> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
>> ---
>> v4: update commit message
>> ---
>>   block/blk-zoned.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/block/blk-zoned.c b/block/blk-zoned.c
>> index af19296fa50d..77a448952bbd 100644
>> --- a/block/blk-zoned.c
>> +++ b/block/blk-zoned.c
>> @@ -537,7 +537,7 @@ static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk,
>>       spin_lock_init(&zwplug->lock);
>>       zwplug->flags = 0;
>>       zwplug->zone_no = zno;
>> -    zwplug->wp_offset = sector & (disk->queue->limits.chunk_sectors - 1);
>> +    zwplug->wp_offset = bdev_offset_from_zone_start(disk->part0, sector);
>>       bio_list_init(&zwplug->bio_list);
>>       INIT_WORK(&zwplug->bio_work, blk_zone_wplug_bio_work);
>>       zwplug->disk = disk;
> 
> Hi LongPing Wei,
> 
> Since this patch has not yet been merged, how about reposting it?

No need, bubbled to the top and I got it applied.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-10 20:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07  2:04 [PATCH v4] block: get wp_offset by bdev_offset_from_zone_start LongPing Wei
2024-11-07 17:44 ` Bart Van Assche
2024-12-10 20:23 ` Bart Van Assche
2024-12-10 20:25   ` Jens Axboe
2024-12-10 20:24 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox