From: zhong jiang <zhongjiang@huawei.com>
To: <dsterba@suse.com>
Cc: <jbacik@fb.com>, <clm@fb.com>, <linux-btrfs@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCHv3 2/2] btrfs: change remove_extent_mapping to be void function
Date: Thu, 13 Sep 2018 11:01:15 +0800 [thread overview]
Message-ID: <1536807675-25086-3-git-send-email-zhongjiang@huawei.com> (raw)
In-Reply-To: <1536807675-25086-1-git-send-email-zhongjiang@huawei.com>
remove_extent_mapping use the variable "ret" for return value,
but it is not modified after initialzation. Further, I find that
any of the callers do not handle the return value, so it is safe
to drop the unneeded "ret" and make it to be void function.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
fs/btrfs/extent_map.c | 5 +----
fs/btrfs/extent_map.h | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index c4e2347..81b6a08 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -428,16 +428,13 @@ struct extent_map *search_extent_mapping(struct extent_map_tree *tree,
* Removes @em from @tree. No reference counts are dropped, and no checks
* are done to see if the range is in use
*/
-int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em)
+void remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em)
{
- int ret = 0;
-
WARN_ON(test_bit(EXTENT_FLAG_PINNED, &em->flags));
rb_erase_cached(&em->rb_node, &tree->map);
if (!test_bit(EXTENT_FLAG_LOGGING, &em->flags))
list_del_init(&em->list);
RB_CLEAR_NODE(&em->rb_node);
- return ret;
}
void replace_extent_mapping(struct extent_map_tree *tree,
diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h
index df4e1a5..8798745 100644
--- a/fs/btrfs/extent_map.h
+++ b/fs/btrfs/extent_map.h
@@ -78,7 +78,7 @@ struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree,
u64 start, u64 len);
int add_extent_mapping(struct extent_map_tree *tree,
struct extent_map *em, int modified);
-int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em);
+void remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em);
void replace_extent_mapping(struct extent_map_tree *tree,
struct extent_map *cur,
struct extent_map *new,
--
1.7.12.4
next prev parent reply other threads:[~2018-09-13 3:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-13 3:01 [PATCHv3 0/2] change some function to be void function zhong jiang
2018-09-13 3:01 ` [PATCHv3 1/2] btrfs: change unpin_extent_cache " zhong jiang
2018-09-13 3:01 ` zhong jiang [this message]
2018-09-13 5:52 ` [PATCHv3 2/2] btrfs: change remove_extent_mapping " Nikolay Borisov
2018-09-14 14:16 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1536807675-25086-3-git-send-email-zhongjiang@huawei.com \
--to=zhongjiang@huawei.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=jbacik@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).