Move all the logic to limit the discard bio size into a common helper
so that it is better documented.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
Acked-by: Coly Li
---
block/blk-lib.c | 59 -
block/blk.h | 14
No need to inline these fairly larger helpers. Also fix the return value
to be unsigned, just like the field in struct queue_limits.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
block/blk-settings.c | 35 +++
include/linux/blkdev.h
Use the bdev based alignment helper instead of open coding it.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
block/partitions/core.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/block/partitions/core.c b/block/partitions/core.c
index
No need to inline these fairly larger helpers.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
block/blk-settings.c | 23 +++
include/linux/blkdev.h | 21 +
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/block/blk
Just use bdev_alignment_offset in disk_discard_alignment_show instead.
That helpers is the same except for an always false branch that doesn't
matter in this slow path.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
block/genhd.c | 2 +-
include/linux/blk
This does the same as the open coded variant except for an extra branch,
and allows to remove queue_alignment_offset entirely.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8
2 files changed, 1 insertion
Replace the open coded offset calculation with the proper helper.
This is an ABI change in that the -1 for a misaligned partition is
properly propagated, which can be considered a bug fix and matches
what is done on the whole device.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K
Add a helper to check the max supported sectors for zone append based on
the block_device instead of having to poke into the block layer internal
request_queue.
Signed-off-by: Christoph Hellwig
Acked-by: Damien Le Moal
Reviewed-by: Martin K. Petersen
Reviewed-by: Johannes Thumshirn
Add a helper to check the stable writes flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
drivers/md/dm-table.c | 4 +---
fs/super.c | 2 +-
include/linux
Add a helper to check the FUA flag based on the block_device instead of
having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
drivers/block/rnbd/rnbd-srv.c | 3 +--
drivers/target/target_core_iblock.c | 3 +--
fs
Add a helper to check the write cache flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
Acked-by: David Sterba [btrfs]
---
drivers/block/rnbd/rnbd-srv.c | 2 +-
drivers
Add a helper to check the nonrot flag based on the block_device instead
of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
Acked-by: David Sterba [btrfs]
---
block/ioctl.c | 2 +-
drivers/block
Use the bdev based helper instead of poking into the queue.
Signed-off-by: Christoph Hellwig
---
mm/swapfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 63c61f8b26118..4c7537162af5e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
Signed-off-by: Christoph Hellwig
Reviewed-by: Johannes Thumshirn
---
fs/ntfs3/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 278dcf5024102..cd30e81abbce0 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -920,7 +920,7
Signed-off-by: Christoph Hellwig
Reviewed-by: Johannes Thumshirn
---
fs/btrfs/zoned.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 1b1b310c3c510..f72cad7391a11 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -350,7
Sanitize the calling conventions and use a goto label to cleanup the
code flow.
Signed-off-by: Christoph Hellwig
Acked-by: Christoph Böhmwalder
---
drivers/block/drbd/drbd_nl.c | 68 +++-
1 file changed, 35 insertions(+), 33 deletions(-)
diff --git a/drivers
The bdev version does the right thing for partitions, so use that.
Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support")
Signed-off-by: Christoph Hellwig
Acked-by: Christoph Böhmwalder
---
drivers/block/drbd/drbd_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
di
Use the bdev based limits helpers where they exist.
Signed-off-by: Christoph Hellwig
Acked-by: Christoph Böhmwalder
---
drivers/block/drbd/drbd_main.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd
Fold each branch into its only caller.
Signed-off-by: Christoph Hellwig
---
drivers/block/drbd/drbd_main.c | 47 +++---
1 file changed, 20 insertions(+), 27 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 9676a1d214bc5
Use the proper bdev_discard_alignment helper that accounts for partition
offsets.
Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
drivers/target/target_core_device.c | 4 ++--
1 file
The SCSI target drivers is a consumer of the block layer and shoul
d generally work on struct block_device.
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
drivers/target/target_core_device.c | 5 +++--
drivers/target/target_core_file.c| 7 ---
drivers/target
block: Convert WRITE_SAME to
blkdev_issue_zeroout")
Signed-off-by: Christoph Hellwig
Reviewed-by: Martin K. Petersen
---
drivers/target/target_core_device.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/target/target_core_device.c
b/drivers/target/target_core_device.c
index 44b
Hi Jens,
this series cleanups up the block layer API so that APIs consumed
by file systems are (almost) only struct block_devic based, so that
file systems don't have to poke into block layer internals like the
request_queue.
I also found a bunch of existing bugs related to partition offsets
and
On Thu, Apr 07, 2022 at 04:17:11PM +0100, Robin Murphy wrote:
>> My take is that the drivers using this API are doing it to make sure
>> their HW blocks are setup in a way that is consistent with the DMA API
>> they are also using, and run in constrained embedded-style
>> environments that know the
On Thu, Apr 07, 2022 at 05:20:49PM +0200, David Sterba wrote:
> On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> > Signed-off-by: Christoph Hellwig
>
> As it's a standalone patch I can take it (possibly with other similar
> prep btrfs patches) in curre
On Wed, Apr 06, 2022 at 01:06:23PM -0300, Jason Gunthorpe wrote:
> On Wed, Apr 06, 2022 at 05:50:56PM +0200, Christoph Hellwig wrote:
> > On Wed, Apr 06, 2022 at 12:18:23PM -0300, Jason Gunthorpe wrote:
> > > > Oh, I didn't know about device_get_dma_attr()..
> >
&g
On Wed, Apr 06, 2022 at 12:18:23PM -0300, Jason Gunthorpe wrote:
> > Oh, I didn't know about device_get_dma_attr()..
Which is completely broken for any non-OF, non-ACPI plaform.
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
ht
On Wed, Apr 06, 2022 at 11:14:46AM -0300, Jason Gunthorpe wrote:
> Really? It is the only condition that dma_info_to_prot() tests to
> decide of IOMMU_CACHE is used or not, so you are saying that there is
> a condition where a device can be attached to an iommu_domain and
> dev_is_dma_coherent() re
On Wed, Apr 06, 2022 at 09:07:30AM -0300, Jason Gunthorpe wrote:
> Didn't see it
>
> I'll move dev_is_dma_coherent to device.h along with
> device_iommu_mapped() and others then
No. It it is internal for a reason. It also doesn't actually work
outside of the dma core. E.g. for non-swiotlb ARM
Randomly poking into block device internals for manual prefetches isn't
exactly a very maintainable thing to do. And none of the performance
criticil direct I/O implementations still use this library function
anyway, so just drop it.
Signed-off-by: Christoph Hellwig
---
fs/direct-io.c
Secure erase is a very different operation from discard in that it is
a data integrity operation vs hint. Fully split the limits and helper
infrastructure to make the separation more clear.
Signed-off-by: Christoph Hellwig
---
block/blk-core.c| 2 +-
block/blk-lib.c
Abstract away implementation details from file systems by providing a
block_device based helper to retreive the discard granularity.
Signed-off-by: Christoph Hellwig
---
block/blk-lib.c | 5 ++---
drivers/block/drbd/drbd_nl.c| 9 +
drivers/block/drbd
allow for it.
Signed-off-by: Christoph Hellwig
---
arch/um/drivers/ubd_kern.c| 2 --
block/blk-mq-debugfs.c| 1 -
drivers/block/drbd/drbd_nl.c | 15 ---
drivers/block/loop.c | 2 --
drivers/block/nbd.c | 3 ---
drivers/block/null_blk/main.c | 1
-by: Christoph Hellwig
---
block/blk-core.c| 2 +-
block/blk-lib.c | 2 +-
block/ioctl.c | 3 +--
drivers/block/drbd/drbd_main.c | 2 +-
drivers/block/drbd/drbd_nl.c| 12 +++-
drivers/block/drbd/drbd_receiver.c
Move all the logic to limit the discard bio size into a common helper
so that it is better documented.
Signed-off-by: Christoph Hellwig
---
block/blk-lib.c | 59 -
block/blk.h | 14
2 files changed, 29 insertions(+), 44 deletions
No need to inline these fairly larger helpers. Also fix the return value
to be unsigned, just like the field in struct queue_limits.
Signed-off-by: Christoph Hellwig
---
block/blk-settings.c | 35 +++
include/linux/blkdev.h | 34
Use the bdev based alignment helper instead of open coding it.
Signed-off-by: Christoph Hellwig
---
block/partitions/core.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 240b3fff521e4..70dec1c78521d 100644
--- a
Just use bdev_alignment_offset in disk_discard_alignment_show instead.
That helpers is the same except for an always false branch that doesn't
matter in this slow path.
Signed-off-by: Christoph Hellwig
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8
2 files chang
No need to inline these fairly larger helpers.
Signed-off-by: Christoph Hellwig
---
block/blk-settings.c | 23 +++
include/linux/blkdev.h | 21 +
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/block/blk-settings.c b/block/blk
This does the same as the open coded variant except for an extra branch,
and allows to remove queue_alignment_offset entirely.
Signed-off-by: Christoph Hellwig
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a
Replace the open coded offset calculation with the proper helper.
This is an ABI change in that the -1 for a misaligned partition is
properly propagated, which can be considered a bug fix and maches
what is done on the whole device.
Signed-off-by: Christoph Hellwig
---
block/partitions/core.c
The bdev version does the right thing for partitions, so use that.
Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support")
Signed-off-by: Christoph Hellwig
---
drivers/block/drbd/drbd_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/drbd/drb
Add a helper to check the max supported sectors for zone append based on
the block_device instead of having to poke into the block layer internal
request_queue.
Signed-off-by: Christoph Hellwig
---
drivers/nvme/target/zns.c | 3 +--
fs/zonefs/super.c | 3 +--
include/linux/blkdev.h
Add a helper to check the stable writes flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig
---
drivers/md/dm-table.c | 4 +---
fs/super.c | 2 +-
include/linux/blkdev.h | 6 ++
mm/swapfile.c
Add a helper to check the FUA flag based on the block_device instead of
having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig
---
drivers/block/rnbd/rnbd-srv.c | 3 +--
drivers/target/target_core_iblock.c | 3 +--
fs/iomap/direct-io.c
Add a helper to check the write cache flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig
---
drivers/block/rnbd/rnbd-srv.c | 2 +-
drivers/block/xen-blkback/xenbus.c | 2 +-
drivers/target
Add a helper to check the nonrot flag based on the block_device instead
of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig
---
block/ioctl.c | 2 +-
drivers/block/loop.c| 2 +-
drivers/md/dm-table.c
Use the bdev based helper instead of poking into the queue.
Signed-off-by: Christoph Hellwig
---
mm/swapfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 63c61f8b26118..4c7537162af5e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
Signed-off-by: Christoph Hellwig
---
fs/ntfs3/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 278dcf5024102..cd30e81abbce0 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -920,7 +920,7 @@ static int ntfs_fill_super
Signed-off-by: Christoph Hellwig
---
fs/btrfs/zoned.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index b7b5fac1c7790..5b85004d85d6c 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -350,7 +350,6 @@ int btrfs_get_dev_zone_info
Sanitize the calling conventions and use a goto label to cleanup the
code flow.
Signed-off-by: Christoph Hellwig
---
drivers/block/drbd/drbd_nl.c | 68 +++-
1 file changed, 35 insertions(+), 33 deletions(-)
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers
Use the bdev based limits helpers where they exist.
Signed-off-by: Christoph Hellwig
---
drivers/block/drbd/drbd_main.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 74b1b2424efff
Use the proper bdev_discard_alignment helper that accounts for partition
offsets.
Fіxes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Signed-off-by: Christoph Hellwig
---
drivers/target/target_core_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Fold each branch into its only caller.
Signed-off-by: Christoph Hellwig
---
drivers/block/drbd/drbd_main.c | 50 --
1 file changed, 23 insertions(+), 27 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 9676a1d214bc5
The target code is a consumer of the block layer and should generally
work on struct block_device.
Signed-off-by: Christoph Hellwig
---
drivers/target/target_core_device.c | 5 +++--
drivers/target/target_core_file.c| 7 ---
drivers/target/target_core_iblock.c | 2 +-
include/target
nvert WRITE_SAME to
blkdev_issue_zeroout")
Signed-off-by: Christoph Hellwig
---
drivers/target/target_core_device.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/target/target_core_device.c
b/drivers/target/target_core_device.c
index 44bb380e7390c..fa866acef5bb2 100644
--- a/driv
Hi Jens,
this series cleanups up the block layer API so that APIs consumed
by file systems are (almost) only struct block_devic based, so that
file systems don't have to poke into block layer internals like the
request_queue.
I also found a bunch of existing bugs related to partition offsets
and
On Tue, Apr 05, 2022 at 01:16:00PM -0300, Jason Gunthorpe wrote:
> diff --git a/drivers/infiniband/hw/usnic/usnic_uiom.c
> b/drivers/infiniband/hw/usnic/usnic_uiom.c
> index 760b254ba42d6b..24d118198ac756 100644
> --- a/drivers/infiniband/hw/usnic/usnic_uiom.c
> +++ b/drivers/infiniband/hw/usnic/u
Looks good:
Reviewed-by: Christoph Hellwig
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
ld have just done a "positive" check here as that is ab it
easier to read:
if (i == HCTX_TYPE_POLL)
blk_mq_map_queues(&set->map[i]);
else
blk_mq_virtio_map_queues(&set->map[i], vblk->vdev, 0);
Otherwise looks good:
Reviewed-by:
On Tue, Apr 05, 2022 at 02:31:22PM +0900, Suwan Kim wrote:
> This patch supports mq_ops->queue_rqs() hook. It has an advantage of
> batch submission to virtio-blk driver. It also helps polling I/O because
> polling uses batched completion of block layer. Batch submission in
> queue_rqs() can boost
On Tue, Apr 05, 2022 at 02:31:21PM +0900, Suwan Kim wrote:
> This patch supports polling I/O via virtio-blk driver. Polling
> feature is enabled by module parameter "num_poll_queues" and it
> sets dedicated polling queues for virtio-blk. This patch improves
> the polling I/O throughput and latency.
On Tue, Apr 05, 2022 at 08:29:36AM +0200, Arnd Bergmann wrote:
> I think the users all have their own copies, at least the ones I could
> find on codesearch.debian.org. However, there are 27 virtio_*.h
> files in include/uapi/linux that probably should stay together for
> the purpose of defining th
Looks good,
Reviewed-by: Christoph Hellwig
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
On Wed, Feb 23, 2022 at 09:36:27PM +0800, Xie Yongji wrote:
> Currently we have a BUG_ON() to make sure the number of sg list
> does not exceed queue_max_segments() in virtio_queue_rq().
> However, the block layer uses queue_max_discard_segments()
> instead of queue_max_segments() to limit the sg l
Using local kmaps slightly reduces the chances to stray writes, and
the bvec interface cleans up the code a little bit.
Signed-off-by: Christoph Hellwig
---
drivers/vhost/vringh.c | 18 --
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/vhost/vringh.c b
On Fri, Feb 18, 2022 at 06:41:52PM +, Melanie Plageman (Microsoft) wrote:
> Currently a single blk_mq_tag_set is associated with a Scsi_Host. When SCSI
> controllers are limited, attaching multiple devices to the same controller is
> required. In cloud environments with relatively high latency
Implement the ->free_disk method to free the virtio_blk structure only
once the last gendisk reference goes away instead of keeping a local
refcount.
Signed-off-by: Christoph Hellwig
Reviewed-by: Stefan Hajnoczi
Acked-by: Michael S. Tsirkin
---
drivers/block/virtio_blk.c |
Implement the ->free_disk method to free the msb_data structure only once
the last gendisk reference goes away instead of keeping a local
refcount.
Signed-off-by: Christoph Hellwig
---
drivers/memstick/core/mspro_block.c | 49 +
1 file changed, 7 insertions(+),
is only called after a successful
call to add_disk, which significantly simplifies the error handling path
during probing.
Signed-off-by: Christoph Hellwig
---
block/genhd.c | 5 +
include/linux/blkdev.h | 2 ++
2 files changed, 7 insertions(+)
diff --git a/block/genhd.c b/bl
Use set_disk_ro to propagate the read-only state to the block layer
instead of checking for it in ->open and leaking a reference in case
of a read-only device.
Signed-off-by: Christoph Hellwig
---
drivers/memstick/core/mspro_block.c | 10 --
1 file changed, 4 insertions(+), 6 deleti
Implement the ->free_disk method to free the msb_data structure only once
the last gendisk reference goes away instead of keeping a local refcount.
Signed-off-by: Christoph Hellwig
---
drivers/memstick/core/ms_block.c | 64
drivers/memstick/core/ms_block.h |
Hi Jens,
this series adds a ->free_disk method to struct block_device_operation so that
drivers can defer freeing their disk private data until the gendisk goes away
and don't need to play games with the validity of ->private_data.
This also converts three simple drivers over as example, but even
> +int
> +isolate_single_pageblock(unsigned long boundary_pfn, gfp_t gfp_flags, int
> isolate_before_boundary);
Please avoid the completely unreadably long line. i.e.
int isolate_single_pageblock(unsigned long boundary_pfn, gfp_t gfp_flags,
int isolate_before_boundary);
Same in
Implement the ->free_disk method to free the virtio_blk structure only
once the last gendisk reference goes away instead of keeping a local
refcount.
Signed-off-by: Christoph Hellwig
---
drivers/block/virtio_blk.c | 74 +++---
1 file changed, 21 insertions(+),
Implement the ->free_disk method to free the msb_data structure only once
the last gendisk reference goes away instead of keeping a local refcount.
Signed-off-by: Christoph Hellwig
---
drivers/memstick/core/ms_block.c | 64
drivers/memstick/core/ms_block.h |
Implement the ->free_disk method to free the msb_data structure only once
the last gendisk reference goes away instead of keeping a local
refcount.
Signed-off-by: Christoph Hellwig
---
drivers/memstick/core/mspro_block.c | 49 +
1 file changed, 7 insertions(+),
Use set_disk_ro to propagate the read-only state to the block layer
instead of checking for it in ->open and leaking a reference in case
of a read-only device.
Signed-off-by: Christoph Hellwig
---
drivers/memstick/core/mspro_block.c | 10 --
1 file changed, 4 insertions(+), 6 deleti
Hi Jens,
this series adds a ->free_disk method to struct block_device_operation so that
drivers can defer freeing their disk private data until the gendisk goes away
and don't need to play games with the validity of ->private_data.
This also converts three simple drivers over as example, but even
Add a method to notify the driver that the gendisk is about to be freed.
This allows drivers to tie the lifetime of their private data to that of
the gendisk and thus deal with device removal races without expensive
synchronization and boilerplate code.
Signed-off-by: Christoph Hellwig
On Thu, Feb 03, 2022 at 09:15:53AM +, Stefan Hajnoczi wrote:
> /* Make sure no work handler is accessing the device. */
> flush_work(&vblk->config_work);
>
> del_gendisk(vblk->disk);
> blk_cleanup_disk(vblk->disk);
> ^--- is virtblk_fre
Use set_disk_ro to propagate the read-only state to the block layer
instead of checking for it in ->open and leaking a reference in case
of a read-only device.
Signed-off-by: Christoph Hellwig
---
drivers/memstick/core/mspro_block.c | 10 --
1 file changed, 4 insertions(+), 6 deleti
Implement the ->free_disk method to free the msb_data structure only once
the last gendisk reference goes away instead of keeping a local
refcount.
Signed-off-by: Christoph Hellwig
---
drivers/memstick/core/mspro_block.c | 49 +
1 file changed, 7 insertions(+),
Implement the ->free_disk method to free the msb_data structure only once
the last gendisk reference goes away instead of keeping a local refcount.
Signed-off-by: Christoph Hellwig
---
drivers/memstick/core/ms_block.c | 64
drivers/memstick/core/ms_block.h |
Implement the ->free_disk method to free the virtio_blk structure only
once the last gendisk reference goes away instead of keeping a local
refcount.
Signed-off-by: Christoph Hellwig
---
drivers/block/virtio_blk.c | 64 +++---
1 file changed, 12 insertions(+),
Add a method to notify the driver that the gendisk is about to be freed.
This allows drivers to tie the lifetime of their private data to that of
the gendisk and thus deal with device removal races without expensive
synchronization and boilerplate code.
Signed-off-by: Christoph Hellwig
Hi Jens,
this series adds a ->free_disk method to struct block_device_operation so that
drivers can defer freeing their disk private data until the gendisk goes away
and don't need to play games with the validity of ->private_data.
This also converts three simple drivers over as example, but even
Remove the DAXDEV_F_SYNC flag and thus the flags argument to alloc_dax and
just let the drivers call set_dax_synchronous directly.
Signed-off-by: Christoph Hellwig
Reviewed-by: Pankaj Gupta
Reviewed-by: Dan Williams
---
drivers/dax/bus.c| 3 ++-
drivers/dax/super.c | 6
remove indirect call from the read/write fast path
as well as a lot of boilerplate code.
Signed-off-by: Christoph Hellwig
Reviewed-by: Vivek Goyal [virtiofs]
---
drivers/dax/bus.c | 2 +
drivers/dax/super.c | 36 ++--
drivers/md/dm-linear.c| 20
Remove the pointless wrappers.
Signed-off-by: Christoph Hellwig
Reviewed-by: Pankaj Gupta
Reviewed-by: Dan Williams
---
drivers/dax/super.c | 8
include/linux/dax.h | 12 ++--
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/drivers/dax/super.c b/drivers/dax
These two wrappers are never used.
Signed-off-by: Christoph Hellwig
---
drivers/nvdimm/pmem.c | 4 +---
include/linux/uio.h | 20 +---
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 4190c8c46ca88
Hi Dan,
this series cleans up a few loose end ends and then removes the
copy_from_iter and copy_to_iter dax_operations methods in favor of
straight calls.
Changes since v1:
- reword a 'no check' comment
- clean up the flags for the copy routine variants
- drop the last patch
Diffstat:
driver
On Sun, Dec 12, 2021 at 06:22:20AM -0800, Dan Williams wrote:
> > - * Use the 'no check' versions of copy_from_iter_flushcache() and
> > - * copy_mc_to_iter() to bypass HARDENED_USERCOPY overhead. Bounds
> > + * Use the 'no check' versions of _copy_from_iter_flushcache() and
> > + * _copy_mc_to_ite
On Sun, Dec 12, 2021 at 06:39:16AM -0800, Dan Williams wrote:
> > /* flag to check if device supports synchronous flush */
> > DAXDEV_SYNC,
> > + /* do not use uncached operations to write data */
> > + DAXDEV_CACHED,
> > + /* do not use mcsafe operations to read d
On Sun, Dec 12, 2021 at 06:44:26AM -0800, Dan Williams wrote:
> On Fri, Dec 10, 2021 at 6:17 AM Vivek Goyal wrote:
> > Going forward, I am wondering should virtiofs use flushcache version as
> > well. What if host filesystem is using DAX and mapping persistent memory
> > pfn directly into qemu add
On Sun, Dec 12, 2021 at 06:48:05AM -0800, Dan Williams wrote:
> On Fri, Dec 10, 2021 at 6:05 AM Vivek Goyal wrote:
> >
> > On Thu, Dec 09, 2021 at 07:38:28AM +0100, Christoph Hellwig wrote:
> > > While using the MC-safe copy routines is rather pointless on a virtual
, then use them everywhere as they fall back to the plain
ones on s390 anyway and remove an indirect call from the read/write path
as well as a lot of boilerplate code.
Signed-off-by: Christoph Hellwig
---
drivers/dax/super.c | 36 ++--
drivers/md/dm-linear.c| 20
These two wrappers are never used.
Signed-off-by: Christoph Hellwig
---
drivers/nvdimm/pmem.c | 4 ++--
include/linux/uio.h | 20 +---
2 files changed, 3 insertions(+), 21 deletions(-)
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 4190c8c46ca88
Remove the DAXDEV_F_SYNC flag and thus the flags argument to alloc_dax and
just let the drivers call set_dax_synchronous directly.
Signed-off-by: Christoph Hellwig
---
drivers/dax/bus.c| 3 ++-
drivers/dax/super.c | 6 +-
drivers/md/dm.c | 2 +-
drivers
While using the MC-safe copy routines is rather pointless on a virtual device
like virtiofs, it also isn't harmful at all. So just use _copy_mc_to_iter
unconditionally to simplify the code.
Signed-off-by: Christoph Hellwig
---
drivers/dax/super.c | 10 --
fs/fuse/virtio_fs.c
201 - 300 of 935 matches
Mail list logo