add a bvec_virt helper

2021-08-04 Thread Christoph Hellwig
Hi Jens, this series adds a bvec_virt helper to return the virtual address of the data in bvec to replace the open coded calculation, and as a reminder that generall bio/bvec data can be in high memory unless it is caller controller or in an architecture specific driver where highmem is

[PATCH 08/15] virtio_blk: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/block/virtio_blk.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 4b49df2dfd23..767b4f72a54d 100644 --- a/drivers/block

[PATCH 07/15] rbd: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. 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/drivers/block/rbd.c index 6d596c2c2cd6..e65c9d706f6f 100644 --- a/drivers/block/rbd.c +++ b/drivers/block

[PATCH 06/15] squashfs: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- fs/squashfs/block.c| 7 +++ fs/squashfs/lz4_wrapper.c | 2 +- fs/squashfs/lzo_wrapper.c | 2 +- fs/squashfs/xz_wrapper.c | 2 +- fs/squashfs/zlib_wrapper.c | 2 +- fs/squashfs/zstd_wrapper.c | 2 +- 6

[PATCH 13/15] dasd: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/s390/block/dasd_diag.c | 2 +- drivers/s390/block/dasd_eckd.c | 14 +++--- drivers/s390/block/dasd_fba.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/s390/block

[PATCH 14/15] dcssblk: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/s390/block/dcssblk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 29180bdf0977..5be3d1c39a78 100644 --- a/drivers/s390

[PATCH 05/15] dm-integrity: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/md/dm-integrity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 20f2510db1f6..a9ea361769a7 100644 --- a/drivers/md/dm

[PATCH 02/15] block: use bvec_virt in bio_integrity_{process,free}

2021-08-04 Thread Christoph Hellwig
Use the bvec_virt helper to clean up the bio integrity processing a little bit. Signed-off-by: Christoph Hellwig --- block/bio-integrity.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 8f54d49dc500..6b47cddbbca1

[PATCH 12/15] ps3vram: use bvec_virt

2021-08-04 Thread Christoph Hellwig
Use bvec_virt instead of open coding it. Signed-off-by: Christoph Hellwig --- drivers/block/ps3vram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c index 7fbf469651c4..c7b19e128b03 100644 --- a/drivers/block/ps3vram.c +++ b

Re: [PATCH v5 12/16] PCI: Add pci_iomap_host_shared(), pci_iomap_host_shared_range()

2021-10-11 Thread Christoph Hellwig
On Mon, Oct 11, 2021 at 03:09:09PM -0400, Michael S. Tsirkin wrote: > The reason we have trouble is that it's not clear what does the API mean > outside the realm of TDX. > If we really, truly want an API that says "ioremap and it's a hardened > driver" then I guess ioremap_hardened_driver is what

Re: [PATCH V4 0/8] Use copy_process/create_io_thread in vhost layer

2021-10-12 Thread Christoph Hellwig
The whole series looks good to me: Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 06/11] xfs: factor out a xfs_setup_dax helper

2021-10-19 Thread Christoph Hellwig
On Mon, Oct 18, 2021 at 09:43:51AM -0700, Darrick J. Wong wrote: > > --- a/fs/xfs/xfs_super.c > > +++ b/fs/xfs/xfs_super.c > > @@ -339,6 +339,32 @@ xfs_buftarg_is_dax( > > bdev_nr_sectors(bt->bt_bdev)); > > } > > > > +static int > > +xfs_setup_dax( > > /me wonders if this

Re: [PATCH v5 12/16] PCI: Add pci_iomap_host_shared(), pci_iomap_host_shared_range()

2021-10-11 Thread Christoph Hellwig
Just as last time: This does not make any sense. ioremap is shared by definition. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v5] virtio-blk: Add validation for block size in config space

2021-10-11 Thread Christoph Hellwig
On Tue, Oct 05, 2021 at 06:42:43AM -0400, Michael S. Tsirkin wrote: > Stefan also pointed out this duplicates the logic from > > if (blksize < 512 || blksize > PAGE_SIZE || !is_power_of_2(blksize)) > return -EINVAL; > > > and a bunch of other places. > > > Would it be

