* [PATCH 0/2] btrfs: cleanups for a couple log tree functions
@ 2025-11-19 13:19 fdmanana
2025-11-19 13:19 ` [PATCH 1/2] btrfs: remove root argument from btrfs_del_dir_entries_in_log() fdmanana
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: fdmanana @ 2025-11-19 13:19 UTC (permalink / raw)
To: linux-btrfs
From: Filipe Manana <fdmanana@suse.com>
A couple of trivial cleanups for the argument list of two log tree
functions.
Filipe Manana (2):
btrfs: remove root argument from btrfs_del_dir_entries_in_log()
btrfs: reduce arguments to btrfs_del_inode_ref_in_log()
fs/btrfs/inode.c | 4 ++--
fs/btrfs/tree-log.c | 12 ++++++------
fs/btrfs/tree-log.h | 5 ++---
3 files changed, 10 insertions(+), 11 deletions(-)
--
2.47.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] btrfs: remove root argument from btrfs_del_dir_entries_in_log()
2025-11-19 13:19 [PATCH 0/2] btrfs: cleanups for a couple log tree functions fdmanana
@ 2025-11-19 13:19 ` fdmanana
2025-11-19 13:19 ` [PATCH 2/2] btrfs: reduce arguments to btrfs_del_inode_ref_in_log() fdmanana
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: fdmanana @ 2025-11-19 13:19 UTC (permalink / raw)
To: linux-btrfs
From: Filipe Manana <fdmanana@suse.com>
There's no need to pass the root as we can extract it from the directory
inode, so remove it.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
fs/btrfs/inode.c | 2 +-
fs/btrfs/tree-log.c | 2 +-
fs/btrfs/tree-log.h | 1 -
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index f71a5f7f55b9..16d416fe536b 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4359,7 +4359,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
*/
if (!rename_ctx) {
btrfs_del_inode_ref_in_log(trans, root, name, inode, dir_ino);
- btrfs_del_dir_entries_in_log(trans, root, name, dir, index);
+ btrfs_del_dir_entries_in_log(trans, name, dir, index);
}
/*
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index cc27f87c4904..c2e45e64ab6c 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3900,10 +3900,10 @@ static int del_logged_dentry(struct btrfs_trans_handle *trans,
* or the entire directory.
*/
void btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
const struct fscrypt_str *name,
struct btrfs_inode *dir, u64 index)
{
+ struct btrfs_root *root = dir->root;
BTRFS_PATH_AUTO_FREE(path);
int ret;
diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h
index 4f149d7d4fde..a0aeec2448c0 100644
--- a/fs/btrfs/tree-log.h
+++ b/fs/btrfs/tree-log.h
@@ -79,7 +79,6 @@ int btrfs_log_dentry_safe(struct btrfs_trans_handle *trans,
struct dentry *dentry,
struct btrfs_log_ctx *ctx);
void btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
const struct fscrypt_str *name,
struct btrfs_inode *dir, u64 index);
void btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans,
--
2.47.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] btrfs: reduce arguments to btrfs_del_inode_ref_in_log()
2025-11-19 13:19 [PATCH 0/2] btrfs: cleanups for a couple log tree functions fdmanana
2025-11-19 13:19 ` [PATCH 1/2] btrfs: remove root argument from btrfs_del_dir_entries_in_log() fdmanana
@ 2025-11-19 13:19 ` fdmanana
2025-11-19 21:21 ` [PATCH 0/2] btrfs: cleanups for a couple log tree functions Qu Wenruo
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: fdmanana @ 2025-11-19 13:19 UTC (permalink / raw)
To: linux-btrfs
From: Filipe Manana <fdmanana@suse.com>
Instead of passing a root and the objectid of the parent directory, just
pass the directory inode, as like that we can extract both the root and
the objectid, reducing the number of arguments by one. It also makes the
function more consistent with other log tree functions in the sense that
we pass the inode and not only its objectid.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
fs/btrfs/inode.c | 2 +-
fs/btrfs/tree-log.c | 10 +++++-----
fs/btrfs/tree-log.h | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 16d416fe536b..8ace17f3eb42 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4358,7 +4358,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
* operations on the log tree, increasing latency for applications.
*/
if (!rename_ctx) {
- btrfs_del_inode_ref_in_log(trans, root, name, inode, dir_ino);
+ btrfs_del_inode_ref_in_log(trans, name, inode, dir);
btrfs_del_dir_entries_in_log(trans, name, dir, index);
}
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index c2e45e64ab6c..42c9327e0c12 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3938,11 +3938,11 @@ void btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
/* see comments for btrfs_del_dir_entries_in_log */
void btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
const struct fscrypt_str *name,
- struct btrfs_inode *inode, u64 dirid)
+ struct btrfs_inode *inode,
+ struct btrfs_inode *dir)
{
- struct btrfs_root *log;
+ struct btrfs_root *root = dir->root;
int ret;
ret = inode_logged(trans, inode, NULL);
@@ -3957,10 +3957,10 @@ void btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans,
ASSERT(ret == 0, "join_running_log_trans() ret=%d", ret);
if (WARN_ON(ret))
return;
- log = root->log_root;
mutex_lock(&inode->log_mutex);
- ret = btrfs_del_inode_ref(trans, log, name, btrfs_ino(inode), dirid, NULL);
+ ret = btrfs_del_inode_ref(trans, root->log_root, name, btrfs_ino(inode),
+ btrfs_ino(dir), NULL);
mutex_unlock(&inode->log_mutex);
if (ret < 0 && ret != -ENOENT)
btrfs_set_log_full_commit(trans);
diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h
index a0aeec2448c0..41e47fda036d 100644
--- a/fs/btrfs/tree-log.h
+++ b/fs/btrfs/tree-log.h
@@ -82,9 +82,9 @@ void btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
const struct fscrypt_str *name,
struct btrfs_inode *dir, u64 index);
void btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
const struct fscrypt_str *name,
- struct btrfs_inode *inode, u64 dirid);
+ struct btrfs_inode *inode,
+ struct btrfs_inode *dir);
void btrfs_end_log_trans(struct btrfs_root *root);
void btrfs_pin_log_trans(struct btrfs_root *root);
void btrfs_record_unlink_dir(struct btrfs_trans_handle *trans,
--
2.47.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] btrfs: cleanups for a couple log tree functions
2025-11-19 13:19 [PATCH 0/2] btrfs: cleanups for a couple log tree functions fdmanana
2025-11-19 13:19 ` [PATCH 1/2] btrfs: remove root argument from btrfs_del_dir_entries_in_log() fdmanana
2025-11-19 13:19 ` [PATCH 2/2] btrfs: reduce arguments to btrfs_del_inode_ref_in_log() fdmanana
@ 2025-11-19 21:21 ` Qu Wenruo
2025-11-20 8:42 ` Johannes Thumshirn
2025-11-20 11:44 ` David Sterba
4 siblings, 0 replies; 6+ messages in thread
From: Qu Wenruo @ 2025-11-19 21:21 UTC (permalink / raw)
To: fdmanana, linux-btrfs
在 2025/11/19 23:49, fdmanana@kernel.org 写道:
> From: Filipe Manana <fdmanana@suse.com>
>
> A couple of trivial cleanups for the argument list of two log tree
> functions.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
>
> Filipe Manana (2):
> btrfs: remove root argument from btrfs_del_dir_entries_in_log()
> btrfs: reduce arguments to btrfs_del_inode_ref_in_log()
>
> fs/btrfs/inode.c | 4 ++--
> fs/btrfs/tree-log.c | 12 ++++++------
> fs/btrfs/tree-log.h | 5 ++---
> 3 files changed, 10 insertions(+), 11 deletions(-)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] btrfs: cleanups for a couple log tree functions
2025-11-19 13:19 [PATCH 0/2] btrfs: cleanups for a couple log tree functions fdmanana
` (2 preceding siblings ...)
2025-11-19 21:21 ` [PATCH 0/2] btrfs: cleanups for a couple log tree functions Qu Wenruo
@ 2025-11-20 8:42 ` Johannes Thumshirn
2025-11-20 11:44 ` David Sterba
4 siblings, 0 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2025-11-20 8:42 UTC (permalink / raw)
To: fdmanana@kernel.org, linux-btrfs@vger.kernel.org
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] btrfs: cleanups for a couple log tree functions
2025-11-19 13:19 [PATCH 0/2] btrfs: cleanups for a couple log tree functions fdmanana
` (3 preceding siblings ...)
2025-11-20 8:42 ` Johannes Thumshirn
@ 2025-11-20 11:44 ` David Sterba
4 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2025-11-20 11:44 UTC (permalink / raw)
To: fdmanana; +Cc: linux-btrfs
On Wed, Nov 19, 2025 at 01:19:06PM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> A couple of trivial cleanups for the argument list of two log tree
> functions.
>
> Filipe Manana (2):
> btrfs: remove root argument from btrfs_del_dir_entries_in_log()
> btrfs: reduce arguments to btrfs_del_inode_ref_in_log()
Reviewed-by: David Sterba <dsterba@suse.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-11-20 11:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19 13:19 [PATCH 0/2] btrfs: cleanups for a couple log tree functions fdmanana
2025-11-19 13:19 ` [PATCH 1/2] btrfs: remove root argument from btrfs_del_dir_entries_in_log() fdmanana
2025-11-19 13:19 ` [PATCH 2/2] btrfs: reduce arguments to btrfs_del_inode_ref_in_log() fdmanana
2025-11-19 21:21 ` [PATCH 0/2] btrfs: cleanups for a couple log tree functions Qu Wenruo
2025-11-20 8:42 ` Johannes Thumshirn
2025-11-20 11:44 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox