[dm-devel] [PATCH 39/45] block: remove the partno field from struct hd_struct

2020-11-24 Thread Christoph Hellwig
Just use the bd_partno field in struct block_device everywhere. Signed-off-by: Christoph Hellwig --- block/genhd.c | 12 ++-- block/partitions/core.c | 9 - include/linux/genhd.h | 1 - init/do_mounts.c| 2 +- 4 files changed, 11 insertions(+), 13

[dm-devel] [PATCH 43/45] f2fs: remove a few bd_part checks

2020-11-24 Thread Christoph Hellwig
bd_part is never NULL for a block device in use by a file system, so remove the checks. Signed-off-by: Christoph Hellwig --- fs/f2fs/checkpoint.c | 5 + fs/f2fs/sysfs.c | 9 - 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs

[dm-devel] [PATCH 30/45] block: remove the nr_sects field in struct hd_struct

2020-11-24 Thread Christoph Hellwig
gets fixed. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman --- block/bio.c| 4 +- block/blk-core.c | 2 +- block/blk.h| 53 -- block/genhd.c | 55

[dm-devel] [PATCH 25/45] block: reference struct block_device from struct hd_struct

2020-11-24 Thread Christoph Hellwig
bdget() to only find existing block devices, given that we know that the block_device structure must be allocated at probe / partition scan time. Signed-off-by: Christoph Hellwig --- block/blk.h | 2 +- block/genhd.c | 212 block

[dm-devel] [PATCH 29/45] block: initialize struct block_device in bdev_alloc

2020-11-24 Thread Christoph Hellwig
Don't play tricks with slab constructors as bdev structures tends to not get reused very much, and this makes the code a lot less error prone. Signed-off-by: Christoph Hellwig --- fs/block_dev.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/fs

[dm-devel] [PATCH 08/45] loop: do not call set_blocksize

2020-11-24 Thread Christoph Hellwig
set_blocksize is used by file systems to use their preferred buffer cache block size. Block drivers should not set it. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index

[dm-devel] [PATCH 32/45] block: move the start_sect field to struct block_device

2020-11-24 Thread Christoph Hellwig
Move the start_sect field to struct block_device in preparation of killing struct hd_struct. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 5 +++-- block/blk-lib.c | 2 +- block/genhd.c | 4 ++-- block/partitions/core.c | 17

Re: [dm-devel] split hard read-only vs read-only policy v2

2020-12-09 Thread Christoph Hellwig
Jens, can you pick this up for 5.11? -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH 34/45] block: move holder_dir to struct block_device

2020-11-28 Thread Christoph Hellwig
Move the holder_dir field to struct block_device in preparation for kill struct hd_struct. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- block/genhd.c | 5 +++-- block/partitions/core.c | 8 fs/block_dev.c| 11 +-- include/linux

[dm-devel] [PATCH 12/45] block: add a bdev_kobj helper

2020-11-28 Thread Christoph Hellwig
Add a little helper to find the kobject for a struct block_device. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Acked-by: Tejun Heo Acked-by: Coly Li [bcache] Acked-by: David

[dm-devel] [PATCH 10/45] block: remove a duplicate __disk_get_part prototype

2020-11-28 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Reviewed-by: Jan Kara Reviewed-by: Greg Kroah-Hartman Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- include/linux/genhd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/genhd.h b/include/linux/genhd.h

[dm-devel] [PATCH 30/45] block: remove the nr_sects field in struct hd_struct

2020-11-28 Thread Christoph Hellwig
gets fixed. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Acked-by: Coly Li [bcache] Acked-by: Chao Yu [f2fs] --- block/bio.c| 4 +- block/blk-core.c | 2 +- block/blk.h

[dm-devel] [PATCH 31/45] block: move disk stat accounting to struct block_device

2020-11-28 Thread Christoph Hellwig
Move the dkstats and stamp field to struct block_device in preparation of killing struct hd_struct. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- block/blk-cgroup.c| 2 +- block/blk-core.c | 4 ++-- block/blk.h | 1 - block/genhd.c

[dm-devel] [PATCH 19/45] init: cleanup match_dev_by_uuid and match_dev_by_label

2020-11-28 Thread Christoph Hellwig
Avoid a totally pointless goto label, and use the same style of comparism for both helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn Acked-by: Tejun Heo --- init/do_mounts.c | 18 ++ 1 file changed

