Linux-NVDIMM Archive on
 help / color / Atom feed
From: Vivek Goyal <>
Subject: [RFC PATCH 0/6] dax: Replace bdev_dax_pgoff() with dax_pgoff()
Date: Wed, 12 Feb 2020 12:07:27 -0500
Message-ID: <> (raw)

Currently dax code assumes that there is always a block device
associated with it. And block device is passed around in few routines. I
am implementing DAX support for virtiofs and there is no block device
while we are using dax device. So I need dax code to move away from
this assumption that there is always a block device.

We seem to pass around block deivce only to calculate the partition
offset into dax device. bdev_dax_pgoff() does get_start_sect(bdev).

There are two proposed solutions to this problem.

- Get rid of kernel partition support for pmem devices.

- Caller stores offset into dax device and passes that in along with

First solution was discussed recently in this thread.

I feel we already shipped partition support for dax block devices and
going back now will be painful and its easy to break users out there
which are using partitions.

Hence I thought of writing patches for second proposal and see how bad
it looks. To me patches are fairly small and don't break backward 
compatibility and seem like a good step in the direction of removing
dax assumptions about block device.

So I am posting this RFC patch series, which is just boot tested.

Any feedback or comments are welcome.


Vivek Goyal (6):
  dax: Define a helper dax_pgoff() which takes in dax_offset as argument
  dax,iomap,ext4,ext2,xfs: Save dax_offset in "struct iomap"
  fs/dax.c: Start using dax_pgoff() instead of bdev_dax_pgoff()
  dax, dm/md: Use dax_pgoff() instead of bdev_dax_pgoff()
  drivers/dax: Use dax_pgoff() instead of bdev_dax_pgoff()
  dax: Remove bdev_dax_pgoff() helper

 drivers/dax/super.c        | 11 +++++------
 drivers/md/dm-linear.c     |  9 ++++++---
 drivers/md/dm-log-writes.c |  9 ++++++---
 drivers/md/dm-stripe.c     |  8 +++++---
 fs/dax.c                   | 13 ++++++-------
 fs/ext2/inode.c            |  1 +
 fs/ext4/inode.c            |  1 +
 fs/xfs/xfs_iomap.c         |  2 ++
 include/linux/dax.h        |  2 +-
 include/linux/iomap.h      |  1 +
 10 files changed, 34 insertions(+), 23 deletions(-)

Linux-nvdimm mailing list --
To unsubscribe send an email to

             reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 17:07 Vivek Goyal [this message]
2020-02-12 17:07 ` [PATCH 1/6] dax: Define a helper dax_pgoff() which takes in dax_offset as argument Vivek Goyal
2020-02-17 13:30   ` Christoph Hellwig
2020-02-17 13:37   ` Matthew Wilcox
2020-02-12 17:07 ` [PATCH 2/6] dax,iomap,ext4,ext2,xfs: Save dax_offset in "struct iomap" Vivek Goyal
2020-02-17 13:31   ` Christoph Hellwig
2020-02-12 17:07 ` [PATCH 3/6] fs/dax.c: Start using dax_pgoff() instead of bdev_dax_pgoff() Vivek Goyal
2020-02-12 17:07 ` [PATCH 4/6] dax, dm/md: Use " Vivek Goyal
2020-02-12 17:07 ` [PATCH 5/6] drivers/dax: " Vivek Goyal
2020-02-12 17:07 ` [PATCH 6/6] dax: Remove bdev_dax_pgoff() helper Vivek Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-NVDIMM Archive on

Archives are clonable:
	git clone --mirror linux-nvdimm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvdimm linux-nvdimm/ \
	public-inbox-index linux-nvdimm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone