diff options
author | Christoph Hellwig <hch@lst.de> | 2016-09-19 11:24:49 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-09-19 11:24:49 +1000 |
commit | b0d5e82fcf8249b5aca52d235c1cfabd68b253e8 (patch) | |
tree | 2339be43d048f78c3aac15fbf1b3bd823f3d73b6 | |
parent | 1aaba0958ed371bd121751d74d98f2a76395edad (diff) | |
download | linux-stable-b0d5e82fcf8249b5aca52d235c1cfabd68b253e8.tar.gz linux-stable-b0d5e82fcf8249b5aca52d235c1cfabd68b253e8.tar.bz2 linux-stable-b0d5e82fcf8249b5aca52d235c1cfabd68b253e8.zip |
dax: don't pass buffer_head to copy_user_dax
This way we can use this helper for the iomap based DAX implementation
as well.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r-- | fs/dax.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -580,14 +580,13 @@ static int dax_load_hole(struct address_space *mapping, void *entry, return VM_FAULT_LOCKED; } -static int copy_user_bh(struct page *to, struct inode *inode, - struct buffer_head *bh, unsigned long vaddr) +static int copy_user_dax(struct block_device *bdev, sector_t sector, size_t size, + struct page *to, unsigned long vaddr) { struct blk_dax_ctl dax = { - .sector = to_sector(bh, inode), - .size = bh->b_size, + .sector = sector, + .size = size, }; - struct block_device *bdev = bh->b_bdev; void *vto; if (dax_map_atomic(bdev, &dax) < 0) @@ -867,7 +866,8 @@ int dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf, if (vmf->cow_page) { struct page *new_page = vmf->cow_page; if (buffer_written(&bh)) - error = copy_user_bh(new_page, inode, &bh, vaddr); + error = copy_user_dax(bh.b_bdev, to_sector(&bh, inode), + bh.b_size, new_page, vaddr); else clear_user_highpage(new_page, vaddr); if (error) |