From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 6/6] btrfs: Remove new_dirid argument from btrfs_create_subvol_root
Date: Mon, 7 Dec 2020 17:32:37 +0200 [thread overview]
Message-ID: <20201207153237.1073887-7-nborisov@suse.com> (raw)
In-Reply-To: <20201207153237.1073887-1-nborisov@suse.com>
It's no longer used. While at it also remove new_dirid in create_subvol
as it's used in a single place and open code it. No functional changes.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/ctree.h | 3 +--
fs/btrfs/inode.c | 3 +--
fs/btrfs/ioctl.c | 5 ++---
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index e8652c73c189..616a4c6fefc3 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3089,8 +3089,7 @@ int btrfs_set_extent_delalloc(struct btrfs_inode *inode, u64 start, u64 end,
struct extent_state **cached_state);
int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
struct btrfs_root *new_root,
- struct btrfs_root *parent_root,
- u64 new_dirid);
+ struct btrfs_root *parent_root);
void btrfs_set_delalloc_extent(struct inode *inode, struct extent_state *state,
unsigned *bits);
void btrfs_clear_delalloc_extent(struct inode *inode,
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index aea76abd83ba..b82c5bde6a3e 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8577,8 +8577,7 @@ static int btrfs_truncate(struct inode *inode, bool skip_writeback)
*/
int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
struct btrfs_root *new_root,
- struct btrfs_root *parent_root,
- u64 new_dirid)
+ struct btrfs_root *parent_root)
{
struct inode *inode;
int err;
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 58b9a27559c0..db29c1b54daa 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -606,7 +606,6 @@ static noinline int create_subvol(struct inode *dir,
int err;
dev_t anon_dev = 0;
u64 objectid;
- u64 new_dirid = BTRFS_FIRST_FREE_OBJECTID;
u64 index = 0;
root_item = kzalloc(sizeof(*root_item), GFP_KERNEL);
@@ -693,7 +692,7 @@ static noinline int create_subvol(struct inode *dir,
free_extent_buffer(leaf);
leaf = NULL;
- btrfs_set_root_dirid(root_item, new_dirid);
+ btrfs_set_root_dirid(root_item, BTRFS_FIRST_FREE_OBJECTID);
key.objectid = objectid;
key.offset = 0;
@@ -716,7 +715,7 @@ static noinline int create_subvol(struct inode *dir,
btrfs_record_root_in_trans(trans, new_root);
- ret = btrfs_create_subvol_root(trans, new_root, root, new_dirid);
+ ret = btrfs_create_subvol_root(trans, new_root, root);
btrfs_put_root(new_root);
if (ret) {
/* We potentially lose an unused inode item here */
--
2.25.1
next prev parent reply other threads:[~2020-12-07 15:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-07 15:32 [PATCH 0/6] Overhaul free objectid code Nikolay Borisov
2020-12-07 15:32 ` [PATCH 1/6] btrfs: Rename btrfs_find_highest_objectid to btrfs_init_root_free_objectid Nikolay Borisov
2020-12-07 15:32 ` [PATCH 2/6] btrfs: Rename btrfs_find_free_objectid to btrfs_get_free_objectid Nikolay Borisov
2020-12-07 15:32 ` [PATCH 3/6] btrfs: Remove useless ASSERTS Nikolay Borisov
2020-12-15 16:58 ` David Sterba
2020-12-15 17:48 ` Nikolay Borisov
2020-12-18 15:03 ` David Sterba
2020-12-07 15:32 ` [PATCH 4/6] btrfs: Rename highest_objectid to free_objectid Nikolay Borisov
2020-12-07 15:32 ` [PATCH 5/6] btrfs: Make free_objectid hold the next available objectid in the root Nikolay Borisov
2020-12-07 15:32 ` Nikolay Borisov [this message]
2020-12-07 16:19 ` [RESEND PATCH] btrfs: Add test 154 Nikolay Borisov
2020-12-20 14:32 ` Eryu Guan
2020-12-07 16:27 ` [PATCH 0/6] Overhaul free objectid code Josef Bacik
2020-12-15 17:08 ` 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=20201207153237.1073887-7-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