[PATCH] btrfs: Remove duplicate 'unlikely()' usage

Kunwu Chan posted 1 patch 1 year, 3 months ago
fs/btrfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] btrfs: Remove duplicate 'unlikely()' usage
Posted by Kunwu Chan 1 year, 3 months ago
From: Kunwu Chan <chentao@kylinos.cn>

nested unlikely() calls, IS_ERR already uses unlikely() internally

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
 fs/btrfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 4b58306e1ef1..cc07ba7313b7 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -898,7 +898,7 @@ static int extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 e
 	for (unsigned long index = start >> PAGE_SHIFT;
 	     index <= end_index; index++) {
 		folio = __filemap_get_folio(inode->i_mapping, index, 0, 0);
-		if (unlikely(IS_ERR(folio))) {
+		if (IS_ERR(folio)) {
 			if (!ret)
 				ret = PTR_ERR(folio);
 			continue;
-- 
2.41.0
Re: [PATCH] btrfs: Remove duplicate 'unlikely()' usage
Posted by David Sterba 1 year, 3 months ago
On Thu, Aug 29, 2024 at 03:29:52PM +0800, Kunwu Chan wrote:
> From: Kunwu Chan <chentao@kylinos.cn>
> 
> nested unlikely() calls, IS_ERR already uses unlikely() internally
> 
> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>

Thanks for noticing it, I've folded the change to the patch "btrfs:
convert extent_range_clear_dirty_for_io() to use a folio"