Re: [PATCH 04/10] dax: don't pass buffer_head to copy_user_dax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 09, 2016 at 06:34:38PM +0200, Christoph Hellwig wrote:
> This way we can use this helper for the iomap based DAX implementation
> as well.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Reviewed-by: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx>

> ---
>  fs/dax.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/dax.c b/fs/dax.c
> index 98463bb..84343ce 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -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)
> -- 
> 2.1.4
> 
> _______________________________________________
> Linux-nvdimm mailing list
> Linux-nvdimm@xxxxxxxxxxxx
> https://lists.01.org/mailman/listinfo/linux-nvdimm
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux