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

From: Joseph Qi
Date: Mon May 22 2023 - 02:57:55 EST




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@xxxxxxxxxxxxxxxxx>

> 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);