[dm-devel] [PATCH 13/45] block: use disk_part_iter_exit in disk_part_iter_next

2020-11-28 Thread Christoph Hellwig
Call disk_part_iter_exit in disk_part_iter_next instead of duplicating the functionality. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Acked-by: Tejun Heo --- block/genhd.c | 3 +-- 1

[dm-devel] [PATCH 20/45] block: refactor __blkdev_put

2020-11-28 Thread Christoph Hellwig
Reorder the code to have one big section for the last close, and to use bdev_is_partition. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Acked-by: Tejun Heo --- fs/block_dev.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff

[dm-devel] [PATCH 04/45] fs: simplify freeze_bdev/thaw_bdev

2020-11-28 Thread Christoph Hellwig
Store the frozen superblock in struct block_device to avoid the awkward interface that can return a sb only used a cookie, an ERR_PTR or NULL. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Chao Yu [f2fs] --- drivers/md/dm-core.h | 5 - drivers/md/dm.c

[dm-devel] [PATCH 11/45] block: remove a superflous check in blkpg_do_ioctl

2020-11-28 Thread Christoph Hellwig
sector_t is now always a u64, so this check is not needed. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Hannes Reinecke Acked-by: Tejun Heo --- block/ioctl.c | 9 - 1 file changed, 9 deletions(-) diff --git a/block/ioctl.c b/block/ioctl.c index 6b785181344fe1

[dm-devel] [PATCH 05/45] mtip32xx: remove the call to fsync_bdev on removal

2020-11-28 Thread Christoph Hellwig
del_gendisk already calls fsync_bdev for every partition, no need to do this twice. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- drivers/block/mtip32xx/mtip32xx.c | 15 --- drivers/block/mtip32xx/mtip32xx.h | 2 -- 2 files changed, 17 deletions(-) diff --git

[dm-devel] merge struct block_device and struct hd_struct v4

2020-11-28 Thread Christoph Hellwig
Hi Jens, this series cleans up our main per-device node data structure by merging the block_device and hd_struct data structures that have the same scope, but different life times. The main effect (besides removing lots of code) is that instead of having two device sizes that need complex

[dm-devel] [PATCH 26/45] block: remove ->bd_contains

2020-11-28 Thread Christoph Hellwig
Now that each hd_struct has a reference to the corresponding block_device, there is no need for the bd_contains pointer. Add a bdev_whole() helper to look up the whole device block_device struture instead. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara

[dm-devel] [PATCH 28/45] block: simplify part_to_disk

2020-11-28 Thread Christoph Hellwig
Now that struct hd_struct has a block_device pointer use that to find the disk. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Tejun Heo --- include/linux/genhd.h | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/linux/genhd.h b/include

[dm-devel] [PATCH 22/45] block: move bdput() to the callers of __blkdev_get

2020-11-28 Thread Christoph Hellwig
This will allow for a more symmetric calling convention going forward. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- fs/block_dev.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 0c533ac92e2492..a2d5050c97ee08

[dm-devel] [PATCH 09/45] dm: remove the block_device reference in struct mapped_device

2020-11-28 Thread Christoph Hellwig
Get rid of the long-lasting struct block_device reference in struct mapped_device. The only remaining user is the freeze code, where we can trivially look up the block device at freeze time and release the reference at thaw time. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke

[dm-devel] [PATCH 36/45] block: move the policy field to struct block_device

2020-11-28 Thread Christoph Hellwig
Move the policy field to struct block_device and rename it to the more descriptive bd_read_only. Also turn the field into a bool as it is used as such. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- block/blk-core.c | 2 +- block/genhd.c | 8 block

[dm-devel] [PATCH 24/45] block: remove i_bdev

2020-11-28 Thread Christoph Hellwig
of struct block_device to keep the lookups contained in the core block layer code. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Tejun Heo Acked-by: Coly Li [bcache] --- block/ioctl.c| 3 +- drivers/block/loop.c

[dm-devel] [PATCH 03/45] fs: remove get_super_thawed and get_super_exclusive_thawed

2020-11-28 Thread Christoph Hellwig
Just open code the wait in the only caller of both functions. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Hannes Reinecke --- fs/internal.h | 2 ++ fs/quota/quota.c | 31 +--- fs/super.c | 51

[dm-devel] [PATCH 06/45] zram: do not call set_blocksize