[PATCH 08/11] dm-linear: add a linear_dax_pgoff helper

2021-10-17 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig --- drivers/md/dm-linear.c | 49

[PATCH 07/11] dax: remove dax_capable

2021-10-17 Thread Christoph Hellwig
Just open code the block size and dax_dev == NULL checks in the callers. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 36 drivers/md/dm-table.c| 22 +++--- drivers/md/dm.c | 21

[PATCH 06/11] xfs: factor out a xfs_setup_dax helper

2021-10-17 Thread Christoph Hellwig
Factor out another DAX setup helper to simplify future changes. Also move the experimental warning after the checks to not clutter the log too much if the setup failed. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_super.c | 47 +++--- 1 file changed

[PATCH 02/11] dax: remove CONFIG_DAX_DRIVER

2021-10-17 Thread Christoph Hellwig
CONFIG_DAX_DRIVER only selects CONFIG_DAX now, so remove it. Signed-off-by: Christoph Hellwig --- drivers/dax/Kconfig| 4 drivers/nvdimm/Kconfig | 2 +- drivers/s390/block/Kconfig | 2 +- fs/fuse/Kconfig| 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff

futher decouple DAX from block devices

2021-10-17 Thread Christoph Hellwig
Hi Dan, this series cleans up and simplifies the association between DAX and block devices in preparation of allowing to mount file systems directly on DAX devices without a detour through block devices. Diffstat: drivers/dax/Kconfig |4 drivers/dax/bus.c|2

[PATCH 01/11] dm: make the DAX support dependend on CONFIG_FS_DAX

2021-10-17 Thread Christoph Hellwig
The device mapper DAX support is all hanging off a block device and thus can't be used with device dax. Make it depend on CONFIG_FS_DAX instead of CONFIG_DAX_DRIVER. This also means that bdev_dax_pgoff only needs to be built under CONFIG_FS_DAX now. Signed-off-by: Christoph Hellwig

[PATCH 04/11] dax: remove the pgmap sanity checks in generic_fsdax_supported

2021-10-17 Thread Christoph Hellwig
Drivers that register a dax_dev should make sure it works, no need to double check from the file system. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 49 + 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/drivers/dax/super.c

[PATCH 05/11] dax: move the partition alignment check into fs_dax_get_by_bdev

2021-10-17 Thread Christoph Hellwig
fs_dax_get_by_bdev is the primary interface to find a dax device for a block device, so move the partition alignment check there instead of wiring it up through ->dax_supported. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 23 ++- 1 file changed, 6 inserti

[PATCH 03/11] dax: simplify the dax_device <-> gendisk association

2021-10-17 Thread Christoph Hellwig
Replace the dax_host_hash with an xarray indexed by the pointer value of the gendisk, and require explicitl calls from the block drivers that want to associate their gendisk with a dax_device. Signed-off-by: Christoph Hellwig --- drivers/dax/bus.c| 2 +- drivers/dax/super.c

[PATCH 09/11] dm-log-writes: add a log_writes_dax_pgoff helper

2021-10-17 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig --- drivers/md/dm-log-writes.c | 42

[PATCH 10/11] dm-stripe: add a stripe_dax_pgoff helper

2021-10-17 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig --- drivers/md/dm-stripe.c | 63

[PATCH 11/11] dax: move bdev_dax_pgoff to fs/dax.c

2021-10-17 Thread Christoph Hellwig
No functional changet, but this will allow for a tighter integration with the iomap code, including possible passing the partition offset in the iomap in the future. For now it mostly avoids growing more callers outside of fs/dax.c. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 14

Re: [PATCH 1/1] virtio-blk: avoid preallocating big SGL for data

2021-09-27 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 1/1] virtio-blk: avoid preallocating big SGL for data

2021-09-27 Thread Christoph Hellwig
On Mon, Sep 27, 2021 at 12:53:14PM +0100, Christoph Hellwig wrote: > Looks good, > > Reviewed-by: Christoph Hellwig Err, sorry. This was supposed to go to the lastest iteration, I'll add it there. ___ Virtualization mailing list Virtu

