[Ocfs2-devel] [PATCH v21 22/30] ocfs2: Provide a splice-read stub

Joseph Qi joseph.qi at linux.alibaba.com
Mon May 22 06:54:53 UTC 2023



On 5/22/23 2:49 PM, David Howells wrote:
> So something like the attached changes?  Any suggestions as to how to improve
> the comments?
> 

Looks fine to me now. Thanks.

Reviewed-by: Joseph Qi <joseph.qi at linux.alibaba.com>

> David
> ---
> diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
> index f7e00b5689d5..86add13b5f23 100644
> --- a/fs/ocfs2/file.c
> +++ b/fs/ocfs2/file.c
> @@ -2552,7 +2552,7 @@ static ssize_t ocfs2_file_read_iter(struct kiocb *iocb,
>  	 *
>  	 * Take and drop the meta data lock to update inode fields
>  	 * like i_size. This allows the checks down below
> -	 * generic_file_read_iter() a chance of actually working.
> +	 * copy_splice_read() a chance of actually working.
>  	 */
>  	ret = ocfs2_inode_lock_atime(inode, filp->f_path.mnt, &lock_level,
>  				     !nowait);
> @@ -2593,7 +2593,7 @@ static ssize_t ocfs2_file_splice_read(struct file *in, loff_t *ppos,
>  				     (unsigned long long)OCFS2_I(inode)->ip_blkno,
>  				     in->f_path.dentry->d_name.len,
>  				     in->f_path.dentry->d_name.name,
> -				     0);
> +				     flags);
>  
>  	/*
>  	 * We're fine letting folks race truncates and extending writes with
> @@ -2601,10 +2601,10 @@ static ssize_t ocfs2_file_splice_read(struct file *in, loff_t *ppos,
>  	 * rw_lock during read.
>  	 *
>  	 * Take and drop the meta data lock to update inode fields like i_size.
> -	 * This allows the checks down below generic_file_splice_read() a
> -	 * chance of actually working.
> +	 * This allows the checks down below filemap_splice_read() a chance of
> +	 * actually working.
>  	 */
> -	ret = ocfs2_inode_lock_atime(inode, in->f_path.mnt, &lock_level, true);
> +	ret = ocfs2_inode_lock_atime(inode, in->f_path.mnt, &lock_level, 1);
>  	if (ret < 0) {
>  		if (ret != -EAGAIN)
>  			mlog_errno(ret);



More information about the Ocfs2-devel mailing list