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

2020-11-11 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 40ca71b29bb91a..66129b86e97bed 100644

[dm-devel] [PATCH 19/24] zram: 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/zram/zram_drv.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers

[dm-devel] [PATCH 06/24] block: add a return value to set_capacity_and_notify

2020-11-11 Thread Christoph Hellwig
Return if the function ended up sending an uevent or not. Signed-off-by: Christoph Hellwig --- block/genhd.c | 7 +-- include/linux/genhd.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index d8d9d6c1c916e1..8c350fecfe8bfe

[dm-devel] [PATCH 13/24] dm: 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/md/dm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers

[dm-devel] [PATCH 05/24] block: remove the update_bdev parameter from set_capacity_revalidate_and_notify

2020-11-11 Thread Christoph Hellwig
The update_bdev argument is always set to true, so remove it. Also rename the function to the slighly less verbose set_capacity_and_notify, as propagating the disk size to the block device isn't really revalidation. Signed-off-by: Christoph Hellwig --- block/genhd.c| 13

[dm-devel] [PATCH 11/24] nbd: use set_capacity_and_notify

2020-11-11 Thread Christoph Hellwig
Use set_capacity_and_notify to update the disk and block device sizes and send a RESIZE uevent to userspace. Note that blktests relies on uevents being sent also for updates that did not change the device size, so the explicit kobject_uevent remains for that case. Signed-off-by: Christoph

[dm-devel] [PATCH 17/24] rbd: 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 Acked-by: Jack Wang --- drivers/block/rbd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[dm-devel] [PATCH 20/24] dm-raid: 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/md/dm-raid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/dm-raid.c b

[dm-devel] [PATCH 15/24] nvme: use set_capacity_and_notify in nvme_set_queue_dying

2020-11-11 Thread Christoph Hellwig
Use the block layer helper to update both the disk and block device sizes. Contrary to the name no notification is sent in this case, as a size 0 is special cased. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 13 + 1 file changed, 1 insertion(+), 12 deletions

[dm-devel] [PATCH 14/24] pktcdvd: 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/pktcdvd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block

[dm-devel] [PATCH 21/24] md: 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 Acked-by: Song Liu --- drivers/md/md-cluster.c | 6 ++ drivers/md/md-linear.c | 3 +-- drivers/md/md.c

[dm-devel] [PATCH 16/24] drbd: 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 Acked-by: Ilya Dryomov --- drivers/block/drbd/drbd_main.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions

[dm-devel] [PATCH 10/24] nbd: validate the block size in nbd_set_size

2020-11-11 Thread Christoph Hellwig
Move the validation of the block from the callers into nbd_set_size. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik --- drivers/block/nbd.c | 47 +++-- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/drivers/block/nbd.c b

[dm-devel] [PATCH 07/24] nbd: remove the call to set_blocksize

2020-11-11 Thread Christoph Hellwig
Block driver have no business setting the file system concept of a block size. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik --- drivers/block/nbd.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index

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

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

[dm-devel] [PATCH 70/78] block: replace bd_mutex with a per-gendisk mutex

2020-11-16 Thread Christoph Hellwig
in the gendisk structure. Signed-off-by: Christoph Hellwig --- block/genhd.c | 7 ++-- block/ioctl.c | 4 +- block/partitions/core.c | 22 +- drivers/block/loop.c| 14 +++ drivers/block/xen-blkfront.c| 8 ++-- drivers/block/zram

[dm-devel] [PATCH 72/78] block: use disk_part_iter_exit in disk_part_iter_next

2020-11-16 Thread Christoph Hellwig
Call disk_part_iter_exit in disk_part_iter_next instead of duplicating the functionality. Signed-off-by: Christoph Hellwig --- block/genhd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index 999f7142b04e7d..56bc37e98ed852 100644

[dm-devel] [PATCH 60/78] zram: remove the claim mechanism