Re: [PATCH v3 1/1] virtio-blk: avoid preallocating big SGL for data

2021-09-27 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 1/1] virtio-blk: add num_io_queues module parameter

2021-08-30 Thread Christoph Hellwig
On Mon, Aug 30, 2021 at 03:00:23PM +0300, Max Gurtovoy wrote: > +static int virtblk_queue_count_set(const char *val, > + const struct kernel_param *kp) > +{ > + unsigned int n; > + int ret; > + > + ret = kstrtouint(val, 10, ); > + if (ret != 0 || n > nr_cpu_ids) > +

Re: [PATCH] virtio_blk: corrent types for status handling

2021-10-25 Thread Christoph Hellwig
On Mon, Oct 25, 2021 at 11:24:57AM +0300, Max Gurtovoy wrote: > Maybe we can compare the returned status to BLK_STS_OK. But I see we don't > do it also in NVMe subsystem so I guess we can assume BLK_STS_OK == 0 > forever. Jes, BLK_STS_OK == 0 is an intentional allowed short cut. It is not

Re: [PATCH 04/29] dax: simplify the dax_device <-> gendisk association

2021-11-22 Thread Christoph Hellwig
On Mon, Nov 22, 2021 at 07:33:06PM -0800, Dan Williams wrote: > Is it time to add a "DAX" symbol namespace? What would be the benefit? ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH 02/29] dm: make the DAX support dependend on CONFIG_FS_DAX

2021-11-22 Thread Christoph Hellwig
On Mon, Nov 22, 2021 at 06:54:09PM -0800, Dan Williams wrote: > On Thu, Nov 18, 2021 at 10:55 PM Christoph Hellwig wrote: > > > > On Wed, Nov 17, 2021 at 09:23:44AM -0800, Dan Williams wrote: > > > Applied, fixed the spelling of 'dependent' in the subject and picked

Re: [PATCH 02/29] dm: make the DAX support dependend on CONFIG_FS_DAX

2021-11-18 Thread Christoph Hellwig
On Wed, Nov 17, 2021 at 09:23:44AM -0800, Dan Williams wrote: > Applied, fixed the spelling of 'dependent' in the subject and picked > up Mike's Ack from the previous send: > > https://lore.kernel.org/r/yyasbvuorceds...@redhat.com > > Christoph, any particular reason you did not pick up the tags

Re: [PATCH 01/29] nvdimm/pmem: move dax_attribute_group from dax to pmem

2021-11-18 Thread Christoph Hellwig
On Wed, Nov 17, 2021 at 09:44:25AM -0800, Dan Williams wrote: > On Tue, Nov 9, 2021 at 12:33 AM Christoph Hellwig wrote: > > > > dax_attribute_group is only used by the pmem driver, and can avoid the > > completely pointless lookup by the disk name if moved there. This >

[PATCH 11/29] dm-stripe: add a stripe_dax_pgoff helper

2021-11-29 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Dan

[PATCH 14/29] fsdax: simplify the pgoff calculation

2021-11-29 Thread Christoph Hellwig
Replace the two steps of dax_iomap_sector and bdev_dax_pgoff with a single dax_iomap_pgoff helper that avoids lots of cumbersome sector conversions. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- drivers/dax/super.c | 14 -- fs/dax.c

[PATCH 08/29] dax: remove dax_capable

2021-11-29 Thread Christoph Hellwig
Just open code the block size and dax_dev == NULL checks in the callers. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Gao Xiang [erofs] Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- drivers/dax/super.c | 36

[PATCH 13/29] fsdax: use a saner calling convention for copy_cow_page_dax

2021-11-29 Thread Christoph Hellwig
Just pass the vm_fault and iomap_iter structures, and figure out the rest locally. Note that this requires moving dax_iomap_sector up in the file. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 29 + 1 file

[PATCH 19/29] ext2: cleanup the dax handling in ext2_fill_super