2020-11-28 Thread Christoph Hellwig
set_blocksize is used by file systems to use their preferred buffer cache block size. Block drivers should not set it. Signed-off-by: Christoph Hellwig Acked-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 11 +-- drivers/block/zram/zram_drv.h | 1 - 2 files changed, 1 insertion

[dm-devel] [PATCH 14/45] block: use put_device in put_disk

2020-11-28 Thread Christoph Hellwig
Use put_device to put the device instead of poking into the internals and using kobject_put. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn Acked-by: Tejun Heo --- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1

[dm-devel] [PATCH 23/45] block: opencode devcgroup_inode_permission

2020-11-28 Thread Christoph Hellwig
Just call devcgroup_check_permission to avoid various superflous checks and a double conversion of the access flags. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Reviewed-by: Jan Kara --- fs/block_dev.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs

[dm-devel] [PATCH 27/45] block: simplify the block device claiming interface

2020-11-28 Thread Christoph Hellwig
Stop passing the whole device as a separate argument given that it can be trivially deducted and cleanup the !holder debug check. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Acked-by: Tejun Heo --- drivers/block/loop.c | 12 +- fs

[dm-devel] [PATCH 02/45] filemap: consistently use ->f_mapping over ->i_mapping

2020-11-28 Thread Christoph Hellwig
Use file->f_mapping in all remaining places that have a struct file available to properly handle the case where inode->i_mapping != file_inode(file)->i_mapping. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Hannes Reinecke Reviewed-by: Matthew Wilcox (Oracle)

[dm-devel] [PATCH 01/45] blk-cgroup: fix a hd_struct leak in blkcg_fill_root_iostats

2020-11-28 Thread Christoph Hellwig
disk_get_part needs to be paired with a disk_put_part. Fixes: ef45fe470e1 ("blk-cgroup: show global disk stats in root cgroup io.stat") Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumsh

[dm-devel] [PATCH 38/45] block: switch partition lookup to use struct block_device

2020-11-28 Thread Christoph Hellwig
Use struct block_device to lookup partitions on a disk. This removes all usage of struct hd_struct from the I/O path. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Coly Li [bcache] Acked-by: Chao Yu [f2fs] --- block/bio.c

[dm-devel] [PATCH 44/45] block: merge struct block_device and struct hd_struct

2020-11-28 Thread Christoph Hellwig
, with the device model reference front ending it for device model interaction. Signed-off-by: Christoph Hellwig --- block/blk-cgroup.c| 9 ++- block/blk.h | 2 +- block/genhd.c | 89 + block/partitions/core.c | 116

[dm-devel] [PATCH 42/45] block: switch disk_part_iter_* to use a struct block_device

2020-11-28 Thread Christoph Hellwig
Switch the partition iter infrastructure to iterate over block_device references instead of hd_struct ones mostly used to get at the block_device. Signed-off-by: Christoph Hellwig --- block/genhd.c | 59 --- block/partitions/core.c | 13

[dm-devel] [PATCH 45/45] block: stop using bdget_disk for partition 0

2020-11-28 Thread Christoph Hellwig
We can just dereference the point in struct gendisk instead. Also remove the now unused export. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- block/genhd.c | 1 - drivers/block/nbd.c | 4 +--- drivers/block/xen-blkfront.c| 20

[dm-devel] [PATCH 41/45] block: pass a block_device to invalidate_partition

2020-11-28 Thread Christoph Hellwig
Pass the block_device actually needed instead of looking it up using bdget_disk. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- block/genhd.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index 835393b7101ace

[dm-devel] [PATCH 43/45] f2fs: remove a few bd_part checks

2020-11-28 Thread Christoph Hellwig
bd_part is never NULL for a block device in use by a file system, so remove the checks. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu --- fs/f2fs/checkpoint.c | 5 + fs/f2fs/sysfs.c | 9 - 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/fs/f2fs

[dm-devel] [PATCH 33/45] block: move the partition_meta_info to struct block_device

2020-11-28 Thread Christoph Hellwig
Move the partition_meta_info to struct block_device in preparation for killing struct hd_struct. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- block/blk.h | 1 - block/genhd.c | 3 ++- block/partitions/core.c | 18 +++--- fs/block_dev.c

[dm-devel] [PATCH 35/45] block: move make_it_fail to struct block_device

