mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
block: remove block_device_operations ->direct_access()
Now that all the producers and consumers of dax interfaces have been converted to using dax_operations on a dax_device, remove the block device direct_access enabling. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
2093f2e9df
commit
d4b29fd78e
7 changed files with 4 additions and 135 deletions
|
@ -718,51 +718,6 @@ int bdev_write_page(struct block_device *bdev, sector_t sector,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(bdev_write_page);
|
||||
|
||||
/**
|
||||
* bdev_direct_access() - Get the address for directly-accessibly memory
|
||||
* @bdev: The device containing the memory
|
||||
* @dax: control and output parameters for ->direct_access
|
||||
*
|
||||
* If a block device is made up of directly addressable memory, this function
|
||||
* will tell the caller the PFN and the address of the memory. The address
|
||||
* may be directly dereferenced within the kernel without the need to call
|
||||
* ioremap(), kmap() or similar. The PFN is suitable for inserting into
|
||||
* page tables.
|
||||
*
|
||||
* Return: negative errno if an error occurs, otherwise the number of bytes
|
||||
* accessible at this address.
|
||||
*/
|
||||
long bdev_direct_access(struct block_device *bdev, struct blk_dax_ctl *dax)
|
||||
{
|
||||
sector_t sector = dax->sector;
|
||||
long avail, size = dax->size;
|
||||
const struct block_device_operations *ops = bdev->bd_disk->fops;
|
||||
|
||||
/*
|
||||
* The device driver is allowed to sleep, in order to make the
|
||||
* memory directly accessible.
|
||||
*/
|
||||
might_sleep();
|
||||
|
||||
if (size < 0)
|
||||
return size;
|
||||
if (!blk_queue_dax(bdev_get_queue(bdev)) || !ops->direct_access)
|
||||
return -EOPNOTSUPP;
|
||||
if ((sector + DIV_ROUND_UP(size, 512)) >
|
||||
part_nr_sects_read(bdev->bd_part))
|
||||
return -ERANGE;
|
||||
sector += get_start_sect(bdev);
|
||||
if (sector % (PAGE_SIZE / 512))
|
||||
return -EINVAL;
|
||||
avail = ops->direct_access(bdev, sector, &dax->addr, &dax->pfn, size);
|
||||
if (!avail)
|
||||
return -ERANGE;
|
||||
if (avail > 0 && avail & ~PAGE_MASK)
|
||||
return -ENXIO;
|
||||
return min(avail, size);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bdev_direct_access);
|
||||
|
||||
int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size,
|
||||
pgoff_t *pgoff)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue