Re: [PATCH 03/19] iomap: always use AOP_FLAG_NOFS in iomap_write_begin

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

 



On Mon, Sep 09, 2019 at 08:27:06PM +0200, Christoph Hellwig wrote:
> All callers pass AOP_FLAG_NOFS, so lift that flag to iomap_write_begin
> to allow reusing the flags arguments for an internal flags namespace
> soon.  Also remove the local index variable that is only used once.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

--D

> ---
>  fs/iomap/buffered-io.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 2a9b41352495..33e03992d8a7 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -606,7 +606,6 @@ iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, unsigned flags,
>  		struct page **pagep, struct iomap *iomap)
>  {
>  	const struct iomap_page_ops *page_ops = iomap->page_ops;
> -	pgoff_t index = pos >> PAGE_SHIFT;
>  	struct page *page;
>  	int status = 0;
>  
> @@ -621,7 +620,8 @@ iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, unsigned flags,
>  			return status;
>  	}
>  
> -	page = grab_cache_page_write_begin(inode->i_mapping, index, flags);
> +	page = grab_cache_page_write_begin(inode->i_mapping, pos >> PAGE_SHIFT,
> +			AOP_FLAG_NOFS);
>  	if (!page) {
>  		status = -ENOMEM;
>  		goto out_no_page;
> @@ -763,7 +763,6 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
>  	struct iov_iter *i = data;
>  	long status = 0;
>  	ssize_t written = 0;
> -	unsigned int flags = AOP_FLAG_NOFS;
>  
>  	do {
>  		struct page *page;
> @@ -793,8 +792,7 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
>  			break;
>  		}
>  
> -		status = iomap_write_begin(inode, pos, bytes, flags, &page,
> -				iomap);
> +		status = iomap_write_begin(inode, pos, bytes, 0, &page, iomap);
>  		if (unlikely(status))
>  			break;
>  
> @@ -892,8 +890,7 @@ iomap_dirty_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
>  		if (IS_ERR(rpage))
>  			return PTR_ERR(rpage);
>  
> -		status = iomap_write_begin(inode, pos, bytes,
> -					   AOP_FLAG_NOFS, &page, iomap);
> +		status = iomap_write_begin(inode, pos, bytes, 0, &page, iomap);
>  		put_page(rpage);
>  		if (unlikely(status))
>  			return status;
> @@ -944,8 +941,7 @@ static int iomap_zero(struct inode *inode, loff_t pos, unsigned offset,
>  	struct page *page;
>  	int status;
>  
> -	status = iomap_write_begin(inode, pos, bytes, AOP_FLAG_NOFS, &page,
> -				   iomap);
> +	status = iomap_write_begin(inode, pos, bytes, 0, &page, iomap);
>  	if (status)
>  		return status;
>  
> -- 
> 2.20.1
> 



[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