2020-11-28 Thread Christoph Hellwig
Move the make_it_fail flag to struct block_device an turn it into a bool in preparation of killing struct hd_struct. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- block/blk-core.c | 3 ++- block/genhd.c | 4 ++-- include/linux/blk_types.h | 3 +++ include

[dm-devel] [PATCH 25/45] block: simplify bdev/disk lookup in blkdev_get

2020-11-28 Thread Christoph Hellwig
now cause a call to request_module. That call is harmless, and in practice no recent system will access these nodes as they aren't created by udev and static /dev/ setups are unusual. Signed-off-by: Christoph Hellwig --- block/blk-cgroup.c | 42 block/blk-iocost.c | 36

[dm-devel] [PATCH 21/45] block: refactor blkdev_get

2020-11-28 Thread Christoph Hellwig
, similar to what we do with normal file operations. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Reviewed-by: Jan Kara --- fs/block_dev.c | 185 +++-- 1 file changed, 86 insertions(+), 99 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c

[dm-devel] [PATCH 29/45] block: initialize struct block_device in bdev_alloc

2020-11-28 Thread Christoph Hellwig
Don't play tricks with slab constructors as bdev structures tends to not get reused very much, and this makes the code a lot less error prone. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Acked-by: Tejun Heo --- fs/block_dev.c | 22 +- 1 file changed, 9

[dm-devel] [PATCH 18/45] init: refactor devt_from_partuuid

2020-11-28 Thread Christoph Hellwig
The code in devt_from_partuuid is very convoluted. Refactor a bit by sanitizing the goto and variable name usage. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Acked-by: Tejun Heo --- init/do_mounts.c | 68

[dm-devel] [PATCH 32/45] block: move the start_sect field to struct block_device

2020-11-28 Thread Christoph Hellwig
Move the start_sect field to struct block_device in preparation of killing struct hd_struct. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- block/blk-core.c | 5 +++-- block/blk-lib.c | 2 +- block/genhd.c | 4 ++-- block/partitions/core.c | 17

[dm-devel] [PATCH 17/45] init: refactor name_to_dev_t

2020-11-28 Thread Christoph Hellwig
Split each case into a self-contained helper, and move the block dependent code entirely under the pre-existing #ifdef CONFIG_BLOCK. This allows to remove the blk_lookup_devt stub in genhd.h. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Reviewed

[dm-devel] [PATCH 16/45] block: switch bdgrab to use igrab

2020-11-28 Thread Christoph Hellwig
All of the current callers already have a reference, but to prepare for additional users ensure bdgrab returns NULL if the block device is beeing freed. Signed-off-by: Christoph Hellwig --- fs/block_dev.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/block_dev.c b

[dm-devel] [PATCH 07/45] loop: do not call set_blocksize

2020-11-28 Thread Christoph Hellwig
set_blocksize is used by file systems to use their preferred buffer cache block size. Block drivers should not set it. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- drivers/block/loop.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block

[dm-devel] [PATCH 15/45] block: change the hash used for looking up block devices

2020-11-28 Thread Christoph Hellwig
Adding the minor to the major creates tons of pointless conflicts. Just use the dev_t itself, which is 32-bits and thus is guaranteed to fit into ino_t. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jan Kara Acked-by: Tejun Heo --- fs/block_dev.c | 26

[dm-devel] [PATCH 08/45] dm: simplify flush_bio initialization in __send_empty_flush

2020-11-28 Thread Christoph Hellwig
We don't really need the struct block_device to initialize a bio. So switch from using bio_set_dev to manually setting up bi_disk (bi_partno will always be zero and has been cleared by bio_init already). Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/md/dm.c | 12

[dm-devel] [PATCH 37/45] block: allocate struct hd_struct as part of struct bdev_inode

2020-11-28 Thread Christoph Hellwig
. The lifetime of struct gendisk is still controlled by the struct device embedded in the part0 hd_struct. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 16 --- block/blk-flush.c | 2 +- block/blk-merge.c | 2 - block/blk.h

[dm-devel] [PATCH 39/45] block: remove the partno field from struct hd_struct

2020-11-28 Thread Christoph Hellwig
Just use the bd_partno field in struct block_device everywhere. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- block/genhd.c | 12 ++-- block/partitions/core.c | 9 - include/linux/genhd.h | 1 - init/do_mounts.c| 2 +- 4 files changed, 11

