linux/drivers/dax
Vivek Goyal 1a9d5d4059 dax: Modify bdev_dax_pgoff() to handle NULL bdev
virtiofs does not have a block device but it has dax device.
Modify bdev_dax_pgoff() to be able to handle that.

If there is no bdev, that means dax offset is 0. (It can't be a partition
block device starting at an offset in dax device).

This is little hackish. There have been discussions about getting rid
of dax not supporting partitions.

https://lore.kernel.org/linux-fsdevel/20200107125159.GA15745@infradead.org/

IMHO, this path can easily break exisitng users. For example
ioctl(BLKPG_ADD_PARTITION) will start breaking on block devices
supporting DAX. Also, I personally find it very useful to be able to
partition dax devices and still be able to use DAX.

Alternatively, I tried to store offset into dax device information in iomap
interface, but that got NACKed.

https://lore.kernel.org/linux-fsdevel/20200217133117.GB20444@infradead.org/

I can't think of a good path to solve this issue properly. So to make
progress, it seems this patch is least bad option for now and I hope
we can take it.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Vishal L Verma <vishal.l.verma@intel.com>
Cc: "Weiny, Ira" <ira.weiny@intel.com>
Cc: linux-nvdimm@lists.01.org
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2020-09-10 11:39:22 +02:00
..
pmem libnvdimm/namespace: Differentiate between probe mapping and runtime mapping 2019-11-14 19:08:47 -08:00
bus.c dax: Move mandatory ->zero_page_range() check in alloc_dax() 2020-04-02 19:15:03 -07:00
bus.h dax: Fix alloc_dax_region() compile warning 2019-11-07 15:44:47 +01:00
dax-private.h device-dax: add memory via add_memory_driver_managed() 2020-06-04 19:06:23 -07:00
device.c vfs: track per-sb writeback errors and report them to syncfs 2020-06-02 10:59:05 -07:00
hmem.c device-dax: Add a driver for "hmem" devices 2019-11-07 15:45:00 +01:00
Kconfig device-dax: Add a driver for "hmem" devices 2019-11-07 15:45:00 +01:00
kmem.c device-dax: add memory via add_memory_driver_managed() 2020-06-04 19:06:23 -07:00
Makefile device-dax: Add a driver for "hmem" devices 2019-11-07 15:45:00 +01:00
super.c dax: Modify bdev_dax_pgoff() to handle NULL bdev 2020-09-10 11:39:22 +02:00