Skip to contentSkip to conversation

nilfs2 minor amendments

PATCH Applied Ryusuke Konishi 1 participant 3 messages Sep 21, 2022 NILFS2 filesystem

lore
Share & tools
lore

Ryusuke Konishi

author maintainer
#0 lore raw

cover nilfs2 minor amendments

Hi Andrew,

please queue the following changes for the next merge window. Both are minor coding-level fixes by users of a robot reporter.

Minghao Chi (1):
nilfs2: delete unnecessary checks before brelse()

ye xingchen (1):
nilfs2: Remove the unneeded result variable

Thanks,
Ryusuke Konishi
--

 fs/nilfs2/btree.c   | 6 ++----
 fs/nilfs2/segment.c | 4 +---
 2 files changed, 3 insertions(+), 7 deletions(-)
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH 1/2 nilfs2: delete unnecessary checks before brelse()

From: Minghao Chi <[email protected]>

The brelse() inline function tests whether its argument is NULL and then returns immediately.
Thus remove the tests which are not needed around the shown calls.

---
 fs/nilfs2/btree.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/nilfs2/btree.c +2 -4
index 9f4d9432d38a..b9d15c3df3cc 100644
@@ -1668,8 +1668,7 @@ static int nilfs_btree_check_delete(struct nilfs_bmap *btree, __u64 key)
 	maxkey = nilfs_btree_node_get_key(node, nchildren - 1);
 	nextmaxkey = (nchildren > 1) ?
 		nilfs_btree_node_get_key(node, nchildren - 2) : 0;
-	if (bh != NULL)
-		brelse(bh);
+	brelse(bh);
 
 	return (maxkey == key) && (nextmaxkey < NILFS_BMAP_LARGE_LOW);
 }
@@ -1717,8 +1716,7 @@ static int nilfs_btree_gather_data(struct nilfs_bmap *btree,
 		ptrs[i] = le64_to_cpu(dptrs[i]);
 	}
 
-	if (bh != NULL)
-		brelse(bh);
+	brelse(bh);
 
 	return nitems;
 }
Signature · 1 line
2.34.1
author maintainer
#2 lore raw

PATCH 2/2 nilfs2: Remove the unneeded result variable

In reply to Ryusuke Konishi

From: ye xingchen <[email protected]>

Return the value nilfs_segctor_sync() directly instead of storing it in another redundant variable.

---
 fs/nilfs2/segment.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/nilfs2/segment.c +1 -3
index 0afe0832c754..9abae2c9120e 100644
@@ -2235,7 +2235,6 @@ int nilfs_construct_segment(struct super_block *sb)
 	struct the_nilfs *nilfs = sb->s_fs_info;
 	struct nilfs_sc_info *sci = nilfs->ns_writer;
 	struct nilfs_transaction_info *ti;
-	int err;
 
 	if (!sci)
 		return -EROFS;
@@ -2243,8 +2242,7 @@ int nilfs_construct_segment(struct super_block *sb)
 	/* A call inside transactions causes a deadlock. */
 	BUG_ON((ti = current->journal_info) && ti->ti_magic == NILFS_TI_MAGIC);
 
-	err = nilfs_segctor_sync(sci);
-	return err;
+	return nilfs_segctor_sync(sci);
 }
 
 /**
Signature · 1 line
2.34.1