aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/brd.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew.r.wilcox@intel.com>2014-06-04 19:07:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 19:54:02 -0400
commita72132c31d580969a38972aaf925915e861cd342 (patch)
tree2535e78b02528630bcefae95d2624ffd1a26b10c /drivers/block/brd.c
parentdd6bd0d9c7dbb3951005db4e424abbd37c4ff801 (diff)
brd: add support for rw_page()
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com> Cc: Dave Chinner <david@fromorbit.com> Cc: Dheeraj Reddy <dheeraj.reddy@intel.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/brd.c')
-rw-r--r--drivers/block/brd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index e73b85cf0756..807d3d5d2fe5 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -360,6 +360,15 @@ out:
360 bio_endio(bio, err); 360 bio_endio(bio, err);
361} 361}
362 362
363static int brd_rw_page(struct block_device *bdev, sector_t sector,
364 struct page *page, int rw)
365{
366 struct brd_device *brd = bdev->bd_disk->private_data;
367 int err = brd_do_bvec(brd, page, PAGE_CACHE_SIZE, 0, rw, sector);
368 page_endio(page, rw & WRITE, err);
369 return err;
370}
371
363#ifdef CONFIG_BLK_DEV_XIP 372#ifdef CONFIG_BLK_DEV_XIP
364static int brd_direct_access(struct block_device *bdev, sector_t sector, 373static int brd_direct_access(struct block_device *bdev, sector_t sector,
365 void **kaddr, unsigned long *pfn) 374 void **kaddr, unsigned long *pfn)
@@ -419,6 +428,7 @@ static int brd_ioctl(struct block_device *bdev, fmode_t mode,
419 428
420static const struct block_device_operations brd_fops = { 429static const struct block_device_operations brd_fops = {
421 .owner = THIS_MODULE, 430 .owner = THIS_MODULE,
431 .rw_page = brd_rw_page,
422 .ioctl = brd_ioctl, 432 .ioctl = brd_ioctl,
423#ifdef CONFIG_BLK_DEV_XIP 433#ifdef CONFIG_BLK_DEV_XIP
424 .direct_access = brd_direct_access, 434 .direct_access = brd_direct_access,