2020-11-16 Thread Christoph Hellwig
on a block device that is not open. Signed-off-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 76 ++- 1 file changed, 21 insertions(+), 55 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 6d15d51cee2b7e

[dm-devel] [PATCH 67/78] block: simplify the block device claiming interface

2020-11-16 Thread Christoph Hellwig
Stop passing the whole device as a separate argument given that it can be trivially deducted. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 12 +++- fs/block_dev.c | 69 +++--- include/linux/blkdev.h | 6 ++-- 3 files changed, 38

[dm-devel] [PATCH 78/78] block: remove i_bdev

2020-11-16 Thread Christoph Hellwig
Switch the block device lookup interfaces to directly work with a dev_t so that struct block_device references are only acquired by the blkdev_get variants (and the blk-cgroup special case). This means that we not don't need an extra reference in the inode. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 76/78] filemap: use ->f_mapping over ->i_mapping consistently

2020-11-16 Thread Christoph Hellwig
Use file->f_mapping in all functions that have a struct file available to properly handle the case where file_inode(file)->i_mapping != inode->i_mapping. Signed-off-by: Christoph Hellwig --- mm/filemap.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mm/fi

[dm-devel] [PATCH 68/78] block: remove ->bd_contains

2020-11-16 Thread Christoph Hellwig
Now that each gendisk has a reference to the block_device referencing it, we can just use that everywhere and get rid of ->bd_contain. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsicam.c| 2 +- fs/block_dev.c| 50 +-- include/li

[dm-devel] [PATCH 64/78] dm: simplify flush_bio initialization in __send_empty_flush

2020-11-16 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 --- drivers/md/dm.c | 12 +++- 1 file changed, 3

[dm-devel] [PATCH 47/78] floppy: use a separate gendisk for each media format

2020-11-16 Thread Christoph Hellwig
gendisk for each of the aliases if they are accessed. Signed-off-by: Christoph Hellwig --- drivers/block/floppy.c | 154 ++--- 1 file changed, 97 insertions(+), 57 deletions(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 7df79ae6b0a1e1

[dm-devel] [PATCH 49/78] ataflop: use a separate gendisk for each media format

2020-11-16 Thread Christoph Hellwig
a separate gendisk for each of the aliases if they are accessed. Signed-off-by: Christoph Hellwig --- drivers/block/ataflop.c | 135 +--- 1 file changed, 86 insertions(+), 49 deletions(-) diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index

[dm-devel] [PATCH 25/78] block: don't call into the driver for BLKFLSBUF

2020-11-16 Thread Christoph Hellwig
BLKFLSBUF is entirely contained in the block core, and there is no good reason to give the driver a hook into processing it. Signed-off-by: Christoph Hellwig --- block/ioctl.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/block/ioctl.c b/block/ioctl.c index 3fbc382eb926d4

Re: [dm-devel] cleanup updating the size of block devices v3

2020-11-16 Thread Christoph Hellwig
Oops, this is a bigger patch bomb than intended. Only patches 1-23 are this series which should be ready to be applied once for-5.11/block pulles in 5.10-rc4. After that follow patches already in for-5.11/block and my current hot off the press development branch. -- dm-devel mailing list

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

2020-11-16 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 06/78] nbd: remove the call to set_blocksize

2020-11-16 Thread Christoph Hellwig
Block driver have no business setting the file system concept of a block size. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik --- drivers/block/nbd.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index

[dm-devel] [PATCH 34/78] block: propagate BLKROSET to all partitions

2020-11-16 Thread Christoph Hellwig
When setting the whole device read-only (or clearing the read-only state), also update the policy for all partitions. The s390 dasd driver has awlways been doing this and it makes a lot of sense. Signed-off-by: Christoph Hellwig --- block/ioctl.c | 5 - 1 file changed, 4 insertions(+), 1

[dm-devel] [PATCH 09/78] nbd: validate the block size in nbd_set_size

