Re: [dm-devel] [PATCH 4/6] block: cleanup variable naming in get_max_io_size

2022-06-14 Thread Christoph Hellwig
On Tue, Jun 14, 2022 at 09:50:00AM -0700, Bart Van Assche wrote: > On 6/14/22 02:09, Christoph Hellwig wrote: >> get_max_io_size has a very odd choice of variables names and >> initialization patterns. Switch to more descriptive names and more >> clear initialization of them. > > Hmm ... what is s

[dm-devel] [PATCH] dm verity: fixed ERROR: else should follow close brace '}'

2022-06-14 Thread JeongHyeon Lee
This patch fixes the following checkpatch error, ERROR: else should follow close brace '}' Signed-off-by: JeongHyeon Lee --- drivers/md/dm-verity-target.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c inde

Re: [dm-devel] [PATCH 5/6] block: fold blk_max_size_offset into get_max_io_size

2022-06-14 Thread Bart Van Assche
On 6/14/22 02:09, Christoph Hellwig wrote: Now that blk_max_size_offset has a single caller left, fold it into that and clean up the naming convention for the local variables there. Reviewed-by: Bart Van Assche -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/li

Re: [dm-devel] [PATCH 4/6] block: cleanup variable naming in get_max_io_size

2022-06-14 Thread Bart Van Assche
On 6/14/22 02:09, Christoph Hellwig wrote: get_max_io_size has a very odd choice of variables names and initialization patterns. Switch to more descriptive names and more clear initialization of them. Hmm ... what is so odd about the variable names? I have done my best to chose clear and desc

Re: [dm-devel] [PATCH 6/6] block: move blk_queue_get_max_sectors to blk.h

2022-06-14 Thread Bart Van Assche
On 6/14/22 02:09, Christoph Hellwig wrote: blk_queue_get_max_sectors is private to the block layer, so move it out of blkdev.h. Reviewed-by: Bart Van Assche -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 3/6] block: open code blk_max_size_offset in blk_rq_get_max_sectors

2022-06-14 Thread Bart Van Assche
On 6/14/22 09:43, Bart Van Assche wrote: On 6/14/22 02:09, Christoph Hellwig wrote: blk_rq_get_max_sectors always uses q->limits.chunk_sectors as the chunk_sectors argument, and already checks for max_sectors through the call to blk_queue_get_max_sectors.  That means much of blk_max_size_offset

Re: [dm-devel] [PATCH 3/6] block: open code blk_max_size_offset in blk_rq_get_max_sectors

2022-06-14 Thread Bart Van Assche
On 6/14/22 02:09, Christoph Hellwig wrote: blk_rq_get_max_sectors always uses q->limits.chunk_sectors as the chunk_sectors argument, and already checks for max_sectors through the call to blk_queue_get_max_sectors. That means much of blk_max_size_offset is not needed and open coding it simplifie

Re: [dm-devel] [PATCH 1/6] block: factor out a chunk_size_left helper

2022-06-14 Thread Bart Van Assche
On 6/14/22 02:09, Christoph Hellwig wrote: Factor out a helper from blk_max_size_offset so that it can be reused independently. Reviewed-by: Bart Van Assche -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH] dm: fix possible race in dm_start_io_acct

2022-06-14 Thread Benjamin Marzinski
After commit 82f6cdcc3676c ("dm: switch dm_io booleans over to proper flags") dm_start_io_acct stopped atomically checking and setting was_accounted, which turned into the DM_IO_ACCOUNTED flag. This opened the possibility for a race where IO accounting is started twice for duplicate bios. To remove

[dm-devel] [PATCH 5/6] block: fold blk_max_size_offset into get_max_io_size

2022-06-14 Thread Christoph Hellwig
Now that blk_max_size_offset has a single caller left, fold it into that and clean up the naming convention for the local variables there. Signed-off-by: Christoph Hellwig --- block/blk-merge.c | 9 +++-- include/linux/blkdev.h | 19 --- 2 files changed, 7 insertions(+)

[dm-devel] [PATCH 2/6] dm: open code blk_max_size_offset in max_io_len

2022-06-14 Thread Christoph Hellwig
max_io_len always passes an explicitly non-zero chunk_sectors into blk_max_size_offset. That means much of blk_max_size_offset is not needed and can be open coded to simplify the code. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 17 ++--- 1 file changed, 6 insertions(+),

[dm-devel] [PATCH 4/6] block: cleanup variable naming in get_max_io_size

2022-06-14 Thread Christoph Hellwig
get_max_io_size has a very odd choice of variables names and initialization patterns. Switch to more descriptive names and more clear initialization of them. Signed-off-by: Christoph Hellwig --- block/blk-merge.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --

[dm-devel] [PATCH 3/6] block: open code blk_max_size_offset in blk_rq_get_max_sectors

2022-06-14 Thread Christoph Hellwig
blk_rq_get_max_sectors always uses q->limits.chunk_sectors as the chunk_sectors argument, and already checks for max_sectors through the call to blk_queue_get_max_sectors. That means much of blk_max_size_offset is not needed and open coding it simplifies the code. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 6/6] block: move blk_queue_get_max_sectors to blk.h

2022-06-14 Thread Christoph Hellwig
blk_queue_get_max_sectors is private to the block layer, so move it out of blkdev.h. Signed-off-by: Christoph Hellwig --- block/blk.h| 13 + include/linux/blkdev.h | 13 - 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/block/blk.h b/block/blk

[dm-devel] [PATCH 1/6] block: factor out a chunk_size_left helper

2022-06-14 Thread Christoph Hellwig
Factor out a helper from blk_max_size_offset so that it can be reused independently. Signed-off-by: Christoph Hellwig --- include/linux/blkdev.h | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 914c613d

[dm-devel] clean up the chunk_sizehandling helpers a little

2022-06-14 Thread Christoph Hellwig
Hi Jens, this series cleans up a bunch of block layer helpers related to the chunk size. Diffstat: block/blk-merge.c | 28 block/blk.h| 13 + drivers/md/dm.c| 17 ++--- include/linux/blkdev.h | 39 +++--