2021-11-29 Thread Christoph Hellwig
Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/ext2/super.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff

[PATCH 10/29] dm-log-writes: add a log_writes_dax_pgoff helper

2021-11-29 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Dan

[PATCH 16/29] fsdax: simplify the offset check in dax_iomap_zero

2021-11-29 Thread Christoph Hellwig
The file relative offset must have the same alignment as the storage offset, so use that and get rid of the call to iomap_sector. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[PATCH 18/29] fsdax: decouple zeroing from the iomap buffered I/O code

2021-11-29 Thread Christoph Hellwig
it for reflink support as well. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- fs/dax.c | 77 ++ fs/ext2/inode.c| 7 ++-- fs/ext4/inode.c| 5 +-- fs/iomap/buffered-io.c | 35 +++ fs/xfs/xfs_iomap.c

[PATCH 12/29] fsdax: remove a pointless __force cast in copy_cow_page_dax

2021-11-29 Thread Christoph Hellwig
Despite its name copy_user_page expected kernel addresses, which is what we already have. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index

[PATCH 21/29] xfs: move dax device handling into xfs_{alloc, free}_buftarg

2021-11-29 Thread Christoph Hellwig
Hide the DAX device lookup from the xfs_super.c code. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Dan Williams --- fs/xfs/xfs_buf.c | 8 fs/xfs/xfs_buf.h | 4 ++-- fs/xfs/xfs_super.c | 26 +- 3 files changed, 11 insertions

[PATCH 15/29] xfs: add xfs_zero_range and xfs_truncate_page helpers

2021-11-29 Thread Christoph Hellwig
From: Shiyang Ruan Add helpers to prepare for using different DAX operations. Signed-off-by: Shiyang Ruan [hch: split from a larger patch + slight cleanups] Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_bmap_util.c | 7 +++ fs

[PATCH 23/29] xfs: pass the mapping flags to xfs_bmbt_to_iomap

2021-11-29 Thread Christoph Hellwig
To prepare for looking at the IOMAP_DAX flag in xfs_bmbt_to_iomap pass in the input mapping flags to xfs_bmbt_to_iomap. Signed-off-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_bmap.c | 4 ++-- fs/xfs/xfs_aops.c| 2 +- fs/xfs/xfs_iomap.c | 35

[PATCH 17/29] fsdax: factor out a dax_memzero helper

2021-11-29 Thread Christoph Hellwig
Factor out a helper for the "manual" zeroing of a DAX range to clean up dax_iomap_zero a lot. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletion

[PATCH 24/29] iomap: add a IOMAP_DAX flag

2021-11-29 Thread Christoph Hellwig
that are based on the block device. In the long run it should also allow turning the bdev, dax_dev and inline_data into a union. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- fs/dax.c | 7 --- fs/ext4/inode.c | 4 ++-- fs/xfs/xfs_iomap.c| 7 --- fs/xfs

[PATCH 20/29] ext4: cleanup the dax handling in ext4_fill_super

2021-11-29 Thread Christoph Hellwig
Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/ext4/super.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

[PATCH 05/29] dax: remove the pgmap sanity checks in generic_fsdax_supported

2021-11-29 Thread Christoph Hellwig
Drivers that register a dax_dev should make sure it works, no need to double check from the file system. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/super.c | 49 + 1 file changed, 1 insertion(+), 48 deletions(-) diff

decouple DAX from block devices v2

2021-11-29 Thread Christoph Hellwig
Hi Dan, this series decouples the DAX from the block layer so that the block_device is not needed at all for the DAX I/O path. Changes since v1: - rebase on latest v5.16-rc - ensure the new dax zeroing helpers are always declared - fix a dax_dev leak in pmem_attach_disk - remove '\n' from an

[PATCH 01/29] dm: fix alloc_dax error handling in alloc_dev

2021-11-29 Thread Christoph Hellwig
Make sure ->dax_dev is NULL on error so that the cleanup path doesn't trip over an ERR_PTR. Reported-by: Dan Williams Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c in

[PATCH 09/29] dm-linear: add a linear_dax_pgoff helper