[dm-devel] [PATCH 40/45] block: pass a block_device to blk_alloc_devt

2020-11-28 Thread Christoph Hellwig
Pass the block_device actually needed instead of the hd_struct. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- block/blk.h | 2 +- block/genhd.c | 14 +++--- block/partitions/core.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git

[dm-devel] [PATCH 4/5] block: remove the request_queue argument to the block_bio_remap tracepoint

2020-11-30 Thread Christoph Hellwig
The request_queue can trivially be derived from the bio. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 2 +- drivers/md/dm.c | 3 +-- drivers/md/md-linear.c| 3 +-- drivers/md/md.c | 5 ++--- drivers/md/raid0.c| 4

[dm-devel] [PATCH 3/5] block: remove the request_queue argument to the block_split tracepoint

2020-11-30 Thread Christoph Hellwig
The request_queue can trivially be derived from the bio. Signed-off-by: Christoph Hellwig --- block/blk-merge.c| 2 +- drivers/md/dm.c | 2 +- include/trace/events/block.h | 14 ++ kernel/trace/blktrace.c | 5 ++--- 4 files changed, 10 insertions

[dm-devel] block tracepoint cleanups

2020-11-30 Thread Christoph Hellwig
Hi Jens, this series cleans up the block layer tracepoints by removing unused tracepoints or tracepoint arguments and consolidating the implementation of various bio based tracepoints. Diffstat: block/blk-core.c |4 block/blk-merge.c |8 - block/blk-mq-sched.c

[dm-devel] [PATCH 1/5] block: remove the unused block_sleeprq tracepoint

2020-11-30 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/trace/events/block.h | 18 -- kernel/trace/blktrace.c | 22 -- 2 files changed, 40 deletions(-) diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 34d64ca306b1c7..76459cf750e14d

[dm-devel] [PATCH 2/5] block: simplify and extended the block_bio_merge tracepoint class

2020-11-30 Thread Christoph Hellwig
The block_bio_merge tracepoint class can be reused for most bio-based tracepoints. For that is just needs to lose the superflous and rq parameters. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 2 +- block/blk-merge.c| 4 +- block/blk-mq.c

[dm-devel] [PATCH 5/5] block: remove the request_queue to argument request based tracepoints

2020-11-30 Thread Christoph Hellwig
The request_queue can trivially be derived from the request. Signed-off-by: Christoph Hellwig --- block/blk-merge.c| 2 +- block/blk-mq-sched.c | 2 +- block/blk-mq.c | 8 +++ drivers/md/dm-rq.c | 2 +- drivers/s390/scsi/zfcp_fsf.c | 3

Re: [dm-devel] merge struct block_device and struct hd_struct v4

2020-11-30 Thread Christoph Hellwig
On Sat, Nov 28, 2020 at 05:14:25PM +0100, Christoph Hellwig wrote: > A git tree is available here: > > git://git.infradead.org/users/hch/block.git bdev-lookup > > Gitweb: > > > http://git.infradead.org/users/hch/block.git/shortlog/refs/heads/bdev-lookup I

[dm-devel] [PATCH 7/9] block: add a disk_uevent helper

2020-12-01 Thread Christoph Hellwig
Add a helper to call kobject_uevent for the disk and all partitions, and unexport the disk_part_iter_* helpers that are now only used in the core block code. Signed-off-by: Christoph Hellwig --- block/genhd.c | 27 ++- drivers/s390/block/dasd.c | 26

[dm-devel] [PATCH 8/9] block: remove DISK_PITER_REVERSE

2020-12-01 Thread Christoph Hellwig
There is good reason to iterate backwards when deleting all partitions in del_gendisk, just like we don't in blk_drop_partitions. Signed-off-by: Christoph Hellwig --- block/genhd.c | 34 -- include/linux/genhd.h | 1 - 2 files changed, 4 insertions

[dm-devel] [PATCH 5/9] block: use ->bi_bdev for bio based I/O accounting

2020-12-01 Thread Christoph Hellwig
I/O to a different device, or bio_end_io_acct_remapped if the driver did remap the I/O. Signed-off-by: Christoph Hellwig --- block/blk-core.c| 23 +-- drivers/md/bcache/request.c | 34 +- drivers/md/md.c | 8 include/li

[dm-devel] [PATCH 4/9] block: simplify submit_bio_checks a bit