2020-11-16 Thread Christoph Hellwig
Move the validation of the block from the callers into nbd_set_size. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik --- drivers/block/nbd.c | 47 +++-- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/drivers/block/nbd.c b

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

2020-11-16 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 v2: - rebased to the set_capacity_revalidate_and_notify in mainline - keep the loop_set_size function -

[dm-devel] [PATCH 38/78] block: rework requesting modules for unclaimed devices

2020-11-16 Thread Christoph Hellwig
Instead of reusing the ranges in bdev_map, add a new helper that is called if no ranges was found. This is a first step to unpeel and eventually remove the complex ranges structure. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- block/genhd.c | 25

[dm-devel] [PATCH 07/78] nbd: move the task_recv check into nbd_size_update

2020-11-16 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 37/78] block: split block_class_lock

2020-11-16 Thread Christoph Hellwig
Split the block_class_lock mutex into one each to protect bdev_map and major_names. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- block/genhd.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/block/genhd.c b/block/genhd.c

[dm-devel] [PATCH 27/78] rbd: implement ->set_read_only to hook into BLKROSET processing

2020-11-16 Thread Christoph Hellwig
Implement the ->set_read_only method instead of parsing the actual ioctl command. Signed-off-by: Christoph Hellwig Acked-by: Ilya Dryomov --- drivers/block/rbd.c | 40 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/drivers/block/rbd.

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

2020-11-16 Thread Christoph Hellwig
many people use partitions, for which no invalidation was performed anyway. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- 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

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

2020-11-16 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 Reviewed-by: Hannes Reinecke --- drivers/scsi/sd.c | 8 +++- 1 file changed

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

2020-11-16 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] [PATCH 26/78] block: add a new set_read_only method

2020-11-16 Thread Christoph Hellwig
Add a new method to allow for driver-specific processing when setting or clearing the block device read-only state. This allows to replace the cumbersome and error-prone override of the whole ioctl implementation. Signed-off-by: Christoph Hellwig --- block/ioctl.c | 5 + include

[dm-devel] [PATCH 58/78] init: cleanup match_dev_by_uuid and match_dev_by_label

2020-11-16 Thread Christoph Hellwig
Avoid a totally pointless goto label, and use the same style of comparism for both helpers. Signed-off-by: Christoph Hellwig --- init/do_mounts.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/init/do_mounts.c b/init/do_mounts.c index afa26a4028d25e

[dm-devel] [PATCH 73/78] block: use put_device in put_disk

2020-11-16 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 --- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/genhd.c b/block/genhd.c index 56bc37e98ed852..f1e20ec1b62887 100644

[dm-devel] [PATCH 51/78] z2ram: use separate gendisk for the different modes

2020-11-16 Thread Christoph Hellwig
-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/z2ram.c | 100 -- 1 file changed, 58 insertions(+), 42 deletions(-) diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c index eafecc9a72b38d..c1d20818e64920 100644 --- a/drivers

[dm-devel] [PATCH 54/78] block: remove a duplicate __disk_get_part prototype

2020-11-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/linux/genhd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 46553d6d602563..22f5b9fd96f8bf 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -250,7 +250,6 @@ static inline dev_t

[dm-devel] [PATCH 61/78] zram: do not call set_blocksize

2020-11-16 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/zram/zram_drv.c | 11 +-- drivers/block/zram/zram_drv.h | 1 - 2 files changed, 1 insertion(+), 11 deletions

[dm-devel] [PATCH 74/78] block: merge struct block_device and struct hd_struct

2020-11-16 Thread Christoph Hellwig
, with the device model reference front ending it for device model interaction. The percpu refcount in struct hd_struct is entirely gone given that struct block_device must be opened and thus valid for the duration of the I/O. Signed-off-by: Christoph Hellwig --- block/bio.c| 6

[dm-devel] [PATCH 50/78] z2ram: reindent

