From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 2/3] btrfs-progs: Remove add_cache_extent2
Date: Fri, 4 May 2018 10:47:26 +0300 [thread overview]
Message-ID: <1525420047-17397-3-git-send-email-nborisov@suse.com> (raw)
In-Reply-To: <1525420047-17397-1-git-send-email-nborisov@suse.com>
Commit 17793e3e6a49 ("Btrfs-progs: extend the extent cache for the
device extent") extended the cache extent APIs to support objectid to
distinguish between phyisical extents with same dimensions but on
different devices. However, it seems that this particular function is
not used to allocate a device extent with accompanying objectid.
Instead such extents as processed solely by insert_device_extent_record.
Remove the unused code as a result.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
extent-cache.c | 16 ++--------------
extent-cache.h | 2 --
2 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/extent-cache.c b/extent-cache.c
index 38bed8b5db70..662c801e6760 100644
--- a/extent-cache.c
+++ b/extent-cache.c
@@ -107,10 +107,9 @@ alloc_cache_extent(u64 objectid, u64 start, u64 size)
return pe;
}
-static int __add_cache_extent(struct cache_tree *tree,
- u64 objectid, u64 start, u64 size)
+int add_cache_extent(struct cache_tree *tree, u64 start, u64 size)
{
- struct cache_extent *pe = alloc_cache_extent(objectid, start, size);
+ struct cache_extent *pe = alloc_cache_extent(0, start, size);
int ret;
if (!pe) {
@@ -125,17 +124,6 @@ static int __add_cache_extent(struct cache_tree *tree,
return ret;
}
-int add_cache_extent(struct cache_tree *tree, u64 start, u64 size)
-{
- return __add_cache_extent(tree, 0, start, size);
-}
-
-int add_cache_extent2(struct cache_tree *tree,
- u64 objectid, u64 start, u64 size)
-{
- return __add_cache_extent(tree, objectid, start, size);
-}
-
int insert_cache_extent(struct cache_tree *tree, struct cache_extent *pe)
{
return rb_insert(&tree->root, &pe->rb_node, cache_tree_comp_nodes);
diff --git a/extent-cache.h b/extent-cache.h
index 82db7fa3e463..33d018dd5fef 100644
--- a/extent-cache.h
+++ b/extent-cache.h
@@ -106,8 +106,6 @@ struct cache_extent *search_cache_extent2(struct cache_tree *tree,
*/
struct cache_extent *lookup_cache_extent2(struct cache_tree *tree,
u64 objectid, u64 start, u64 size);
-int add_cache_extent2(struct cache_tree *tree,
- u64 objectid, u64 start, u64 size);
int insert_cache_extent2(struct cache_tree *tree, struct cache_extent *pe);
/*
--
2.7.4
next prev parent reply other threads:[~2018-05-04 7:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-04 7:47 [PATCH 0/3] Misc cleanups to cached extent Nikolay Borisov
2018-05-04 7:47 ` [PATCH 1/3] btrfs-progs: Remove devid parameter from btrfs_rmap_block Nikolay Borisov
2018-05-04 7:47 ` Nikolay Borisov [this message]
2018-05-04 7:47 ` [PATCH 3/3] btrfs-progs: Remove objectid argument from alloc_cache_extent Nikolay Borisov
2018-05-04 8:54 ` [PATCH 0/3] Misc cleanups to cached extent Qu Wenruo
2018-05-08 17:07 ` 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=1525420047-17397-3-git-send-email-nborisov@suse.com \
--to=nborisov@suse.com \
--cc=linux-btrfs@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).