diff options
author | Jens Axboe <axboe@fb.com> | 2015-01-14 07:58:45 +0300 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-01-14 07:58:45 +0300 |
commit | d4119ee0e1aa2b74e5e367cbc915e79db7b9e271 (patch) | |
tree | dae4e7bebdda0db62a00c5bb3d054a6018d68444 /drivers/block/brd.c | |
parent | 91117a20245b59f70b563523edbf998a62fc6383 (diff) | |
parent | dd22f551ac0ad366f92f601835f6623b83adc331 (diff) | |
download | linux-d4119ee0e1aa2b74e5e367cbc915e79db7b9e271.tar.xz |
Merge branch 'for-3.20/core' into for-3.20/drivers
Diffstat (limited to 'drivers/block/brd.c')
-rw-r--r-- | drivers/block/brd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c index 3598110d2cef..89e90ec52f28 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -370,25 +370,25 @@ static int brd_rw_page(struct block_device *bdev, sector_t sector, } #ifdef CONFIG_BLK_DEV_XIP -static int brd_direct_access(struct block_device *bdev, sector_t sector, - void **kaddr, unsigned long *pfn) +static long brd_direct_access(struct block_device *bdev, sector_t sector, + void **kaddr, unsigned long *pfn, long size) { struct brd_device *brd = bdev->bd_disk->private_data; struct page *page; if (!brd) return -ENODEV; - if (sector & (PAGE_SECTORS-1)) - return -EINVAL; - if (sector + PAGE_SECTORS > get_capacity(bdev->bd_disk)) - return -ERANGE; page = brd_insert_page(brd, sector); if (!page) return -ENOSPC; *kaddr = page_address(page); *pfn = page_to_pfn(page); - return 0; + /* + * 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; } #endif |