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
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
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
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
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
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
sector_t is now always a u64, so this check is not needed.
Signed-off-by: Christoph Hellwig
Acked-by: Tejun Heo
Reviewed-by: Jan Kara
---
block/ioctl.c | 9 -
1 file changed, 9 deletions(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index 6b785181344fe1..0c09bb7a6ff35f 100644
Signed-off-by: Christoph Hellwig
Acked-by: Tejun Heo
Reviewed-by: Jan Kara
Reviewed-by: Greg Kroah-Hartman
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
index 46553d6d602563
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
---
block/blk-core.c | 3 ++-
block/genhd.c | 4 ++--
include/linux/blk_types.h | 3 +++
include/linux/genhd.h | 3
Now that struct hd_struct has a block_device pointer use that to
find the disk.
Signed-off-by: Christoph Hellwig
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/linux/genhd.h
index
Use struct block_device to lookup partitions on a disk. This removes
all usage of struct hd_struct from the I/O path, and this allows removing
the percpu refcount in struct hd_struct.
Signed-off-by: Christoph Hellwig
Acked-by: Coly Li [bcache]
Acked-by: Chao Yu
Pass the block_device actually needed instead of looking it up using
bdget_disk.
Signed-off-by: Christoph Hellwig
---
block/genhd.c | 13 +++--
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 89cd0ba8e3b84a..28299b24173be1 100644
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
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
---
block/blk-core.c | 2 +-
block/genhd.c | 8
block/ioctl.c | 2
of struct block_device to keep the lookups contained
in the core block layer code.
Signed-off-by: Christoph Hellwig
Acked-by: Tejun Heo
Acked-by: Coly Li [bcache]
---
block/ioctl.c| 3 +-
drivers/block/loop.c | 8 +-
drivers
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
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 | 57 +++
block/partitions/core.c | 13
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
Pass the block_device actually needed instead of the hd_struct.
Signed-off-by: Christoph Hellwig
---
block/blk.h | 2 +-
block/genhd.c | 14 +++---
block/partitions/core.c | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/block/blk.h b/block
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
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
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
. 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
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
Acked-by: Mike Snitzer
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
Acked-by: Chao Yu [f2fs]
---
drivers/md/dm-core.h | 5 -
drivers/md/dm.c | 20
Move the dkstats and stamp field to struct block_device in preparation
of killing struct hd_struct.
Signed-off-by: Christoph Hellwig
---
block/blk-cgroup.c| 2 +-
block/blk-core.c | 4 ++--
block/blk.h | 1 -
block/genhd.c | 14 --
block
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
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
Move the holder_dir field to struct block_device in preparation for
kill struct hd_struct.
Signed-off-by: Christoph Hellwig
---
block/genhd.c | 5 +++--
block/partitions/core.c | 8
fs/block_dev.c| 11 +--
include/linux/blk_types.h | 1 +
include
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: Johannes Thumshirn
Acked-by: Tejun Heo
---
block/genhd.c | 3 +--
1 file changed, 1 insertion(+), 2
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
This will allow for a more symmetric calling convention going forward.
Signed-off-by: Christoph Hellwig
---
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 86a61a2141f642..d0783c55a0ce65 100644
--- a/fs/block_dev.c
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
On Thu, Nov 26, 2020 at 05:33:41PM +0100, Jan Kara wrote:
> > bdev->bd_contains = whole;
> > - bdev->bd_part = disk_get_part(disk, partno);
> > - if (!(disk->flags & GENHD_FL_UP) ||
> > - !bdev->bd_part ||
On Thu, Nov 26, 2020 at 05:50:36PM +0100, Jan Kara wrote:
> > + if (size == capacity ||
> > + (disk->flags & (GENHD_FL_UP | GENHD_FL_HIDDEN)) != GENHD_FL_UP)
> > + return false;
> > + pr_info("%s: detected capacity change from %lld to %lld\n",
> > + disk->disk_name,
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
---
drivers/block/rbd.c | 19 ---
1 file changed, 19 deletions(-)
diff --git a/drivers
whole-disk device policy. The
current behavior violates the principle of least surprise by 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
---
block/genhd.c | 3 +--
1 file changed, 1
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
Only a single caller can end up in bdev_read_only, so move the check there.
Signed-off-by: Christoph Hellwig
---
block/genhd.c | 3 ---
fs/super.c| 3 ++-
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 09ff6cef028729..c87013879b8650 100644
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 | 5 ++---
1 file changed
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: Hannes Reinecke
---
drivers/md/dm-cache-metadata.c | 2 +-
drivers/md/dm-thin-metadata.c | 2 +-
2 files changed, 2 insertions(+), 2
lla: https://bugzilla.kernel.org/show_bug.cgi?id=201221
Signed-off-by: Christoph Hellwig
Reviewed-by: Hannes Reinecke
---
block/blk-core.c| 2 +-
block/genhd.c | 33 +++--
block/partitions/core.c | 3 +--
include/linux/genhd.h | 6 --
4 files c
So, I'm really worried about:
a) a good use case. GC in f2fs or btrfs seem like good use cases, as
does accelating dm-kcopyd. I agree with Damien that lifting dm-kcopyd
to common code would also be really nice. I'm not 100% sure it should
be a requirement, but it sure would be
Thanks for the report.
Jens, can you revert the series for now? I think waiting any longer
with a report like this is not helpful. I'll look into it with
Qian in the meantime.
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
The block_sleeprq tracepoint was only used by the legacy request code.
Remove it now that the legacy request code is gone.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
---
include/trace/events/block.h | 18 --
kernel/trace
The block_bio_merge tracepoint class can be reused for most bio-based
tracepoints. For that it just needs to lose the superfluous q and rq
parameters.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
---
block/blk-core.c | 2 +-
block
The request_queue can trivially be derived from the bio.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
---
block/blk-core.c | 2 +-
drivers/md/dm.c | 3 +--
drivers/md/md-linear.c| 3 +--
drivers/md/md.c
The request_queue can trivially be derived from the request.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
---
block/blk-merge.c| 2 +-
block/blk-mq-sched.c | 2 +-
block/blk-mq.c | 8 +++
drivers/md/dm-rq.c
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.
Changes since v1:
- a few commit log typo fixes and improvements
Diffstat:
block/blk-core.c |
The request_queue can trivially be derived from the bio.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
---
block/blk-merge.c| 2 +-
drivers/md/dm.c | 2 +-
include/trace/events/block.h | 14 ++
kernel/trace
:
> On Tue, 2020-12-01 at 17:54 +0100, Christoph Hellwig wrote:
> > 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 actua
On Tue, Dec 08, 2020 at 12:27:41AM -0500, Martin K. Petersen wrote:
>
> Christoph,
>
> > The existing behavior is inconsistent in the sense that doing:
> >
> > permits writes. But:
> >
> >
> >
> > doesn't.
> >
> > And a subsequent:
>
> Looks like the command line pieces got zapped from the
On Tue, Dec 08, 2020 at 06:29:23PM +0800, Ming Lei wrote:
> > - test_bit(GD_READ_ONLY, >bd_disk->state);
> > + return bdev->bd_read_only || get_disk_ro(bdev->bd_disk);
> > }
> > EXPORT_SYMBOL(bdev_read_only);
>
> I think this patch should be folded into previous one, otherwise
>
On Tue, Dec 08, 2020 at 06:22:11PM +0800, Ming Lei wrote:
> > int bdev_read_only(struct block_device *bdev)
> > {
> > - return bdev->bd_read_only;
> > + return bdev->bd_read_only ||
> > + test_bit(GD_READ_ONLY, >bd_disk->state);
> > }
> > EXPORT_SYMBOL(bdev_read_only);
>
> Maybe
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
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
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
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
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
sector_t is now always a u64, so this check is not needed.
Signed-off-by: Christoph Hellwig
---
block/ioctl.c | 9 -
1 file changed, 9 deletions(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index 6b785181344fe1..0c09bb7a6ff35f 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -35,15
Signed-off-by: Christoph Hellwig
Reviewed-by: Greg Kroah-Hartman
Reviewed-by: Jan Kara
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
index 46553d6d602563..22f5b9fd96f8bf 100644
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
---
fs/block_dev.c | 26 ++
1
media.
Signed-off-by: Christoph Hellwig
---
block/blk-cgroup.c | 42 +++---
block/blk-iocost.c | 36
include/linux/blk-cgroup.h | 4 ++--
3 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/block/blk
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
---
block/genhd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
Now that struct hd_struct has a block_device pointer use that to
find the disk.
Signed-off-by: Christoph Hellwig
---
include/linux/genhd.h | 10 +++---
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index d068e46f9086ae
Use struct block_device to lookup partitions on a disk. This removes
all usage of struct hd_struct from the I/O path, and this allows removing
the percpu refcount in struct hd_struct.
Signed-off-by: Christoph Hellwig
---
block/bio.c| 4 +-
block/blk-core.c
Pass the block_device actually needed instead of the hd_struct.
Signed-off-by: Christoph Hellwig
---
block/blk.h | 2 +-
block/genhd.c | 14 +++---
block/partitions/core.c | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/block/blk.h b/block
We can just dereference the point in struct gendisk instead. Also
remove the now unused export.
Signed-off-by: Christoph Hellwig
Reviewed-by: Greg Kroah-Hartman
Reviewed-by: Jan Kara
---
block/genhd.c | 1 -
drivers/block/nbd.c | 4 +---
drivers/block/xen
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
---
block/blk-core.c | 2 +-
block/genhd.c | 8
block/ioctl.c | 2
Move the dkstats and stamp field to struct block_device in preparation
of killing struct hd_struct.
Signed-off-by: Christoph Hellwig
---
block/blk-cgroup.c| 2 +-
block/blk-core.c | 4 ++--
block/blk.h | 1 -
block/genhd.c | 14 --
block
Pass the block_device actually needed instead of looking it up using
bdget_disk.
Signed-off-by: Christoph Hellwig
---
block/genhd.c | 13 +++--
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 498c816e90df64..2985740eab084b 100644
. 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
, 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/blk-cgroup.c| 9 ++-
block
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/bcache/super.c| 20 +-
drivers/md/dm
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 | 13 ++---
1 file changed, 6 insertions(+), 7 deletions(-)
diff -
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
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
, similar to what we do with normal
file operations.
Signed-off-by: Christoph Hellwig
---
fs/block_dev.c | 185 +++--
1 file changed, 86 insertions(+), 99 deletions(-)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 88847839ef0102..2ffa11a95f10db 100644
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
---
drivers/block/loop.c | 12 +-
fs/block_dev.c | 51
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: Johannes Thumshirn
---
block/genhd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff
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
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: Johannes Thumshirn
Acked-by: Tejun Heo
---
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
Acked-by: Mike Snitzer
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
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: Johannes Thumshirn
---
drivers/md/bcache/super.c | 7 ++-
drivers/md/md.c | 4 +---
fs/block_dev.c
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
---
drivers/md/dm-core.h | 5 -
drivers/md/dm.c | 20 ++--
fs/block_dev.c
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
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
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
---
fs/block_dev.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/fs
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
---
init/do_mounts.c | 68 ++--
1 file changed
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
---
init/do_mounts.c | 18 ++
1 file changed, 6 insertions(+), 12
Just call devcgroup_check_permission to avoid various superflous checks
and a double conversion of the access flags.
Signed-off-by: Christoph Hellwig
---
fs/block_dev.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index
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
Move the partition_meta_info to struct block_device in preparation for
killing struct hd_struct.
Signed-off-by: Christoph Hellwig
---
block/blk.h | 1 -
block/genhd.c | 3 ++-
block/partitions/core.c | 18 +++---
fs/block_dev.c| 1
Move the holder_dir field to struct block_device in preparation for
kill struct hd_struct.
Signed-off-by: Christoph Hellwig
---
block/genhd.c | 5 +++--
block/partitions/core.c | 8
fs/block_dev.c| 11 +--
include/linux/blk_types.h | 1 +
include
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
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
---
block/blk-core.c | 3 ++-
block/genhd.c | 4 ++--
include/linux/blk_types.h | 3 +++
include/linux/genhd.h | 3
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 | 57 +++
block/partitions/core.c | 13
901 - 1000 of 2486 matches
Mail list logo