2020-11-16 Thread Christoph Hellwig
reindent the driver using Lident as the code style was far away from normal Linux code. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/z2ram.c | 493 -- 1 file changed, 236 insertions(+), 257 deletions(-) diff --git

[dm-devel] [PATCH 71/78] block: add a bdev_kobj helper

2020-11-16 Thread Christoph Hellwig
Add a little helper to find the kobject for a struct block_device. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/super.c | 7 ++- drivers/md/md.c | 4 +--- fs/btrfs/sysfs.c | 15 +++ include/linux/blk_types.h | 3 +++ 4 files changed, 9 insertions

[dm-devel] [PATCH 57/78] init: refactor devt_from_partuuid

2020-11-16 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 --- init/do_mounts.c | 68 ++-- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/init

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

2020-11-16 Thread Christoph Hellwig
gets fixed. Signed-off-by: Christoph Hellwig --- block/bio.c| 2 +- block/blk-core.c | 2 +- block/blk.h| 53 -- block/genhd.c | 34 +++--- block/partitions/core.c| 17

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

2020-11-16 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 --- fs/block_dev.c | 26 ++ 1 file changed, 2 insertions(+), 24 deletions(-) diff

[dm-devel] [PATCH 56/78] init: refactor name_to_dev_t

2020-11-16 Thread Christoph Hellwig
Split each case into a self-contained helper. Signed-off-by: Christoph Hellwig --- include/linux/genhd.h | 7 +- init/do_mounts.c | 183 +- 2 files changed, 91 insertions(+), 99 deletions(-) diff --git a/include/linux/genhd.h b/include/linux

[dm-devel] [PATCH 48/78] amiflop: use separate gendisks for Amiga vs MS-DOS mode

2020-11-16 Thread Christoph Hellwig
. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/amiflop.c | 98 +++-- 1 file changed, 55 insertions(+), 43 deletions(-) diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c index 71c2b156455860..9e2d0c6a387721 100644

[dm-devel] [PATCH 66/78] block: keep a block_device reference for each hd_struct

2020-11-16 Thread Christoph Hellwig
-by: Christoph Hellwig --- block/blk-cgroup.c | 42 - block/blk-iocost.c | 36 +++ block/blk.h| 1 - block/genhd.c | 188 +++-- block/partitions/core.c| 28 +++--- fs/block_dev.c | 133

[dm-devel] [PATCH 41/78] swim: don't call blk_register_region

2020-11-16 Thread Christoph Hellwig
The swim driver (unlike various other floppy drivers) doesn't have magic device nodes for certain modes, and already registers a gendisk for each of the floppies supported by a device. Thus the region registered is a no-op and can be removed. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes

[dm-devel] [PATCH 65/78] dm: remove the block_device reference in struct mapped_device

2020-11-16 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 --- drivers/md/dm-core.h | 2

[dm-devel] [PATCH 46/78] ide: switch to __register_blkdev for command set probing

2020-11-16 Thread Christoph Hellwig
an unclaimed ide device node, but except for a few potentially loaded modules for a fringe use case of a deprecated and soon to be removed driver that doesn't make a difference. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/ide/ide-probe.c | 34

[dm-devel] [PATCH 42/78] sd: use __register_blkdev to avoid a modprobe for an unregistered dev_t

2020-11-16 Thread Christoph Hellwig
Switch from using blk_register_region to the probe callback passed to __register_blkdev to disable the request_module call for an unclaimed dev_t in the SD majors. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/scsi/sd.c | 19 +-- 1 file changed, 5

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

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

[dm-devel] [PATCH 43/78] brd: use __register_blkdev to allocate devices on demand

2020-11-16 Thread Christoph Hellwig
Use the simpler mechanism attached to major_name to allocate a brd device when a currently unregistered minor is accessed. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/brd.c | 39 +++ 1 file changed, 11 insertions(+), 28

[dm-devel] [PATCH 77/78] fs: simplify the get_super_thawed interface

