Commit cb389b9c authored by Dan Williams's avatar Dan Williams

dax: drop size parameter to ->direct_access()

None of the implementations currently use it.  The common
bdev_direct_access() entry point handles all the size checks before
calling ->direct_access().
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 4a9bf88a
...@@ -141,7 +141,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio) ...@@ -141,7 +141,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
*/ */
static long static long
axon_ram_direct_access(struct block_device *device, sector_t sector, axon_ram_direct_access(struct block_device *device, sector_t sector,
void __pmem **kaddr, unsigned long *pfn, long size) void __pmem **kaddr, unsigned long *pfn)
{ {
struct axon_ram_bank *bank = device->bd_disk->private_data; struct axon_ram_bank *bank = device->bd_disk->private_data;
loff_t offset = (loff_t)sector << AXON_RAM_SECTOR_SHIFT; loff_t offset = (loff_t)sector << AXON_RAM_SECTOR_SHIFT;
......
...@@ -371,7 +371,7 @@ static int brd_rw_page(struct block_device *bdev, sector_t sector, ...@@ -371,7 +371,7 @@ static int brd_rw_page(struct block_device *bdev, sector_t sector,
#ifdef CONFIG_BLK_DEV_RAM_DAX #ifdef CONFIG_BLK_DEV_RAM_DAX
static long brd_direct_access(struct block_device *bdev, sector_t sector, static long brd_direct_access(struct block_device *bdev, sector_t sector,
void __pmem **kaddr, unsigned long *pfn, long size) void __pmem **kaddr, unsigned long *pfn)
{ {
struct brd_device *brd = bdev->bd_disk->private_data; struct brd_device *brd = bdev->bd_disk->private_data;
struct page *page; struct page *page;
...@@ -384,10 +384,6 @@ static long brd_direct_access(struct block_device *bdev, sector_t sector, ...@@ -384,10 +384,6 @@ static long brd_direct_access(struct block_device *bdev, sector_t sector,
*kaddr = (void __pmem *)page_address(page); *kaddr = (void __pmem *)page_address(page);
*pfn = page_to_pfn(page); *pfn = page_to_pfn(page);
/*
* TODO: If size > PAGE_SIZE, we could look to see if the next page in
* the file happens to be mapped to the next page of physical RAM.
*/
return PAGE_SIZE; return PAGE_SIZE;
} }
#else #else
......
...@@ -92,7 +92,7 @@ static int pmem_rw_page(struct block_device *bdev, sector_t sector, ...@@ -92,7 +92,7 @@ static int pmem_rw_page(struct block_device *bdev, sector_t sector,
} }
static long pmem_direct_access(struct block_device *bdev, sector_t sector, static long pmem_direct_access(struct block_device *bdev, sector_t sector,
void __pmem **kaddr, unsigned long *pfn, long size) void __pmem **kaddr, unsigned long *pfn)
{ {
struct pmem_device *pmem = bdev->bd_disk->private_data; struct pmem_device *pmem = bdev->bd_disk->private_data;
size_t offset = sector << 9; size_t offset = sector << 9;
......
...@@ -29,7 +29,7 @@ static int dcssblk_open(struct block_device *bdev, fmode_t mode); ...@@ -29,7 +29,7 @@ static int dcssblk_open(struct block_device *bdev, fmode_t mode);
static void dcssblk_release(struct gendisk *disk, fmode_t mode); static void dcssblk_release(struct gendisk *disk, fmode_t mode);
static void dcssblk_make_request(struct request_queue *q, struct bio *bio); static void dcssblk_make_request(struct request_queue *q, struct bio *bio);
static long dcssblk_direct_access(struct block_device *bdev, sector_t secnum, static long dcssblk_direct_access(struct block_device *bdev, sector_t secnum,
void __pmem **kaddr, unsigned long *pfn, long size); void __pmem **kaddr, unsigned long *pfn);
static char dcssblk_segments[DCSSBLK_PARM_LEN] = "\0"; static char dcssblk_segments[DCSSBLK_PARM_LEN] = "\0";
...@@ -879,7 +879,7 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio) ...@@ -879,7 +879,7 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio)
static long static long
dcssblk_direct_access (struct block_device *bdev, sector_t secnum, dcssblk_direct_access (struct block_device *bdev, sector_t secnum,
void __pmem **kaddr, unsigned long *pfn, long size) void __pmem **kaddr, unsigned long *pfn)
{ {
struct dcssblk_dev_info *dev_info; struct dcssblk_dev_info *dev_info;
unsigned long offset, dev_sz; unsigned long offset, dev_sz;
......
...@@ -462,7 +462,7 @@ long bdev_direct_access(struct block_device *bdev, sector_t sector, ...@@ -462,7 +462,7 @@ long bdev_direct_access(struct block_device *bdev, sector_t sector,
sector += get_start_sect(bdev); sector += get_start_sect(bdev);
if (sector % (PAGE_SIZE / 512)) if (sector % (PAGE_SIZE / 512))
return -EINVAL; return -EINVAL;
avail = ops->direct_access(bdev, sector, addr, pfn, size); avail = ops->direct_access(bdev, sector, addr, pfn);
if (!avail) if (!avail)
return -ERANGE; return -ERANGE;
return min(avail, size); return min(avail, size);
......
...@@ -1556,7 +1556,7 @@ struct block_device_operations { ...@@ -1556,7 +1556,7 @@ struct block_device_operations {
int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
long (*direct_access)(struct block_device *, sector_t, void __pmem **, long (*direct_access)(struct block_device *, sector_t, void __pmem **,
unsigned long *pfn, long size); unsigned long *pfn);
unsigned int (*check_events) (struct gendisk *disk, unsigned int (*check_events) (struct gendisk *disk,
unsigned int clearing); unsigned int clearing);
/* ->media_changed() is DEPRECATED, use ->check_events() instead */ /* ->media_changed() is DEPRECATED, use ->check_events() instead */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment