Skip to content

Commit 3cd4617

Browse files
Yang Guotytso
authored andcommitted
ext4: delete redundant uptodate check for buffer
The buffer uptodate state has been checked in function set_buffer_uptodate, there is no need use buffer_uptodate before calling set_buffer_uptodate and delete it. Cc: "Theodore Ts'o" <[email protected]> Cc: Andreas Dilger <[email protected]> Signed-off-by: Yang Guo <[email protected]> Signed-off-by: Shaokun Zhang <[email protected]> Reviewed-by: Ritesh Harjani <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 72ffb49 commit 3cd4617

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/ext4/inode.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,8 +1066,7 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len,
10661066
block_end = block_start + blocksize;
10671067
if (block_end <= from || block_start >= to) {
10681068
if (PageUptodate(page)) {
1069-
if (!buffer_uptodate(bh))
1070-
set_buffer_uptodate(bh);
1069+
set_buffer_uptodate(bh);
10711070
}
10721071
continue;
10731072
}
@@ -1092,8 +1091,7 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len,
10921091
}
10931092
}
10941093
if (PageUptodate(page)) {
1095-
if (!buffer_uptodate(bh))
1096-
set_buffer_uptodate(bh);
1094+
set_buffer_uptodate(bh);
10971095
continue;
10981096
}
10991097
if (!buffer_uptodate(bh) && !buffer_delay(bh) &&

0 commit comments

Comments
 (0)