2020-11-16 Thread Christoph Hellwig
Merge get_super_thawed and get_super_exclusive_thawed into a single function. Signed-off-by: Christoph Hellwig --- fs/quota/quota.c | 4 ++-- fs/super.c | 42 +++--- include/linux/fs.h | 3 +-- 3 files changed, 14 insertions(+), 35 deletions

[dm-devel] [PATCH 45/78] md: use __register_blkdev to allocate devices on demand

2020-11-16 Thread Christoph Hellwig
Use the simpler mechanism attached to major_name to allocate a md device when a currently unregistered minor is accessed. Signed-off-by: Christoph Hellwig Acked-by: Song Liu Reviewed-by: Hannes Reinecke --- drivers/md/md.c | 21 - 1 file changed, 8 insertions(+), 13

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

2020-11-16 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 --- block/blk-cgroup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-cgroup.c b/block/blk-cgro

[dm-devel] [PATCH 52/78] block: switch gendisk lookup to a simple xarray

2020-11-16 Thread Christoph Hellwig
Now that bdev_map is only used for finding gendisks, we can use a simple xarray instead of the regions tracking structure for it. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Greg Kroah-Hartman --- block/genhd.c | 208

[dm-devel] [PATCH 63/78] bcache: remove a superflous lookup_bdev all

2020-11-16 Thread Christoph Hellwig
Don't bother to call lookup_bdev for just a slightly different error message without any functional change. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/super.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache

[dm-devel] [PATCH 44/78] loop: use __register_blkdev to allocate devices on demand

2020-11-16 Thread Christoph Hellwig
Use the simpler mechanism attached to major_name to allocate a brd device when a currently unregistered minor is accessed. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/loop.c | 30 -- 1 file changed, 8 insertions(+), 22 deletions

[dm-devel] [PATCH 40/78] ide: remove ide_{,un}register_region

2020-11-16 Thread Christoph Hellwig
There is no need to ever register the fake gendisk used for ide-tape. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/ide/ide-probe.c | 32 drivers/ide/ide-tape.c | 2 -- include/linux/ide.h | 3 --- 3 files changed, 37

[dm-devel] [PATCH 62/78] loop: do not call set_blocksize

2020-11-16 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 36/78] block: open code kobj_map into in block/genhd.c

2020-11-16 Thread Christoph Hellwig
Copy and paste the kobj_map functionality in the block code in preparation for completely rewriting it. Signed-off-by: Christoph Hellwig --- block/genhd.c | 130 +- 1 file changed, 117 insertions(+), 13 deletions(-) diff --git a/block/genhd.c b

[dm-devel] [PATCH 23/78] block: unexport revalidate_disk_size

2020-11-16 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 35/78] block: cleanup del_gendisk a bit

2020-11-16 Thread Christoph Hellwig
Merge three hidden gendisk checks into one. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- block/genhd.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index b0f0b0cac9aa7f..8180195b76634b 100644 --- a/block

[dm-devel] [PATCH 30/78] block: don't call into the driver for BLKROSET

2020-11-16 Thread Christoph Hellwig
Now that all drivers that want to hook into setting or clearing the read-only flag use the set_read_only method, this code can be removed. Signed-off-by: Christoph Hellwig --- block/ioctl.c | 23 --- 1 file changed, 23 deletions(-) diff --git a/block/ioctl.c b/block/ioctl.c

[dm-devel] [PATCH 33/78] block: remove __blkdev_driver_ioctl

2020-11-16 Thread Christoph Hellwig
Just open code it in the few callers. Signed-off-by: Christoph Hellwig --- block/ioctl.c | 25 + drivers/block/pktcdvd.c | 6 -- drivers/md/bcache/request.c | 5 +++-- drivers/md/dm.c | 5 - include/linux/blkdev.h | 2 -- 5

[dm-devel] [PATCH 39/78] block: add an optional probe callback to major_names

