summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-01-13 21:58:45 -0700
committerJens Axboe <axboe@fb.com>2015-01-13 21:58:45 -0700
commitd4119ee0e1aa2b74e5e367cbc915e79db7b9e271 (patch)
treedae4e7bebdda0db62a00c5bb3d054a6018d68444 /drivers/block
parent91117a20245b59f70b563523edbf998a62fc6383 (diff)
parentdd22f551ac0ad366f92f601835f6623b83adc331 (diff)
downloadlinux-d4119ee0e1aa2b74e5e367cbc915e79db7b9e271.tar.bz2
Merge branch 'for-3.20/core' into for-3.20/drivers
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/brd.c14
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