2020-12-01 Thread Christoph Hellwig
Merge a few checks for whole devices vs partitions to streamline the sanity checks. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 40 ++-- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index

[dm-devel] [PATCH 3/9] block: store a block_device pointer in struct bio

2020-12-01 Thread Christoph Hellwig
Replace the gendisk pointer in struct bio with a pointer to the newly improved struct block device. From that the gendisk can be trivially accessed with an extra indirection, but it also allows to directly look up all information related to partition remapping. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 6/9] blk-mq: use ->bi_bdev for I/O accounting

2020-12-01 Thread Christoph Hellwig
Remove the reverse map from a sector to a partition for I/O accounting by simply using ->bi_bdev. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 6 +- block/blk.h | 2 -- block/genhd.c| 48 3 files changed, 5 inserti

[dm-devel] [PATCH 9/9] block: use an xarray for disk->part_tbl

2020-12-01 Thread Christoph Hellwig
Now that no fast path lookups in the partition table are left, there is no point in micro-optimizing the data structure for it. Just use a bog standard xarray. Signed-off-by: Christoph Hellwig --- block/blk-settings.c| 2 +- block/blk.h | 1 - block/genhd.c | 156

[dm-devel] store a pointer to the block_device in struct bio (again)

2020-12-01 Thread Christoph Hellwig
Hi Jens, this series switches back from storing the gendisk + partno to storing a block_device pointer in struct bio. The reason is two fold: for one the new struct block_device actually is always available, removing the need to avoid originally. Second the merge struct block_device is much

[dm-devel] [PATCH 2/9] dcssblk: remove the end of device check in brd_do_bvec

2020-12-01 Thread Christoph Hellwig
The block layer already checks for this conditions in bio_check_eod before calling the driver. Signed-off-by: Christoph Hellwig --- drivers/s390/block/dcssblk.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index

[dm-devel] [PATCH 1/9] brd: remove the end of device check in brd_do_bvec

2020-12-01 Thread Christoph Hellwig
The block layer already checks for this conditions in bio_check_eod before calling the driver. Signed-off-by: Christoph Hellwig --- drivers/block/brd.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/block/brd.c b/drivers/block/brd.c index c43a6ab4b1f39f

Re: [dm-devel] [PATCH v1 0/5] dm: dm-user: New target that proxies BIOs to userspace

2020-12-04 Thread Christoph Hellwig
What is the advantage over simply using nbd? -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 3/9] block: store a block_device pointer in struct bio

2020-12-03 Thread Christoph Hellwig
On Thu, Dec 03, 2020 at 03:10:55PM +0800, Ming Lei wrote: > On Thu, Dec 03, 2020 at 02:40:04PM +0800, Ming Lei wrote: > > On Tue, Dec 01, 2020 at 05:54:18PM +0100, Christoph Hellwig wrote: > > > Replace the gendisk pointer in struct bio with a pointer to the newly > >

Re: [dm-devel] block tracepoint cleanups

2020-12-03 Thread Christoph Hellwig
Whom can I trick into reviewing this fairly simple series now that the one dependig on it got fully reviewed? -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 1/4] block: add a hard-readonly flag to struct gendisk

2020-12-03 Thread Christoph Hellwig
On Wed, Dec 02, 2020 at 11:04:33PM -0500, Martin K. Petersen wrote: > > Hi Christoph! > > > - If BLKROSET is used to set a whole-disk device read-only, any > >partitions will end up in a read-only state until the user > >explicitly clears the flag. > > This no longer appears to be the

Re: [dm-devel] [PATCH 36/44] block: allocate struct hd_struct as part of struct bdev_inode

2020-11-26 Thread Christoph Hellwig
On Thu, Nov 26, 2020 at 07:00:48PM +0100, Jan Kara wrote: > > I don't think hd_struct holds a reference to block_device, does it? > > bdev_alloc() now just assigns bdev->bd_part->bdev = bdev... > > Now I understood this is probably correct - each partition (including > gendisk as 0 partition)

Re: [dm-devel] [PATCH 31/44] block: move the start_sect field to struct block_device

2020-11-26 Thread Christoph Hellwig
On Thu, Nov 26, 2020 at 05:56:41PM +0100, Jan Kara wrote: > The long long conversion is pointless here, right? Yes. -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH 1/4] block: add a hard-readonly flag to struct gendisk