2021-11-29 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Dan

[PATCH 06/29] dax: move the partition alignment check into fs_dax_get_by_bdev

2021-11-29 Thread Christoph Hellwig
fs_dax_get_by_bdev is the primary interface to find a dax device for a block device, so move the partition alignment check there instead of wiring it up through ->dax_supported. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/super.c | 23 ++-

[PATCH 03/29] dax: remove CONFIG_DAX_DRIVER

2021-11-29 Thread Christoph Hellwig
CONFIG_DAX_DRIVER only selects CONFIG_DAX now, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/Kconfig| 4 drivers/nvdimm/Kconfig | 2 +- drivers/s390/block/Kconfig | 2 +- fs/fuse/Kconfig| 2 +- 4 files changed, 3

[PATCH 04/29] dax: simplify the dax_device <-> gendisk association

2021-11-29 Thread Christoph Hellwig
Replace the dax_host_hash with an xarray indexed by the pointer value of the gendisk, and require explicitly calls from the block drivers that want to associate their gendisk with a dax_device. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/dax/bus.c| 6

[PATCH 02/29] dm: make the DAX support depend on CONFIG_FS_DAX

2021-11-29 Thread Christoph Hellwig
The device mapper DAX support is all hanging off a block device and thus can't be used with device dax. Make it depend on CONFIG_FS_DAX instead of CONFIG_DAX_DRIVER. This also means that bdev_dax_pgoff only needs to be built under CONFIG_FS_DAX now. Signed-off-by: Christoph Hellwig Acked

[PATCH 07/29] xfs: factor out a xfs_setup_dax_always helper

2021-11-29 Thread Christoph Hellwig
Factor out another DAX setup helper to simplify future changes. Also move the experimental warning after the checks to not clutter the log too much if the setup failed. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_super.c | 47

[PATCH 27/29] dax: fix up some of the block device related ifdefs

2021-11-29 Thread Christoph Hellwig
The DAX device <-> block device association is only enabled if CONFIG_BLOCK is enabled. Update dax.h to account for that and use the right conditions for the fs_put_dax stub as well. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- include

[PATCH 22/29] xfs: use xfs_direct_write_iomap_ops for DAX zeroing

2021-11-29 Thread Christoph Hellwig
While the buffered write iomap ops do work due to the fact that zeroing never allocates blocks, the DAX zeroing should use the direct ops just like actual DAX I/O. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_iomap.c | 4 ++-- 1 file

[PATCH 25/29] dax: return the partition offset from fs_dax_get_by_bdev

2021-11-29 Thread Christoph Hellwig
Prepare for the removal of the block_device from the DAX I/O path by returning the partition offset from fs_dax_get_by_bdev so that the file systems have it at hand for use during I/O. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/super.c | 9 ++--- drivers/md

[PATCH 26/29] fsdax: shift partition offset handling into the file systems

2021-11-29 Thread Christoph Hellwig
Remove the last user of ->bdev in dax.c by requiring the file system to pass in an address that already includes the DAX offset. As part of the only set ->bdev or ->daxdev when actually required in the ->iomap_begin methods. Signed-off-by: Christoph Hellwig Reviewed-by: Gao X

[PATCH 29/29] fsdax: don't require CONFIG_BLOCK

2021-11-29 Thread Christoph Hellwig
The file system DAX code now does not require the block code. So allow building a kernel with fuse DAX but not block layer. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 28/29] iomap: build the block based code conditionally

2021-11-29 Thread Christoph Hellwig
Only build the block based iomap code if CONFIG_BLOCK is set. Currently that is always the case, but it will change soon. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/Kconfig| 4 ++-- fs/iomap/Makefile | 4 ++-- 2 files changed, 4

