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
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
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 0bd9c41dd4cb69..f46e89226fdf91 100644
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
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
Just open code the wait in the only caller of both functions.
Signed-off-by: Christoph Hellwig
---
fs/internal.h | 2 ++
fs/quota/quota.c | 31 +---
fs/super.c | 51 ++
include/linux/fs.h | 4 +---
4 files
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 | 44 +--
1 file changed, 1 insertion(+), 43 deletions(-)
diff --git a/drivers/md
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 4e039524f92b8f..0bd9c41dd4cb69 100644
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
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
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
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
---
drivers/scsi/scsicam.c| 2 +-
fs/block_dev.c
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
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
Reorder the code to have one big section for the last close, and to use
bdev_is_partition.
Signed-off-by: Christoph Hellwig
---
fs/block_dev.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 29db12c3bb501c..4c4d6c30382c06
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
On Wed, Nov 18, 2020 at 10:04:04AM +0100, Jan Beulich wrote:
> That's the view of some people, but not all. Context can be easily
> established by those who care going to one of the many archives on
> which the entire series lands. Getting spammed, however, can't be
> avoided by the dozens or
On Wed, Nov 18, 2020 at 09:56:11AM +0100, Jan Beulich wrote:
> since this isn't the first series from you recently spamming
> xen-devel, may I ask that you don't Cc entire series to lists
> which are involved with perhaps just one out of the many patches?
> IMO Cc lists should be compiled on a
On Wed, Nov 18, 2020 at 04:54:51PM +0800, Coly Li wrote:
> On 11/18/20 4:47 PM, Christoph Hellwig wrote:
> > Don't bother to call lookup_bdev for just a slightly different error
> > message without any functional change.
> >
> > Signed-off-by: Christoph Hellwig ist
&
On Wed, Nov 18, 2020 at 03:37:47PM +0100, Jan Kara wrote:
> > -static inline dev_t blk_lookup_devt(const char *name, int partno)
> > -{
> > - dev_t devt = MKDEV(0, 0);
> > - return devt;
> > -}
> > #endif /* CONFIG_BLOCK */
>
> This hunk looks unrelated to the change? Also why you move the
On Tue, Nov 17, 2020 at 10:46:29AM -0500, Mike Snitzer wrote:
> On Mon, Nov 16 2020 at 4:20pm -0500,
> Christoph Hellwig wrote:
>
> > Hi Jens, Minchan and Mike,
> >
> > this series cleans up a few interactions of driver with struct
> > block_device, in prep
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
Reviewed-by: Hannes Reinecke
---
drivers/md/dm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git
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
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
Reviewed-by: Hannes Reinecke
Reviewed
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
Reviewed-by: Hannes Reinecke
---
drivers/nvme/host/core.c | 13 +
1 file changed, 1
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/drbd/drbd_main.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers
There is no good reason to call revalidate_disk_size separately.
Signed-off-by: Christoph Hellwig
Reviewed-by: Hannes Reinecke
---
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
There is no good reason to call revalidate_disk_size separately.
Signed-off-by: Christoph Hellwig
Reviewed-by: Hannes Reinecke
---
drivers/block/loop.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a58084c2ed7ceb
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
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/rnbd/rnbd-clt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff
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
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
Reviewed-by: Hannes Reinecke
---
drivers/md/dm-raid.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff
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
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/rbd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git
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
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
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
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/rbd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b
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
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
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
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/md-cluster.c | 6 ++
drivers/md/md-linear.c | 3 +--
drivers/md/md.c | 24
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
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
On Fri, Nov 20, 2020 at 09:05:48PM +0100, Jan Kara wrote:
> The code is already switched to it AFAICT (the lock is really only used in
> the two places that write i_size). But the problem is that in theory two
> i_size_write() calls can race in a way that the resulting stored i_size is a
> mix of
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
revalidate_disk_size just updates the block device size from the disk
size. Thus calling it from revalidate_disk_size doesn't actually do
anything.
Signed-off-by: Christoph Hellwig
---
drivers/block/virtio_blk.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/block/virtio_blk.c b
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
---
drivers/scsi/sd.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi
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.
Diffstat:
block/genhd.c | 16 +++
drivers/block/aoe/aoecmd.c | 15 +-
Block driver have no business setting the file system concept of a
block size.
Signed-off-by: Christoph Hellwig
---
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 c4f9ccf5cc2ac5..f618688a196654
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
nbd_size_update is about to acquire a few more callers, so lift the check
into the function.
Signed-off-by: Christoph Hellwig
---
drivers/block/nbd.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index f618688a196654
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
Move the validation of the block from the callers into nbd_set_size.
Signed-off-by: Christoph Hellwig
---
drivers/block/nbd.c | 47 +++--
1 file changed, 15 insertions(+), 32 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index
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
revalidate_disk_size is not 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
None of the ->resize methods updates the disk size, so calling
revalidate_disk_size here won't do anything.
Signed-off-by: Christoph Hellwig
---
drivers/md/md-cluster.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index 87442dc59f6
lla: https://bugzilla.kernel.org/show_bug.cgi?id=201221
Signed-off-by: Christoph Hellwig
Reviewed-by: Ming Lei
Reviewed-by: Martin K. Petersen
Reviewed-by: Hannes Reinecke
---
block/blk-core.c| 4 +---
block/genhd.c | 33 +++--
block/partitions/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
Reviewed-by: Ming Lei
Reviewed-by: Martin K. Petersen
Reviewed-by: Hannes Reinecke
---
drivers/md/dm-cache-metadata.c | 2 +-
drivers/md/dm-thin
Only a single caller can end up in bdev_read_only, so move the check
there.
Signed-off-by: Christoph Hellwig
Reviewed-by: Ming Lei
Reviewed-by: Martin K. Petersen
---
block/genhd.c | 3 ---
fs/super.c| 3 ++-
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/block/genhd.c b
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
Reviewed-by: Hannes Reinecke
Acked-by: Ilya Dryomov
Reviewed-by: Martin K. Petersen
---
drivers/block/rbd.c | 19
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
Reviewed-by: Keith Busch
Reviewed-by: Martin K
y letting the
user think they write protected the whole disk when they actually
didn't.
Suggested-by: Martin K. Petersen
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
block/genhd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block/genhd.c b/block/genh
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.
Note that the last patch only applies to for-next and not to
for-5.11/block. I can hold it back for the
On Thu, Jan 21, 2021 at 11:09:33AM -0500, Mike Snitzer wrote:
> > Mike, do you need anything more to apply this one? Do you want a
> > cleaned-up resend?
>
> It got hung up with Christoph correctly requesting more discussion, last
> linux-block/lkml mail on the associated thread I kicked off is
On Mon, Jan 25, 2021 at 10:53:36AM -0700, Jens Axboe wrote:
> On Sun, Jan 24, 2021 at 3:05 AM Christoph Hellwig wrote:
> >
> > There is no good reason to reassign ->bi_bdev when remapping the
> > partition-relative block number to the device wide one, as all the
On Mon, Jan 25, 2021 at 11:19:23AM -0700, Jens Axboe wrote:
> On 1/25/21 11:18 AM, Christoph Hellwig wrote:
> > On Mon, Jan 25, 2021 at 11:15:04AM -0700, Jens Axboe wrote:
> >> On 1/25/21 11:13 AM, Christoph Hellwig wrote:
> >>> On Mon, Jan 25, 2021 at 11:0
On Mon, Jan 25, 2021 at 11:03:24AM -0700, Jens Axboe wrote:
> Partition table entries are not in disk order.
And the issue shows up with the series just up to the this patch,
without any later patches?
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
On Mon, Jan 25, 2021 at 11:15:04AM -0700, Jens Axboe wrote:
> On 1/25/21 11:13 AM, Christoph Hellwig wrote:
> > On Mon, Jan 25, 2021 at 11:03:24AM -0700, Jens Axboe wrote:
> >> Partition table entries are not in disk order.
> >
> > And the issue shows up with the se
Looks good,
Reviewed-by: Christoph Hellwig
Mike, Jens - can we make sure this goes in before branching off the
block branch for 5.12? I have some work pending that would otherwise
conflict.
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
Remove the reverse map from a sector to a partition for I/O accounting by
simply using ->bi_bdev.
Signed-off-by: Christoph Hellwig
Acked-by: Tejun Heo
---
block/blk-core.c | 6 +-
block/blk.h | 2 --
block/genhd.c| 48
3 fi
The block layer already checks for this conditions in bio_check_eod
before calling the driver.
Signed-off-by: Christoph Hellwig
Acked-by: Tejun Heo
---
drivers/s390/block/dcssblk.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block
ay I/O accounting.
Signed-off-by: Christoph Hellwig
Acked-by: Tejun Heo
---
block/blk-core.c | 5 +++--
include/linux/bio.h | 2 ++
include/linux/blk_types.h | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 64f69022
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
The block layer already checks for this conditions in bio_check_eod
before calling the driver.
Signed-off-by: Christoph Hellwig
Acked-by: Tejun Heo
---
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
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
Acked-by: Tejun Heo
---
block/blk-core.c| 23 +--
drivers/md/bcache/request.c | 34 +-
drivers/md/md.c |
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
Acked-by: Tejun Heo
---
block/genhd.c | 27 ++-
drivers/s390/block
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
Acked-by: Tejun Heo
---
block/genhd.c | 37 +++--
include/linux/genhd.h | 1 -
2 files
Merge a few checks for whole devices vs partitions to streamline the
sanity checks.
Signed-off-by: Christoph Hellwig
Acked-by: Tejun Heo
---
block/blk-core.c | 39 ++-
1 file changed, 14 insertions(+), 25 deletions(-)
diff --git a/block/blk-core.c b/block
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
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
Acked-by: Tejun Heo
---
block/blk-settings.c| 2 +-
block/blk.h | 1 -
block
On Sat, Jan 30, 2021 at 03:56:46AM +, Matthew Wilcox wrote:
> On Tue, Jan 26, 2021 at 03:52:34PM +0100, Christoph Hellwig wrote:
> > bio_kmalloc shares almost no logic with the bio_set based fast path
> > in bio_alloc_bioset. Split it into an entirely separate implementation.
Use an on-stack bio and biovec for the single page synchronous I/O.
Signed-off-by: Christoph Hellwig
---
drivers/md/md.c | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index e2b9dbb6e888f6..6a27f52007c871 100644
bio_kmalloc shares almost no logic with the bio_set based fast path
in bio_alloc_bioset. Split it into an entirely separate implementation.
Signed-off-by: Christoph Hellwig
---
block/bio.c | 167 ++--
include/linux/bio.h | 6 +-
2 files changed
Sleeping bio allocations do not fail, which means that injecting an error
into sleeping bio allocations is a little silly.
Signed-off-by: Christoph Hellwig
---
Documentation/filesystems/f2fs.rst | 1 -
fs/f2fs/data.c | 29 -
fs/f2fs/f2fs.h
Use the blkdev_issue_flush helper instead of duplicating it.
Signed-off-by: Christoph Hellwig
---
fs/f2fs/data.c| 3 ++-
fs/f2fs/f2fs.h| 1 -
fs/f2fs/segment.c | 12 +---
3 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index
Just reuse the block_device and sector from the swap_info structure,
just as used by the SWP_SYNCHRONOUS path. Also remove the checks for
NULL returns from bio_alloc as that can't happen for sleeping
allocations.
Signed-off-by: Christoph Hellwig
---
include/linux/swap.h | 1 -
mm/page_io.c
Use bio_alloc instead of open coding it.
Signed-off-by: Christoph Hellwig
---
fs/zonefs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index bec47f2d074beb..faea2ed34b4a37 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
Use bio_kmalloc instead of open coding it.
Signed-off-by: Christoph Hellwig
---
fs/btrfs/volumes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 0a6de859eb2226..584ba093cf4966 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs
Use bio_kmalloc instead of open coding it.
Signed-off-by: Christoph Hellwig
---
block/blk-crypto-fallback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c
index 50c225398e4d60..e8327c50d7c9f4 100644
--- a/block/blk
Hi Jens,
this series contains various cleanups for how bios are allocated or
initialized plus related fallout.
Diffstat:
Documentation/filesystems/f2fs.rst |1
block/bio.c| 167 ++---
block/blk-crypto-fallback.c|2
Given that drbd_md_io_bio_set is initialized during module initialization
and the module fails to load if the initialization fails there is no need
to fall back to plain bio_alloc.
Signed-off-by: Christoph Hellwig
---
drivers/block/drbd/drbd_actlog.c | 2 +-
drivers/block/drbd/drbd_bitmap.c
Refactor raid5_read_one_chunk so that all simple checks are done
before allocating the bio.
Signed-off-by: Christoph Hellwig
---
drivers/md/raid5.c | 108 +++--
1 file changed, 45 insertions(+), 63 deletions(-)
diff --git a/drivers/md/raid5.c b/drivers
md_bio_alloc_sync is never called with a NULL mddev, and ->sync_set is
initialized in md_run, so it always must be initialized as well. Just
open code the remaining call to bio_alloc_bioset.
Signed-off-by: Christoph Hellwig
---
drivers/md/md.c | 10 +-
1 file changed, 1 insertion(+)
bio_alloc never returns NULL when it can sleep.
Signed-off-by: Christoph Hellwig
---
fs/nilfs2/segbuf.c | 4
1 file changed, 4 deletions(-)
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index 1a8729eded8b14..1e75417bfe6e52 100644
--- a/fs/nilfs2/segbuf.c
+++ b/fs/nilfs2/segbuf.c
bio_alloc never returns NULL when it can sleep.
Signed-off-by: Christoph Hellwig
---
fs/nfs/blocklayout/blocklayout.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index 3be6836074ae92..1a96ce28efb026 100644
--- a/fs
There is no point in allocating memory for a synchronous flush.
Signed-off-by: Christoph Hellwig
---
block/blk-flush.c | 17 ++---
drivers/md/dm-zoned-metadata.c| 6 +++---
drivers/md/raid5-ppl.c| 2 +-
drivers/nvme/target/io-cmd-bdev.c | 2 +-
fs
Use blkdev_issue_flush instead of open coding it.
Signed-off-by: Christoph Hellwig
---
drivers/md/dm-clone-target.c | 14 +-
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/md/dm-clone-target.c b/drivers/md/dm-clone-target.c
index bdb255edc20043..a90bdf9b2ca6bd
bio_alloc_mddev is never called with a NULL mddev, and ->bio_set is
initialized in md_run, so it always must be initialized as well. Just
open code the remaining call to bio_alloc_bioset.
Signed-off-by: Christoph Hellwig
---
drivers/md/md.c | 12 +---
drivers/md/md.h |
On Mon, Jan 25, 2021 at 08:13:37PM +0800, Jeffle Xu wrote:
> +int blk_poll(struct request_queue *q, blk_qc_t cookie, bool spin)
Can you split the guts of this function into two separate helpers
for the mq vs non-mq case? As is is is a little hard to read and
introduced extra branches in the fast
1201 - 1300 of 2486 matches
Mail list logo