2020-11-29 Thread Christoph Hellwig
partitions will reflect the current write-protect state of the underlying device. Based on a patch from Martin K. Petersen . Reported-by: Oleksii Kurochko Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201221 Signed-off-by: Christoph Hellwig --- block/blk-core.c| 2 +- block/genhd.c

[dm-devel] [PATCH 4/4] dm: use bdev_read_only to check if a device is read-only

2020-11-29 Thread Christoph Hellwig
dm-thin and dm-cache also work on partitions, so use the proper interface to check if the device is read-only. Signed-off-by: Christoph Hellwig --- drivers/md/dm-cache-metadata.c | 2 +- drivers/md/dm-thin-metadata.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[dm-devel] split hard read-only vs read-only policy v2

2020-11-29 Thread Christoph Hellwig
Hi Jens, this series resurrects a patch from Martin to properly split the flag indicating a disk has been set read-only by the hardware vs the userspace policy set through the BLKROSET ioctl. This series is based on top of the "merge struct block_device and struct hd_struct v4" series and

[dm-devel] [PATCH 3/4] nvme: allow revalidate to set a namespace read-only

2020-11-29 Thread Christoph Hellwig
Unconditionally call set_disk_ro now that it only updates the hardware state. This allows to properly set up the Linux devices read-only when the controller turns a previously writable namespace read-only. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 3 +-- 1 file changed, 1

[dm-devel] [PATCH 2/4] rbd: remove the ->set_read_only method

2020-11-29 Thread Christoph Hellwig
Now that the hardware read-only state can't be changed by the BLKROSET ioctl, the code in this method is not required anymore. Signed-off-by: Christoph Hellwig --- drivers/block/rbd.c | 19 --- 1 file changed, 19 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block

Re: [dm-devel] [PATCH v1 0/5] dm: dm-user: New target that proxies BIOs to userspace

2020-12-22 Thread Christoph Hellwig
On Mon, Dec 14, 2020 at 07:00:57PM -0800, Palmer Dabbelt wrote: > I haven't gotten a whole lot of feedback, so I'm inclined to at least have > some > reasonable performance numbers before bothering with a v2. FYI, my other main worry beside duplicating nbd is that device mapper really is a

Re: [dm-devel] DM's filesystem lookup in dm_get_dev_t() [was: Re: linux-next: manual merge of the device-mapper tree with Linus' tree]

2020-12-23 Thread Christoph Hellwig
On Tue, Dec 22, 2020 at 06:24:09PM +0100, Hannes Reinecke wrote: > Ok. The problem from my perspective is that device-mapper needs to > a) ensure that the arbitrary string passed in with the table definition > refers to a valid block device > and > b) the block device can be opened with O_EXCL,

Re: [dm-devel] DM's filesystem lookup in dm_get_dev_t() [was: Re: linux-next: manual merge of the device-mapper tree with Linus' tree]

2020-12-23 Thread Christoph Hellwig
On Tue, Dec 22, 2020 at 09:06:04PM +, Alasdair G Kergon wrote: > I have not read the background about whatever the new problem is - I'm > jumping in cold seeing this message - but from the very beginning of > device-mapper we have strongly recommended that userspace supplies the > block device

Re: [dm-devel] [PATCH v1 0/5] dm: dm-user: New target that proxies BIOs to userspace

2020-12-23 Thread Christoph Hellwig
FYI, a few years ago I spent some time helping a customer to prepare their block device in userspace using fuse code for upstreaming, but at some point they abandoned the project. But if for some reason we don't want to use nbd I think a driver using the fuse infrastructure would be the next

Re: [dm-devel] [PATCH 03/24] nvme: let set_capacity_revalidate_and_notify update the bdev size

