Merge branch 'for-5.14/dax' into libnvdimm-fixes

Pick up some small dax cleanups that make some of Ira's follow on work
easier.
This commit is contained in:
Dan Williams 2021-08-11 12:04:43 -07:00
commit 96dcb97d0a
3 changed files with 4 additions and 6 deletions

View File

@ -313,7 +313,7 @@ long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
return -ENXIO; return -ENXIO;
if (nr_pages < 0) if (nr_pages < 0)
return nr_pages; return -EINVAL;
avail = dax_dev->ops->direct_access(dax_dev, pgoff, nr_pages, avail = dax_dev->ops->direct_access(dax_dev, pgoff, nr_pages,
kaddr, pfn); kaddr, pfn);

View File

@ -722,7 +722,7 @@ static int copy_cow_page_dax(struct block_device *bdev, struct dax_device *dax_d
return rc; return rc;
id = dax_read_lock(); id = dax_read_lock();
rc = dax_direct_access(dax_dev, pgoff, PHYS_PFN(PAGE_SIZE), &kaddr, NULL); rc = dax_direct_access(dax_dev, pgoff, 1, &kaddr, NULL);
if (rc < 0) { if (rc < 0) {
dax_read_unlock(id); dax_read_unlock(id);
return rc; return rc;

View File

@ -1235,8 +1235,6 @@ void fuse_dax_conn_free(struct fuse_conn *fc)
static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd) static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd)
{ {
long nr_pages, nr_ranges; long nr_pages, nr_ranges;
void *kaddr;
pfn_t pfn;
struct fuse_dax_mapping *range; struct fuse_dax_mapping *range;
int ret, id; int ret, id;
size_t dax_size = -1; size_t dax_size = -1;
@ -1248,8 +1246,8 @@ static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd)
INIT_DELAYED_WORK(&fcd->free_work, fuse_dax_free_mem_worker); INIT_DELAYED_WORK(&fcd->free_work, fuse_dax_free_mem_worker);
id = dax_read_lock(); id = dax_read_lock();
nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), &kaddr, nr_pages = dax_direct_access(fcd->dev, 0, PHYS_PFN(dax_size), NULL,
&pfn); NULL);
dax_read_unlock(id); dax_read_unlock(id);
if (nr_pages < 0) { if (nr_pages < 0) {
pr_debug("dax_direct_access() returned %ld\n", nr_pages); pr_debug("dax_direct_access() returned %ld\n", nr_pages);