ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2: Remove repeated uptodate check for buffer
@ 2021-04-25  2:57 Wan Jiabing
  2021-04-25  6:20 ` Joseph Qi
  0 siblings, 1 reply; 2+ messages in thread
From: Wan Jiabing @ 2021-04-25  2:57 UTC (permalink / raw)
  To: Mark Fasheh, Joel Becker, Joseph Qi, ocfs2-devel, linux-kernel
  Cc: kael_w, Wan Jiabing

In commit 60f91826ca62 ("buffer: Avoid setting buffer bits that are
already set"), function set_buffer_##name was added a test_bit() to
check buffer, which is the same as function buffer_##name.
The !buffer_uptodate(bh) here is a repeated check. Remove it.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
 fs/ocfs2/aops.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index ad20403b383f..bd039fdbb27e 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -634,8 +634,7 @@ int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno,
 		}
 
 		if (PageUptodate(page)) {
-			if (!buffer_uptodate(bh))
-				set_buffer_uptodate(bh);
+			set_buffer_uptodate(bh);
 		} else if (!buffer_uptodate(bh) && !buffer_delay(bh) &&
 			   !buffer_new(bh) &&
 			   ocfs2_should_read_blk(inode, page, block_start) &&
-- 
2.25.1


_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

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

* Re: [Ocfs2-devel] [PATCH] ocfs2: Remove repeated uptodate check for buffer
  2021-04-25  2:57 [Ocfs2-devel] [PATCH] ocfs2: Remove repeated uptodate check for buffer Wan Jiabing
@ 2021-04-25  6:20 ` Joseph Qi
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph Qi @ 2021-04-25  6:20 UTC (permalink / raw)
  To: Wan Jiabing, Mark Fasheh, Joel Becker, ocfs2-devel, linux-kernel, akpm
  Cc: kael_w



On 4/25/21 10:57 AM, Wan Jiabing wrote:
> In commit 60f91826ca62 ("buffer: Avoid setting buffer bits that are
> already set"), function set_buffer_##name was added a test_bit() to
> check buffer, which is the same as function buffer_##name.
> The !buffer_uptodate(bh) here is a repeated check. Remove it.
> 
> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>

Looks good.
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>

> ---
>  fs/ocfs2/aops.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
> index ad20403b383f..bd039fdbb27e 100644
> --- a/fs/ocfs2/aops.c
> +++ b/fs/ocfs2/aops.c
> @@ -634,8 +634,7 @@ int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno,
>  		}
>  
>  		if (PageUptodate(page)) {
> -			if (!buffer_uptodate(bh))
> -				set_buffer_uptodate(bh);
> +			set_buffer_uptodate(bh);
>  		} else if (!buffer_uptodate(bh) && !buffer_delay(bh) &&
>  			   !buffer_new(bh) &&
>  			   ocfs2_should_read_blk(inode, page, block_start) &&
> 

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

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

end of thread, other threads:[~2021-05-13 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25  2:57 [Ocfs2-devel] [PATCH] ocfs2: Remove repeated uptodate check for buffer Wan Jiabing
2021-04-25  6:20 ` Joseph Qi

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