[PATCH 8/9] bcache: use the default discard granularity

2023-12-27 Thread Christoph Hellwig
The discard granularity now defaults to a single sector, so don't set that value explicitly. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/super.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index ecc1447f202a42..39ec95b8613f1

[PATCH 9/9] mtd_blkdevs: use the default discard granularity

2023-12-27 Thread Christoph Hellwig
The discard granularity now defaults to a single sector, so don't set that value explicitly. Signed-off-by: Christoph Hellwig --- drivers/mtd/mtd_blkdevs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index ff18636e0

[PATCH 7/9] zram: use the default discard granularity

2023-12-27 Thread Christoph Hellwig
The discard granularity now defaults to a single sector, so don't set that value explicitly. Signed-off-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index d77d3664ca0805..e

[PATCH 6/9] null_blk: use the default discard granularity

2023-12-27 Thread Christoph Hellwig
The discard granularity now defaults to a single sector, so don't set that value explicitly. Signed-off-by: Christoph Hellwig --- drivers/block/null_blk/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 13ed446b5e198e..9

[PATCH 4/9] ubd: use the default discard granularity

2023-12-27 Thread Christoph Hellwig
The discard granularity now defaults to a single sector, so don't set that value explicitly. Signed-off-by: Christoph Hellwig --- arch/um/drivers/ubd_kern.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 50206feac577d5..92ee2697ff

[PATCH 5/9] nbd: use the default discard granularity

2023-12-27 Thread Christoph Hellwig
The discard granularity now defaults to a single sector, so don't set that value explicitly. Also don't bother clearing it as a discard granularity without discard_sectors doesn't mean anything. Signed-off-by: Christoph Hellwig --- drivers/block/nbd.c | 6 +- 1 file changed, 1 insertion(+),

[PATCH 2/9] bcache: discard_granularity should not be smaller than a sector

2023-12-27 Thread Christoph Hellwig
Just like all block I/O, discards are in units of sectors. Thus setting a smaller than sector size discard limit in case of > 512 byte sectors in bcache doesn't make sense. Always set the discard granularity to 512 bytes instead. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/super.c |

[PATCH 3/9] block: default the discard granularity to sector size

2023-12-27 Thread Christoph Hellwig
Current the discard granularity defaults to 0 and must be initialized by any driver that wants to support discard. Default to the sector size instead, which is the smallest possible value, and a very useful default. Signed-off-by: Christoph Hellwig --- block/blk-settings.c | 5 - 1 file cha

[PATCH 1/9] block: remove two comments in bio_split_discard

2023-12-27 Thread Christoph Hellwig
A zero discard_granularity is not treated the same as a single-block one, and not having any segments after taking alignment is perfectly fine and does not need a warning. Signed-off-by: Christoph Hellwig --- block/blk-merge.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --gi

provide a sane discard_granularity default

2023-12-27 Thread Christoph Hellwig
Hi Jens, this series defaults the discard_granularity to the sector size as that is a very logical default for devices that have no further restrictions. This removes the need for trivial drivers to set a discard granularity and cleans up the interface. Diffstat: arch/um/drivers/ubd_kern.c|