2020-11-16 Thread Christoph Hellwig
Add a callback to the major_names array that allows a driver to override how to probe for dev_t that doesn't currently have a gendisk registered. This will help separating the lookup of the gendisk by dev_t vs probe action for a not currently registered dev_t. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 29/78] dasd: implement ->set_read_only to hook into BLKROSET processing

2020-11-16 Thread Christoph Hellwig
Implement the ->set_read_only method instead of parsing the actual ioctl command. Signed-off-by: Christoph Hellwig --- drivers/s390/block/dasd.c | 1 + drivers/s390/block/dasd_int.h | 3 ++- drivers/s390/block/dasd_ioctl.c | 27 +-- 3 files changed,

[dm-devel] [PATCH 32/78] block: remove set_device_ro

2020-11-16 Thread Christoph Hellwig
Fold set_device_ro into its only remaining caller. Signed-off-by: Christoph Hellwig --- block/genhd.c | 7 --- block/ioctl.c | 2 +- include/linux/genhd.h | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index 8c350fecfe8bfe

[dm-devel] [PATCH 24/78] mtd_blkdevs: don't override BLKFLSBUF

2020-11-16 Thread Christoph Hellwig
BLKFLSBUF is not supposed to actually send a flush command to the device, but to tear down buffer cache structures. Remove the mtd_blkdevs implementation and just use the default semantics instead. Signed-off-by: Christoph Hellwig Acked-by: Richard Weinberger --- drivers/mtd/mtd_blkdevs.c

[dm-devel] [PATCH 31/78] loop: use set_disk_ro

2020-11-16 Thread Christoph Hellwig
Use set_disk_ro instead of set_device_ro to match all other block drivers and to ensure all partitions mirror the read-only flag. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/loop.c b/drivers/block

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

2020-11-16 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 08/78] nbd: refactor size updates

2020-11-16 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 2/6] zram: remove the claim mechanism

2020-11-16 Thread Christoph Hellwig
on a block device that is not open. Signed-off-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 72 --- 1 file changed, 15 insertions(+), 57 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 6d15d51cee2b7e

[dm-devel] [PATCH 4/6] loop: do not call set_blocksize

2020-11-16 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] misc struct block_device related driver cleanups

2020-11-16 Thread Christoph Hellwig
Hi Jens, Minchan and Mike, this series cleans up a few interactions of driver with struct block_device, in preparation for big changes to struct block_device that I plan to send soon. Diffstat: block/loop.c |3 - block/mtip32xx/mtip32xx.c | 15

[dm-devel] [PATCH 5/6] dm: simplify flush_bio initialization in __send_empty_flush

2020-11-16 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 --- drivers/md/dm.c | 12 +++- 1 file changed, 3

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

2020-11-16 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 --- drivers/md/dm-core.h | 2

[dm-devel] [PATCH 3/6] zram: do not call set_blocksize

2020-11-16 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/zram/zram_drv.c | 11 +-- drivers/block/zram/zram_drv.h | 1 - 2 files changed, 1 insertion(+), 11 deletions

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

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

Re: [dm-devel] [PATCH 07/20] init: refactor name_to_dev_t

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 09:25:05AM +0100, Jan Kara wrote: > OK, understood. Still it would seem more logical to leave blk_lookup_devt() > declaration inside #ifdef CONFIG_BLOCK and just delete the !CONFIG_BLOCK > definition (to make it clear we ever expect only users compiled when > CONFIG_BLOCK

