* [PATCH] btrfs: make unpin_extent_cache return void [not found] <20230614072710.34392-1-luojianhong@cdjrlc.com> @ 2023-06-14 7:29 ` baomingtong001 2023-06-14 7:35 ` Qu Wenruo 0 siblings, 1 reply; 2+ messages in thread From: baomingtong001 @ 2023-06-14 7:29 UTC (permalink / raw) To: clm, josef, dsterba; +Cc: linux-btrfs, linux-kernel The return value of unpin_extent_cache is always 0, and its caller does not check its return value. Signed-off-by: Mingtong Bao <baomingtong001@208suo.com> --- fs/btrfs/extent_map.c | 3 +-- fs/btrfs/extent_map.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index f3e9aaeb9956..845994b47998 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -292,7 +292,7 @@ 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, +void unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, u64 gen) { struct extent_map *em; @@ -326,7 +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 0; } 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] 2+ messages in thread
* Re: [PATCH] btrfs: make unpin_extent_cache return void 2023-06-14 7:29 ` [PATCH] btrfs: make unpin_extent_cache return void baomingtong001 @ 2023-06-14 7:35 ` Qu Wenruo 0 siblings, 0 replies; 2+ messages in thread From: Qu Wenruo @ 2023-06-14 7:35 UTC (permalink / raw) To: baomingtong001, clm, josef, dsterba; +Cc: linux-btrfs, linux-kernel On 2023/6/14 15:29, baomingtong001@208suo.com wrote: > The return value of unpin_extent_cache is always 0, > and its caller does not check its return value. > > Signed-off-by: Mingtong Bao <baomingtong001@208suo.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Thanks, Qu > --- > fs/btrfs/extent_map.c | 3 +-- > fs/btrfs/extent_map.h | 2 +- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c > index f3e9aaeb9956..845994b47998 100644 > --- a/fs/btrfs/extent_map.c > +++ b/fs/btrfs/extent_map.c > @@ -292,7 +292,7 @@ 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, > +void unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, > u64 gen) > { > struct extent_map *em; > @@ -326,7 +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 0; > > } > > 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 [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-14 7:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230614072710.34392-1-luojianhong@cdjrlc.com>
2023-06-14 7:29 ` [PATCH] btrfs: make unpin_extent_cache return void baomingtong001
2023-06-14 7:35 ` Qu Wenruo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox