[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171110090453.GC4895@lst.de>
Date: Fri, 10 Nov 2017 10:04:53 +0100
From: Christoph Hellwig <hch@....de>
To: Dan Williams <dan.j.williams@...el.com>
Cc: linux-nvdimm@...ts.01.org, Michal Hocko <mhocko@...e.com>,
linux-kernel@...r.kernel.org, linux-xfs@...r.kernel.org,
linux-mm@...ck.org,
Jérôme Glisse <jglisse@...hat.com>,
linux-fsdevel@...r.kernel.org, akpm@...ux-foundation.org,
hch@....de
Subject: Re: [PATCH 12/15] mm, dax: enable filesystems to trigger page-idle
callbacks
> +DEFINE_MUTEX(devmap_lock);
static?
> +#if IS_ENABLED(CONFIG_FS_DAX)
> +static void generic_dax_pagefree(struct page *page, void *data)
> +{
> +}
> +
> +struct dax_device *fs_dax_claim_bdev(struct block_device *bdev, void *owner)
> +{
> + struct dax_device *dax_dev;
> + struct dev_pagemap *pgmap;
> +
> + if (!blk_queue_dax(bdev->bd_queue))
> + return NULL;
> + dax_dev = fs_dax_get_by_host(bdev->bd_disk->disk_name);
> + if (!dax_dev->pgmap)
> + return dax_dev;
> + pgmap = dax_dev->pgmap;
> + mutex_lock(&devmap_lock);
> + if ((pgmap->data && pgmap->data != owner) || pgmap->page_free
> + || pgmap->page_fault
> + || pgmap->type != MEMORY_DEVICE_HOST) {
> + put_dax(dax_dev);
> + mutex_unlock(&devmap_lock);
> + return NULL;
> + }
> +
> + pgmap->type = MEMORY_DEVICE_FS_DAX;
> + pgmap->page_free = generic_dax_pagefree;
> + pgmap->data = owner;
> + mutex_unlock(&devmap_lock);
All this deep magic will need some explanation. So far I don't understand
it at all, but maybe the later patches will help..
Powered by blists - more mailing lists