2020-11-09 Thread Christoph Hellwig
On Mon, Nov 09, 2020 at 08:53:58AM +0100, Hannes Reinecke wrote: >> index 376096bfc54a83..4e86c9aafd88a7 100644 >> --- a/drivers/nvme/host/core.c >> +++ b/drivers/nvme/host/core.c >> @@ -2053,7 +2053,7 @@ static void nvme_update_disk_info(struct gendisk *disk, >> capacity = 0;

[dm-devel] [PATCH 14/24] pktcdvd: use set_capacity_and_notify

2020-11-08 Thread Christoph Hellwig
Use set_capacity_and_notify to set the size of both the disk and block device. This also gets the uevent notifications for the resize for free. Signed-off-by: Christoph Hellwig --- drivers/block/pktcdvd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block

[dm-devel] [PATCH 03/24] nvme: let set_capacity_revalidate_and_notify update the bdev size

2020-11-08 Thread Christoph Hellwig
There is no good reason to call revalidate_disk_size separately. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 376096bfc54a83..4e86c9aafd88a7 100644

[dm-devel] [PATCH 18/24] rnbd: use set_capacity_and_notify

2020-11-11 Thread Christoph Hellwig
Use set_capacity_and_notify to set the size of both the disk and block device. This also gets the uevent notifications for the resize for free. Signed-off-by: Christoph Hellwig --- drivers/block/rnbd/rnbd-clt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block

[dm-devel] [PATCH 09/24] nbd: refactor size updates

2020-11-11 Thread Christoph Hellwig
Merge nbd_size_set and nbd_size_update into a single function that also updates the nbd_config fields. This new function takes the device size in bytes as the first argument, and the blocksize as the second argument, simplifying the calculations required in most callers. Signed-off-by: Christoph

[dm-devel] [PATCH 08/24] nbd: move the task_recv check into nbd_size_update

2020-11-11 Thread Christoph Hellwig
nbd_size_update is about to acquire a few more callers, so lift the check into the function. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik --- drivers/block/nbd.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block

[dm-devel] [PATCH 12/24] aoe: don't call set_capacity from irq context

2020-11-11 Thread Christoph Hellwig
be merged with the update of the block device size by using set_capacity_and_notify. As an extra bonus this also adds proper uevent notifications for the resize. Signed-off-by: Christoph Hellwig --- drivers/block/aoe/aoecmd.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions

[dm-devel] [PATCH 22/24] md: remove a spurious call to revalidate_disk_size in update_size

2020-11-11 Thread Christoph Hellwig
None of the ->resize methods updates the disk size, so calling revalidate_disk_size here won't do anything. Signed-off-by: Christoph Hellwig Acked-by: Song Liu --- drivers/md/md-cluster.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluste

[dm-devel] [PATCH 04/24] sd: update the bdev size in sd_revalidate_disk

2020-11-11 Thread Christoph Hellwig
This avoids the extra call to revalidate_disk_size in sd_rescan and is otherwise a no-op because the size did not change, or we are in the probe path. Signed-off-by: Christoph Hellwig Acked-by: Martin K. Petersen --- drivers/scsi/sd.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions

[dm-devel] [PATCH 01/24] block: remove the call to __invalidate_device in check_disk_size_change

2020-11-11 Thread Christoph Hellwig
many people use partitions, for which no invalidation was performed anyway. Signed-off-by: Christoph Hellwig --- fs/block_dev.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 9e84b1928b9401..66ebf594c97f47 100644 --- a/fs/block_dev.c +++ b/fs

[dm-devel] [PATCH 02/24] loop: remove loop_set_size

2020-11-11 Thread Christoph Hellwig
Just use set_capacity_revalidate_and_notify directly, as this function can update the block device size as well when the last parameter is set to true. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 37 +++-- 1 file changed, 7 insertions(+), 30

[dm-devel] [PATCH 24/24] block: unexport revalidate_disk_size

2020-11-11 Thread Christoph Hellwig
revalidate_disk_size is now only called from set_capacity_and_notify, so drop the export. Signed-off-by: Christoph Hellwig --- fs/block_dev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 66ebf594c97f47..d8664f5c1ff669 100644 --- a/fs/block_dev.c +++ b

[dm-devel] [PATCH 23/24] virtio-blk: remove a spurious call to revalidate_disk_size

2020-11-11 Thread Christoph Hellwig
revalidate_disk_size just updates the block device size from the disk size. Thus calling it from virtblk_update_cache_mode doesn't actually do anything. Signed-off-by: Christoph Hellwig Acked-by: Stefan Hajnoczi Acked-by: Michael S. Tsirkin --- drivers/block/virtio_blk.c | 1 - 1 file

[dm-devel] cleanup updating the size of block devices v2

2020-11-11 Thread Christoph Hellwig
Hi Jens, this series builds on top of the work that went into the last merge window, and make sure we have a single coherent interfac for updating the size of a block device. Changes since v1: - minor spelling fixes Diffstat: block/genhd.c | 16 +++

<    6   7   8   9   10   11   12   13   14   15   >