public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: turn unpin_extent_cache() into a void function
@ 2023-07-18 17:39 Luís Henriques
  2023-07-20  7:12 ` Johannes Thumshirn
  2023-07-20 11:04 ` David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: Luís Henriques @ 2023-07-18 17:39 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba
  Cc: linux-btrfs, linux-kernel, Luís Henriques

The value of the 'ret' variable is never changed in function
unpin_extent_cache().  And since the only caller of this function doesn't
check the return value, it can simply be turned into a void function.

Signed-off-by: Luís Henriques <lhenriques@suse.de>
---
 fs/btrfs/extent_map.c | 7 ++-----
 fs/btrfs/extent_map.h | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 0cdb3e86f29b..f99c458071a4 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -292,10 +292,9 @@ static void try_merge_map(struct extent_map_tree *tree, struct extent_map *em)
  * to the generation that actually added the file item to the inode so we know
  * we need to sync this extent when we call fsync().
  */
-int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len,
-		       u64 gen)
+void unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len,
+			u64 gen)
 {
-	int ret = 0;
 	struct extent_map *em;
 	bool prealloc = false;
 
@@ -327,8 +326,6 @@ int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len,
 	free_extent_map(em);
 out:
 	write_unlock(&tree->lock);
-	return ret;
-
 }
 
 void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em)
diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h
index 35d27c756e08..486a8ea798c7 100644
--- a/fs/btrfs/extent_map.h
+++ b/fs/btrfs/extent_map.h
@@ -97,7 +97,7 @@ struct extent_map *alloc_extent_map(void);
 void free_extent_map(struct extent_map *em);
 int __init extent_map_init(void);
 void __cold extent_map_exit(void);
-int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, u64 gen);
+void unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, u64 gen);
 void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em);
 struct extent_map *search_extent_mapping(struct extent_map_tree *tree,
 					 u64 start, u64 len);

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

end of thread, other threads:[~2023-07-20 11:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18 17:39 [PATCH] btrfs: turn unpin_extent_cache() into a void function Luís Henriques
2023-07-20  7:12 ` Johannes Thumshirn
2023-07-20  9:13   ` Luís Henriques
2023-07-20 11:04 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox