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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
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
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
, 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
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
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
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
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
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
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
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
, 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
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
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
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
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
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
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
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
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
. 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
What is the advantage over simply using nbd?
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
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
> >
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
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
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)
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
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-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
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
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
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
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
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,
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
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
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;
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
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
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
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
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
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
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
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
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
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
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
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
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 +++
1001 - 1100 of 2486 matches
Mail list logo