[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4ihKqqR-bzNXeeTZ--F4MbEfqnmCyiQ2s3Ngc0oq488WQ@mail.gmail.com>
Date: Fri, 20 Jan 2017 09:28:26 -0800
From: Dan Williams <dan.j.williams@...el.com>
To: "linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>
Cc: Jan Kara <jack@...e.cz>, Mike Snitzer <snitzer@...hat.com>,
Matthew Wilcox <mawilcox@...rosoft.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jens Axboe <axboe@...com>, dm-devel@...hat.com,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Christoph Hellwig <hch@....de>
Subject: Re: [PATCH 02/13] block, dax: introduce dax_operations
On Thu, Jan 19, 2017 at 7:50 PM, Dan Williams <dan.j.williams@...el.com> wrote:
> Prepare for the removal of memcpy_to_pmem() and copy_from_iter_pmem() by
> introducing dax_ops. This allows for driver specific overrides for the
> routines that transfer data to a dax capable block device.
>
> Cc: <dm-devel@...hat.com>
> Cc: Jan Kara <jack@...e.cz>
> Cc: Jens Axboe <axboe@...com>
> Cc: Jeff Moyer <jmoyer@...hat.com>
> Cc: Christoph Hellwig <hch@....de>
> Cc: Toshi Kani <toshi.kani@....com>
> Cc: Mike Snitzer <snitzer@...hat.com>
> Cc: Matthew Wilcox <mawilcox@...rosoft.com>
> Cc: Ross Zwisler <ross.zwisler@...ux.intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@...el.com>
> ---
> arch/powerpc/sysdev/axonram.c | 6 +++++-
> drivers/block/brd.c | 6 +++++-
> drivers/md/dm.c | 6 +++++-
> drivers/nvdimm/pmem.c | 6 +++++-
> drivers/s390/block/dcssblk.c | 6 +++++-
> fs/block_dev.c | 6 ++++--
> include/linux/blkdev.h | 8 ++++++--
> 7 files changed, 35 insertions(+), 9 deletions(-)
>
[..]
> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
> index 3086da5664f3..87920a379d20 100644
> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -2725,13 +2725,17 @@ static const struct pr_ops dm_pr_ops = {
> .pr_clear = dm_pr_clear,
> };
>
> +static const struct dax_operations dm_dax_ops = {
> + .direct_access = dm_blk_direct_access,
> +};
> +
> static const struct block_device_operations dm_blk_dops = {
> .open = dm_blk_open,
> .release = dm_blk_close,
> .ioctl = dm_blk_ioctl,
> - .direct_access = dm_blk_direct_access,
> .getgeo = dm_blk_getgeo,
> .pr_ops = &dm_pr_ops,
> + .dax_ops = &dm_dax_ops,
> .owner = THIS_MODULE
> };
I just realized we need to do a bit more plumbing to support the
device-mapper case. We need to implement all the dax_operations at the
dm_dax_ops level and pass in the physical sector so that device-mapper
can look up the backing block-device to call the real dax_operation if
it is implemented.
Powered by blists - more mailing lists