Re: [dm-devel] [PATCH 13/20] block: remove ->bd_contains

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 11:32:53AM +0100, Jan Kara wrote: > > @@ -1521,7 +1510,7 @@ static int __blkdev_get(struct block_device *bdev, > > fmode_t mode, void *holder, > > if (bdev->bd_bdi == _backing_dev_info) > > bdev->bd_bdi =

Re: [dm-devel] [PATCH 17/20] filemap: consistently use ->f_mapping over ->i_mapping

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 03:13:16PM +, Matthew Wilcox wrote: > On Wed, Nov 18, 2020 at 09:47:57AM +0100, Christoph Hellwig wrote: > > @@ -2887,13 +2887,13 @@ EXPORT_SYMBOL(filemap_map_pages); > > vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf) > > { > > st

Re: [dm-devel] [PATCH 14/20] block: remove the nr_sects field in struct hd_struct

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 01:05:25PM +0100, Jan Kara wrote: > > @@ -613,7 +613,7 @@ void guard_bio_eod(struct bio *bio) > > rcu_read_lock(); > > part = __disk_get_part(bio->bi_disk, bio->bi_partno); > > if (part) > > - maxsector = part_nr_sects_read(part); > > +

Re: [dm-devel] [PATCH 11/20] block: reference struct block_device from struct hd_struct

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 10:41:57AM +0100, Jan Kara wrote: > > rcu_assign_pointer(ptbl->part[0], >part0); > > @@ -1772,8 +1626,10 @@ struct gendisk *__alloc_disk_node(int minors, int > > node_id) > > * converted to make use of bd_mutex and sequence counters. > > */ > >

Re: [dm-devel] [PATCH 15/20] block: merge struct block_device and struct hd_struct

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 03:39:21PM +0100, Jan Kara wrote: > This patch is kind of difficult to review due to the size of mostly > mechanical changes mixed with not completely mechanical changes. Can we > perhaps split out the mechanical bits? E.g. the rq->part => rq->bdev > renaming is mechanical

Re: [dm-devel] [PATCH 14/20] block: remove the nr_sects field in struct hd_struct

2020-11-20 Thread Christoph Hellwig
On Fri, Nov 20, 2020 at 12:21:21PM +0100, Jan Kara wrote: > > > AFAICT bd_size_lock is pointless after these changes so we can just remove > > > it? > > > > I don't think it is, as reuqiring bd_mutex for size updates leads to > > rather awkward lock ordering problems. > > OK, let me ask

Re: [dm-devel] [PATCH 14/20] block: remove the nr_sects field in struct hd_struct

2020-11-20 Thread Christoph Hellwig
On Fri, Nov 20, 2020 at 03:59:56PM +, Matthew Wilcox wrote: > > Exactly. In theory we could skip it for 64-bit, but as updating the > > size isn't a fast path, and struct block_device isn't super size critical > > I'd rather keep the same code for 32 vs 64-bit builds. > > Is it better to

[dm-devel] [PATCH 15/20] block: merge struct block_device and struct hd_struct

2020-11-18 Thread Christoph Hellwig
, with the device model reference front ending it for device model interaction. The percpu refcount in struct hd_struct is entirely gone given that struct block_device must be opened and thus valid for the duration of the I/O. Signed-off-by: Christoph Hellwig --- block/bio.c| 6

[dm-devel] [PATCH 02/20] block: remove a duplicate __disk_get_part prototype

2020-11-18 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/linux/genhd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 46553d6d602563..22f5b9fd96f8bf 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -250,7 +250,6 @@ static inline dev_t

[dm-devel] [PATCH 20/20] block: remove i_bdev

2020-11-18 Thread Christoph Hellwig
of struct block_device to keep the lookups contained in the core block layer code. Signed-off-by: Christoph Hellwig --- block/ioctl.c| 3 +- drivers/block/loop.c | 8 +- drivers/md/dm-table.c| 9 +- drivers/mtd

[dm-devel] [PATCH 17/20] filemap: consistently use ->f_mapping over ->i_mapping

2020-11-18 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 --- mm/filemap.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff -

[dm-devel] [PATCH 11/20] block: reference struct block_device from struct hd_struct

2020-11-18 Thread Christoph Hellwig
-by: Christoph Hellwig --- block/blk-cgroup.c | 42 block/blk-iocost.c | 36 +++ block/blk.h| 2 +- block/genhd.c | 204 - block/partitions/core.c| 28 ++--- fs/block_dev.c | 123

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