Re: [PATCH 06/29] dax: move the partition alignment check into fs_dax_get_by_bdev

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 02:25:55PM -0800, Darrick J. Wong wrote: > > + if ((get_start_sect(bdev) * SECTOR_SIZE) % PAGE_SIZE || > > + (bdev_nr_sectors(bdev) * SECTOR_SIZE) % PAGE_SIZE) { > > Do we have to be careful about 64-bit division here, or do we not > support DAX on 32-bit? I can't

Re: [PATCH 14/29] fsdax: simplify the pgoff calculation

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 02:36:42PM -0800, Darrick J. Wong wrote: > > - phys_addr_t phys_off = (start_sect + sector) * 512; > > - > > - if (pgoff) > > - *pgoff = PHYS_PFN(phys_off); > > - if (phys_off % PAGE_SIZE || size % PAGE_SIZE) > > AFAICT, we're relying on fs_dax_get_by_bdev

Re: [PATCH 17/29] fsdax: factor out a dax_memzero helper

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 01:22:13PM -0800, Dan Williams wrote: > On Tue, Nov 9, 2021 at 12:34 AM Christoph Hellwig wrote: > > > > Factor out a helper for the "manual" zeroing of a DAX range to clean > > up dax_iomap_zero a lot. > > > >

Re: [PATCH 18/29] fsdax: decouple zeroing from the iomap buffered I/O code

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 02:53:15PM -0800, Darrick J. Wong wrote: > > -s64 dax_iomap_zero(loff_t pos, u64 length, struct iomap *iomap) > > +static loff_t dax_zero_iter(struct iomap_iter *iter, bool *did_zero) > > Shouldn't this return value remain s64 to match iomap_iter.processed? I'll switch it

Re: [PATCH 25/29] dax: return the partition offset from fs_dax_get_by_bdev

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 06:56:29PM -0800, Dan Williams wrote: > On Tue, Nov 9, 2021 at 12:34 AM Christoph Hellwig wrote: > > > > Prepare from removing the block_device from the DAX I/O path by returning > > s/from removing/for the removal of/ Fixed. > >

Re: [PATCH 22/29] iomap: add a IOMAP_DAX flag

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 06:47:10PM -0800, Dan Williams wrote: > On Tue, Nov 9, 2021 at 12:34 AM Christoph Hellwig wrote: > > > > Add a flag so that the file system can easily detect DAX operations. > > Looks ok, but I would have preferred a quick note about the rationale

Re: [PATCH 08/29] dax: remove dax_capable

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 02:31:23PM -0800, Darrick J. Wong wrote: > > - struct super_block *sb = mp->m_super; > > - > > - if (!xfs_buftarg_is_dax(sb, mp->m_ddev_targp) && > > - (!mp->m_rtdev_targp || !xfs_buftarg_is_dax(sb, mp->m_rtdev_targp))) { > > + if

Re: [PATCH 18/29] fsdax: decouple zeroing from the iomap buffered I/O code

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 01:46:35PM -0800, Dan Williams wrote: > > + const struct iomap_ops *ops) > > +{ > > + unsigned int blocksize = i_blocksize(inode); > > + unsigned int off = pos & (blocksize - 1); > > + > > + /* Block boundary? Nothing to do */ > > + if

Re: [PATCH 20/29] ext4: cleanup the dax handling in ext4_fill_super

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 02:54:30PM -0800, Darrick J. Wong wrote: > Nit: no space before the paren ^ here. Fixed. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 21/29] xfs: move dax device handling into xfs_{alloc,free}_buftarg

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 06:40:47PM -0800, Dan Williams wrote: > On Tue, Nov 9, 2021 at 12:34 AM Christoph Hellwig wrote: > > > > Hide the DAX device lookup from the xfs_super.c code. > > > > Reviewed-by: Christoph Hellwig > > That's an interesting spelling of

Re: [PATCH 23/29] xfs: use IOMAP_DAX to check for DAX mappings

2021-11-23 Thread Christoph Hellwig
On Tue, Nov 23, 2021 at 03:01:24PM -0800, Darrick J. Wong wrote: > On Tue, Nov 09, 2021 at 09:33:03AM +0100, Christoph Hellwig wrote: > > Use the explicit DAX flag instead of checking the inode flag in the > > iomap code. > > > > Signed-off-by: Christoph Hellwig

decouple DAX from block devices

2021-11-09 Thread Christoph Hellwig
Hi Dan, this series decouples the DAX from the block layer so that the block_device is not needed at all for the DAX I/O path. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

[PATCH 02/29] dm: make the DAX support dependend on CONFIG_FS_DAX

2021-11-09 Thread Christoph Hellwig
The device mapper DAX support is all hanging off a block device and thus can't be used with device dax. Make it depend on CONFIG_FS_DAX instead of CONFIG_DAX_DRIVER. This also means that bdev_dax_pgoff only needs to be built under CONFIG_FS_DAX now. Signed-off-by: Christoph Hellwig

[PATCH 05/29] dax: remove the pgmap sanity checks in generic_fsdax_supported

2021-11-09 Thread Christoph Hellwig
Drivers that register a dax_dev should make sure it works, no need to double check from the file system. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 49 + 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/drivers/dax/super.c

[PATCH 03/29] dax: remove CONFIG_DAX_DRIVER

2021-11-09 Thread Christoph Hellwig
CONFIG_DAX_DRIVER only selects CONFIG_DAX now, so remove it. Signed-off-by: Christoph Hellwig --- drivers/dax/Kconfig| 4 drivers/nvdimm/Kconfig | 2 +- drivers/s390/block/Kconfig | 2 +- fs/fuse/Kconfig| 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff

[PATCH 01/29] nvdimm/pmem: move dax_attribute_group from dax to pmem

2021-11-09 Thread Christoph Hellwig
dax_attribute_group is only used by the pmem driver, and can avoid the completely pointless lookup by the disk name if moved there. This leaves just a single caller of dax_get_by_host, so move dax_get_by_host into the same ifdef block as that caller. Signed-off-by: Christoph Hellwig Reviewed

[PATCH 25/29] dax: return the partition offset from fs_dax_get_by_bdev

2021-11-09 Thread Christoph Hellwig
Prepare from removing the block_device from the DAX I/O path by returning the partition offset from fs_dax_get_by_bdev so that the file systems have it at hand for use during I/O. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 9 ++--- drivers/md/dm.c | 4 ++-- fs/erofs

[PATCH 23/29] xfs: use IOMAP_DAX to check for DAX mappings

2021-11-09 Thread Christoph Hellwig
Use the explicit DAX flag instead of checking the inode flag in the iomap code. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_iomap.c | 7 --- fs/xfs/xfs_iomap.h | 3 ++- fs/xfs/xfs_pnfs.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs

[PATCH 28/29] iomap: build the block based code conditionally

2021-11-09 Thread Christoph Hellwig
Only build the block based iomap code if CONFIG_BLOCK is set. Currently that is always the case, but it will change soon. Signed-off-by: Christoph Hellwig --- fs/Kconfig| 4 ++-- fs/iomap/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/Kconfig b/fs

[PATCH 29/29] fsdax: don't require CONFIG_BLOCK

2021-11-09 Thread Christoph Hellwig
The file system DAX code now does not require the block code. So allow building a kernel with fuse DAX but not block layer. Signed-off-by: Christoph Hellwig --- fs/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/Kconfig b/fs/Kconfig index 6d608330a096e

[PATCH 26/29] fsdax: shift partition offset handling into the file systems

2021-11-09 Thread Christoph Hellwig
Remove the last user of ->bdev in dax.c by requiring the file system to pass in an address that already includes the DAX offset. As part of the only set ->bdev or ->daxdev when actually required in the ->iomap_begin methods. Signed-off-by: Christoph Hellwig --- fs/dax.c

[PATCH 18/29] fsdax: decouple zeroing from the iomap buffered I/O code

2021-11-09 Thread Christoph Hellwig
it for reflink support as well. Signed-off-by: Christoph Hellwig --- fs/dax.c | 77 ++ fs/ext2/inode.c| 6 ++-- fs/ext4/inode.c| 4 +-- fs/iomap/buffered-io.c | 35 +++ fs/xfs/xfs_iomap.c | 6 include

[PATCH 14/29] fsdax: simplify the pgoff calculation

2021-11-09 Thread Christoph Hellwig
Replace the two steps of dax_iomap_sector and bdev_dax_pgoff with a single dax_iomap_pgoff helper that avoids lots of cumbersome sector conversions. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 14 -- fs/dax.c| 35

[PATCH 15/29] xfs: add xfs_zero_range and xfs_truncate_page helpers

2021-11-09 Thread Christoph Hellwig
From: Shiyang Ruan Add helpers to prepare for using different DAX operations. Signed-off-by: Shiyang Ruan [hch: split from a larger patch + slight cleanups] Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_bmap_util.c | 7 +++ fs/xfs/xfs_file.c | 3 +-- fs/xfs/xfs_iomap.c | 25

[PATCH 06/29] dax: move the partition alignment check into fs_dax_get_by_bdev

2021-11-09 Thread Christoph Hellwig
fs_dax_get_by_bdev is the primary interface to find a dax device for a block device, so move the partition alignment check there instead of wiring it up through ->dax_supported. Signed-off-by: Christoph Hellwig --- drivers/dax/super.c | 23 ++- 1 file changed, 6 inserti

[PATCH 07/29] xfs: factor out a xfs_setup_dax_always helper

2021-11-09 Thread Christoph Hellwig
Factor out another DAX setup helper to simplify future changes. Also move the experimental warning after the checks to not clutter the log too much if the setup failed. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_super.c | 47 +++--- 1 file changed

[PATCH 04/29] dax: simplify the dax_device <-> gendisk association

2021-11-09 Thread Christoph Hellwig
Replace the dax_host_hash with an xarray indexed by the pointer value of the gendisk, and require explicitly calls from the block drivers that want to associate their gendisk with a dax_device. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/dax/bus.c| 6

[PATCH 09/29] dm-linear: add a linear_dax_pgoff helper

2021-11-09 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/md/dm

[PATCH 13/29] fsdax: use a saner calling convention for copy_cow_page_dax

2021-11-09 Thread Christoph Hellwig
Just pass the vm_fault and iomap_iter structures, and figure out the rest locally. Note that this requires moving dax_iomap_sector up in the file. Signed-off-by: Christoph Hellwig --- fs/dax.c | 29 + 1 file changed, 13 insertions(+), 16 deletions(-) diff --git

[PATCH 08/29] dax: remove dax_capable

2021-11-09 Thread Christoph Hellwig
Just open code the block size and dax_dev == NULL checks in the callers. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/dax/super.c | 36 drivers/md/dm-table.c| 22 +++--- drivers/md/dm.c

[PATCH 21/29] xfs: move dax device handling into xfs_{alloc, free}_buftarg

2021-11-09 Thread Christoph Hellwig
Hide the DAX device lookup from the xfs_super.c code. Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_buf.c | 8 fs/xfs/xfs_buf.h | 4 ++-- fs/xfs/xfs_super.c | 26 +- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs

[PATCH 20/29] ext4: cleanup the dax handling in ext4_fill_super

2021-11-09 Thread Christoph Hellwig
Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig --- fs/ext4/super.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index eb4df43abd76e

[PATCH 22/29] iomap: add a IOMAP_DAX flag

2021-11-09 Thread Christoph Hellwig
Add a flag so that the file system can easily detect DAX operations. Signed-off-by: Christoph Hellwig --- fs/dax.c | 7 --- include/linux/iomap.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 5b52b878124ac..0bd6cdcbacfc4 100644

[PATCH 19/29] ext2: cleanup the dax handling in ext2_fill_super

2021-11-09 Thread Christoph Hellwig
Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig --- fs/ext2/super.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/ext2/super.c b/fs/ext2/super.c index

[PATCH 24/29] xfs: use xfs_direct_write_iomap_ops for DAX zeroing

2021-11-09 Thread Christoph Hellwig
While the buffered write iomap ops do work due to the fact that zeroing never allocates blocks, the DAX zeroing should use the direct ops just like actual DAX I/O. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_iomap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs

<    1   2   3   4   5   6   7   8   9   10   >