linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: add parameter op_flag in f2fs_submit_page_read()
@ 2020-07-01  2:27 Jia Yang
  2020-07-01  2:33 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Jia Yang @ 2020-07-01  2:27 UTC (permalink / raw)
  To: yuchao0, jaegeuk; +Cc: linux-f2fs-devel

The parameter op_flag is not used in f2fs_get_read_data_page(),
but it is used in f2fs_grab_read_bio(). Obviously, op_flag is
not passed to f2fs_grab_read_bio() successfully. We need to add
parameter in f2fs_submit_page_read() to pass it.

The case:
- gc_data_segment
 - f2fs_get_read_data_page(.., op_flag = REQ_RAHEAD,..)
  - f2fs_submit_page_read
   - f2fs_grab_read_bio(.., op_flag = 0, ..)

Signed-off-by: Jia Yang <jiayang5@huawei.com>
---
 fs/f2fs/data.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 326c63879ddc..7935dba78d84 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1025,12 +1025,13 @@ static void f2fs_release_read_bio(struct bio *bio)
 
 /* This can handle encryption stuffs */
 static int f2fs_submit_page_read(struct inode *inode, struct page *page,
-						block_t blkaddr, bool for_write)
+				 block_t blkaddr, int op_flags, bool for_write)
 {
 	struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
 	struct bio *bio;
 
-	bio = f2fs_grab_read_bio(inode, blkaddr, 1, 0, page->index, for_write);
+	bio = f2fs_grab_read_bio(inode, blkaddr, 1, op_flags,
+					page->index, for_write);
 	if (IS_ERR(bio))
 		return PTR_ERR(bio);
 
@@ -1217,7 +1218,7 @@ struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
 		return page;
 	}
 
-	err = f2fs_submit_page_read(inode, page, dn.data_blkaddr, for_write);
+	err = f2fs_submit_page_read(inode, page, dn.data_blkaddr, op_flags, for_write);
 	if (err)
 		goto put_err;
 	return page;
@@ -3382,7 +3383,7 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
 			err = -EFSCORRUPTED;
 			goto fail;
 		}
-		err = f2fs_submit_page_read(inode, page, blkaddr, true);
+		err = f2fs_submit_page_read(inode, page, blkaddr, 0, true);
 		if (err)
 			goto fail;
 
-- 
2.26.0.106.g9fadedd



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: add parameter op_flag in f2fs_submit_page_read()
  2020-07-01  2:27 [f2fs-dev] [PATCH] f2fs: add parameter op_flag in f2fs_submit_page_read() Jia Yang
@ 2020-07-01  2:33 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2020-07-01  2:33 UTC (permalink / raw)
  To: Jia Yang, jaegeuk; +Cc: linux-f2fs-devel

On 2020/7/1 10:27, Jia Yang wrote:
> The parameter op_flag is not used in f2fs_get_read_data_page(),
> but it is used in f2fs_grab_read_bio(). Obviously, op_flag is
> not passed to f2fs_grab_read_bio() successfully. We need to add
> parameter in f2fs_submit_page_read() to pass it.
> 
> The case:
> - gc_data_segment
>  - f2fs_get_read_data_page(.., op_flag = REQ_RAHEAD,..)
>   - f2fs_submit_page_read
>    - f2fs_grab_read_bio(.., op_flag = 0, ..)
> 
> Signed-off-by: Jia Yang <jiayang5@huawei.com>
> ---
>  fs/f2fs/data.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 326c63879ddc..7935dba78d84 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -1025,12 +1025,13 @@ static void f2fs_release_read_bio(struct bio *bio)
>  
>  /* This can handle encryption stuffs */
>  static int f2fs_submit_page_read(struct inode *inode, struct page *page,
> -						block_t blkaddr, bool for_write)
> +				 block_t blkaddr, int op_flags, bool for_write)
>  {
>  	struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
>  	struct bio *bio;
>  
> -	bio = f2fs_grab_read_bio(inode, blkaddr, 1, 0, page->index, for_write);
> +	bio = f2fs_grab_read_bio(inode, blkaddr, 1, op_flags,
> +					page->index, for_write);
>  	if (IS_ERR(bio))
>  		return PTR_ERR(bio);
>  
> @@ -1217,7 +1218,7 @@ struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
>  		return page;
>  	}
>  
> -	err = f2fs_submit_page_read(inode, page, dn.data_blkaddr, for_write);
> +	err = f2fs_submit_page_read(inode, page, dn.data_blkaddr, op_flags, for_write);

Except logs message or structure fields comments, I prefer keeping 80 characters
alignment for other parts.

I guess Jaegeuk could help to fix this.

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

>  	if (err)
>  		goto put_err;
>  	return page;
> @@ -3382,7 +3383,7 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
>  			err = -EFSCORRUPTED;
>  			goto fail;
>  		}
> -		err = f2fs_submit_page_read(inode, page, blkaddr, true);
> +		err = f2fs_submit_page_read(inode, page, blkaddr, 0, true);
>  		if (err)
>  			goto fail;
>  
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-01  2:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01  2:27 [f2fs-dev] [PATCH] f2fs: add parameter op_flag in f2fs_submit_page_read() Jia Yang
2020-07-01  2:33 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).