if (!blk_queue_dax(bdev->bd_disk->queue))
return NULL;
+ if ((get_start_sect(bdev) * SECTOR_SIZE) % PAGE_SIZE ||
+ (bdev_nr_sectors(bdev) * SECTOR_SIZE) % PAGE_SIZE) {
+ pr_info("%pg: error: unaligned partition for dax\n", bdev);
+ return NULL;
+ }
+
id = dax_read_lock();
dax_dev = xa_load(&dax_hosts, (unsigned long)bdev->bd_disk);
if (!dax_dev || !dax_alive(dax_dev) || !igrab(&dax_dev->inode))
struct block_device *bdev, int blocksize, sector_t start,
sector_t sectors)
{
- pgoff_t pgoff, pgoff_end;
- sector_t last_page;
- int err;
-
if (blocksize != PAGE_SIZE) {
pr_info("%pg: error: unsupported blocksize for dax\n", bdev);
return false;
return false;
}
- err = bdev_dax_pgoff(bdev, start, PAGE_SIZE, &pgoff);
- if (err) {
- pr_info("%pg: error: unaligned partition for dax\n", bdev);
- return false;
- }
-
- last_page = PFN_DOWN((start + sectors - 1) * 512) * PAGE_SIZE / 512;
- err = bdev_dax_pgoff(bdev, last_page, PAGE_SIZE, &pgoff_end);
- if (err) {
- pr_info("%pg: error: unaligned partition for dax\n", bdev);
- return false;
- }
-
return true;
}
EXPORT_SYMBOL_GPL(generic_fsdax_supported);