summaryrefslogtreecommitdiff
path: root/drivers/dax/super.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-21 09:06:42 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-21 09:06:42 +0200
commit629b9111535f2a2607bbea1599d285a25f32835d (patch)
tree81a37df4e13842d5ea3d54b619e929e2b6e9ffed /drivers/dax/super.c
parent673d74683627bc78eaca1fdbe24b6cf45c5c8d84 (diff)
parentba4f184e126b751d1bffad5897f263108befc780 (diff)
Merge 5.0-rc6 into usb-next
We want the USB fixes in here, and this resolves a merge issue in the uas driver. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/dax/super.c')
-rw-r--r--drivers/dax/super.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/dax/super.c b/drivers/dax/super.c
index e5767c83ea23..e84070b55463 100644
--- a/drivers/dax/super.c
+++ b/drivers/dax/super.c
@@ -85,6 +85,12 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev,
return false;
}
+ if (!dax_dev) {
+ pr_debug("%s: error: dax unsupported by block device\n",
+ bdevname(bdev, buf));
+ return false;
+ }
+
err = bdev_dax_pgoff(bdev, start, PAGE_SIZE, &pgoff);
if (err) {
pr_info("%s: error: unaligned partition for dax\n",
@@ -100,12 +106,6 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev,
return false;
}
- if (!dax_dev || !bdev_dax_supported(bdev, blocksize)) {
- pr_debug("%s: error: dax unsupported by block device\n",
- bdevname(bdev, buf));
- return false;
- }
-
id = dax_read_lock();
len = dax_direct_access(dax_dev, pgoff, 1, &kaddr, &pfn);
len2 = dax_direct_access(dax_dev, pgoff_end, 1, &end_kaddr, &end_pfn);
@@ -325,11 +325,15 @@ EXPORT_SYMBOL_GPL(dax_direct_access);
bool dax_supported(struct dax_device *dax_dev, struct block_device *bdev,
int blocksize, sector_t start, sector_t len)
{
+ if (!dax_dev)
+ return false;
+
if (!dax_alive(dax_dev))
return false;
return dax_dev->ops->dax_supported(dax_dev, bdev, blocksize, start, len);
}
+EXPORT_SYMBOL_GPL(dax_supported);
size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
size_t bytes, struct iov_iter *i)