lkml.org 
[lkml]   [2017]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 02/13] block, dax: introduce dax_operations
On Thu, Jan 19, 2017 at 7:50 PM, Dan Williams <dan.j.williams@intel.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@redhat.com>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Jens Axboe <axboe@fb.com>
> Cc: Jeff Moyer <jmoyer@redhat.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Toshi Kani <toshi.kani@hpe.com>
> Cc: Mike Snitzer <snitzer@redhat.com>
> Cc: Matthew Wilcox <mawilcox@microsoft.com>
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.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.

\
 
 \ /
  Last update: 2017-01-20 18:28    [W:0.074 / U:3.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site