Commit bb0bc49a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull dax updates from Ira Weiny:
 "The series adds DAX support required for the upcoming fuse/famfs file
  system.[1] The support here is required because famfs is backed by
  devdax rather than pmem. This all lays the groundwork for using shared
  memory as a file system"

Link: https://lore.kernel.org/all/0100019d43e5f632-f5862a3e-361c-4b54-a9a6-96c242a8f17a-000000@email.amazonses.com/ [1]

* tag 'libnvdimm-for-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  dax/fsdev: fix uninitialized kaddr in fsdev_dax_zero_page_range()
  dax: export dax_dev_get()
  dax: Add fs_dax_get() func to prepare dax for fs-dax usage
  dax: Add dax_set_ops() for setting dax_operations at bind time
  dax: Add dax_operations for use by fs-dax on fsdev dax
  dax: Save the kva from memremap
  dax: add fsdev.c driver for fs-dax on character dax
  dax: Factor out dax_folio_reset_order() helper
  dax: move dax_pgoff_to_phys from [drivers/dax/] device.c to bus.c
parents c94faa7c 45df9111
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -7303,6 +7303,14 @@ L: linux-cxl@vger.kernel.org
S:	Supported
F:	drivers/dax/
DEVICE DIRECT ACCESS (DAX) [fsdev_dax]
M:	John Groves <jgroves@micron.com>
M:	John Groves <John@Groves.net>
L:	nvdimm@lists.linux.dev
L:	linux-cxl@vger.kernel.org
S:	Supported
F:	drivers/dax/fsdev.c
DEVICE FREQUENCY (DEVFREQ)
M:	MyungJoo Ham <myungjoo.ham@samsung.com>
M:	Kyungmin Park <kyungmin.park@samsung.com>
+5 −0
Original line number Diff line number Diff line
@@ -65,6 +65,11 @@ config DEV_DAX_HMEM_DEVICES
	depends on DEV_DAX_HMEM && DAX
	def_bool y

config DEV_DAX_FSDEV
	tristate
	depends on DEV_DAX && FS_DAX
	default DEV_DAX

config DEV_DAX_KMEM
	tristate "KMEM DAX: map dax-devices as System-RAM"
	default DEV_DAX
+2 −0
Original line number Diff line number Diff line
@@ -5,9 +5,11 @@ obj-$(CONFIG_DEV_DAX) += device_dax.o
obj-$(CONFIG_DEV_DAX_KMEM) += kmem.o
obj-$(CONFIG_DEV_DAX_PMEM) += dax_pmem.o
obj-$(CONFIG_DEV_DAX_CXL) += dax_cxl.o
obj-$(CONFIG_DEV_DAX_FSDEV) += fsdev_dax.o

dax-y := super.o
dax-y += bus.o
device_dax-y := device.o
dax_pmem-y := pmem.o
dax_cxl-y := cxl.o
fsdev_dax-y := fsdev.o
+20 −2
Original line number Diff line number Diff line
@@ -40,8 +40,6 @@ static int dax_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
	return add_uevent_var(env, "MODALIAS=" DAX_DEVICE_MODALIAS_FMT, 0);
}

#define to_dax_drv(__drv)	container_of_const(__drv, struct dax_device_driver, drv)

static struct dax_id *__dax_match_id(const struct dax_device_driver *dax_drv,
		const char *dev_name)
{
@@ -1431,6 +1429,26 @@ static const struct device_type dev_dax_type = {
	.groups = dax_attribute_groups,
};

/* see "strong" declaration in tools/testing/nvdimm/dax-dev.c */
__weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,
			      unsigned long size)
{
	for (int i = 0; i < dev_dax->nr_range; i++) {
		struct dev_dax_range *dax_range = &dev_dax->ranges[i];
		struct range *range = &dax_range->range;
		phys_addr_t phys;

		if (!in_range(pgoff, dax_range->pgoff, PHYS_PFN(range_len(range))))
			continue;
		phys = PFN_PHYS(pgoff - dax_range->pgoff) + range->start;
		if (phys + size - 1 <= range->end)
			return phys;
		break;
	}
	return -1;
}
EXPORT_SYMBOL_GPL(dax_pgoff_to_phys);

static struct dev_dax *__devm_create_dev_dax(struct dev_dax_data *data)
{
	struct dax_region *dax_region = data->dax_region;
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ struct dev_dax *devm_create_dev_dax(struct dev_dax_data *data);
enum dax_driver_type {
	DAXDRV_KMEM_TYPE,
	DAXDRV_DEVICE_TYPE,
	DAXDRV_FSDEV_TYPE,
};

struct dax_device_driver {
@@ -43,6 +44,8 @@ struct dax_device_driver {
	void (*remove)(struct dev_dax *dev);
};

#define to_dax_drv(__drv) container_of_const(__drv, struct dax_device_driver, drv)

int __dax_driver_register(struct dax_device_driver *dax_drv,
		struct module *module, const char *mod_name);
#define dax_driver_register(driver) \
Loading