From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 3/3] btrfs-progs: Remove objectid argument from alloc_cache_extent
Date: Fri, 4 May 2018 10:47:27 +0300 [thread overview]
Message-ID: <1525420047-17397-4-git-send-email-nborisov@suse.com> (raw)
In-Reply-To: <1525420047-17397-1-git-send-email-nborisov@suse.com>
This function is always called with objectid set to 0. So remove the
parameter and statically set the ->objectid to 0 when allocating a new
extent.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
extent-cache.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/extent-cache.c b/extent-cache.c
index 662c801e6760..f458de261293 100644
--- a/extent-cache.c
+++ b/extent-cache.c
@@ -93,15 +93,14 @@ void cache_tree_init(struct cache_tree *tree)
tree->root = RB_ROOT;
}
-static struct cache_extent *
-alloc_cache_extent(u64 objectid, u64 start, u64 size)
+static struct cache_extent *alloc_cache_extent(u64 start, u64 size)
{
struct cache_extent *pe = malloc(sizeof(*pe));
if (!pe)
return pe;
- pe->objectid = objectid;
+ pe->objectid = 0;
pe->start = start;
pe->size = size;
return pe;
@@ -109,7 +108,7 @@ alloc_cache_extent(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(0, start, size);
+ struct cache_extent *pe = alloc_cache_extent(start, size);
int ret;
if (!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 ` [PATCH 2/3] btrfs-progs: Remove add_cache_extent2 Nikolay Borisov
2018-05-04 7:47 ` Nikolay Borisov [this message]
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-4-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).