All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 08/22] btrfs: drop fs_info parameter from tree_mod_log_insert_key
Date: Thu,  8 Mar 2018 15:33:24 +0100	[thread overview]
Message-ID: <4bdee5b65d772cab68146e1327da37f62ed18ab0.1520518876.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1520518876.git.dsterba@suse.com>

It's provided by the extent_buffer.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/ctree.c | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 3b707af76579..60e27bef0e27 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -536,28 +536,26 @@ alloc_tree_mod_elem(struct extent_buffer *eb, int slot,
 	return tm;
 }
 
-static noinline int
-tree_mod_log_insert_key(struct btrfs_fs_info *fs_info,
-			struct extent_buffer *eb, int slot,
-			enum mod_log_op op, gfp_t flags)
+static noinline int tree_mod_log_insert_key(struct extent_buffer *eb, int slot,
+		enum mod_log_op op, gfp_t flags)
 {
 	struct tree_mod_elem *tm;
 	int ret;
 
-	if (!tree_mod_need_log(fs_info, eb))
+	if (!tree_mod_need_log(eb->fs_info, eb))
 		return 0;
 
 	tm = alloc_tree_mod_elem(eb, slot, op, flags);
 	if (!tm)
 		return -ENOMEM;
 
-	if (tree_mod_dont_log(fs_info, eb)) {
+	if (tree_mod_dont_log(eb->fs_info, eb)) {
 		kfree(tm);
 		return 0;
 	}
 
-	ret = __tree_mod_log_insert(fs_info, tm);
-	tree_mod_log_write_unlock(fs_info);
+	ret = __tree_mod_log_insert(eb->fs_info, tm);
+	tree_mod_log_write_unlock(eb->fs_info);
 	if (ret)
 		kfree(tm);
 
@@ -879,8 +877,7 @@ static noinline void tree_mod_log_set_node_key(struct extent_buffer *eb,
 {
 	int ret;
 
-	ret = tree_mod_log_insert_key(eb->fs_info, eb, slot,
-					MOD_LOG_KEY_REPLACE,
+	ret = tree_mod_log_insert_key(eb, slot, MOD_LOG_KEY_REPLACE,
 					atomic ? GFP_ATOMIC : GFP_NOFS);
 	BUG_ON(ret < 0);
 }
@@ -1178,7 +1175,7 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
 		add_root_to_dirty_list(root);
 	} else {
 		WARN_ON(trans->transid != btrfs_header_generation(parent));
-		tree_mod_log_insert_key(fs_info, parent, parent_slot,
+		tree_mod_log_insert_key(parent, parent_slot,
 					MOD_LOG_KEY_REPLACE, GFP_NOFS);
 		btrfs_set_node_blockptr(parent, parent_slot,
 					cow->start);
@@ -3441,8 +3438,8 @@ static void insert_ptr(struct btrfs_trans_handle *trans,
 			      (nritems - slot) * sizeof(struct btrfs_key_ptr));
 	}
 	if (level) {
-		ret = tree_mod_log_insert_key(fs_info, lower, slot,
-					      MOD_LOG_KEY_ADD, GFP_NOFS);
+		ret = tree_mod_log_insert_key(lower, slot, MOD_LOG_KEY_ADD,
+				GFP_NOFS);
 		BUG_ON(ret < 0);
 	}
 	btrfs_set_node_key(lower, key, slot);
@@ -4914,8 +4911,8 @@ static void del_ptr(struct btrfs_root *root, struct btrfs_path *path,
 			      sizeof(struct btrfs_key_ptr) *
 			      (nritems - slot - 1));
 	} else if (level) {
-		ret = tree_mod_log_insert_key(fs_info, parent, slot,
-					      MOD_LOG_KEY_REMOVE, GFP_NOFS);
+		ret = tree_mod_log_insert_key(parent, slot, MOD_LOG_KEY_REMOVE,
+				GFP_NOFS);
 		BUG_ON(ret < 0);
 	}
 
-- 
2.16.2


  parent reply	other threads:[~2018-03-08 14:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08 14:33 [PATCH 00/22] Misc cleanups David Sterba
2018-03-08 14:33 ` [PATCH 01/22] btrfs: assume that bio_ret is always valid in submit_extent_page David Sterba
2018-03-08 14:33 ` [PATCH 02/22] btrfs: assume that prev_em_start is always valid in __do_readpage David Sterba
2018-03-13 15:03   ` Anand Jain
2018-03-16 16:12     ` David Sterba
2018-03-08 14:33 ` [PATCH 03/22] btrfs: remove redundant variable " David Sterba
2018-03-08 14:33 ` [PATCH 04/22] btrfs: cleanup merging conditions in submit_extent_page David Sterba
2018-03-08 14:33 ` [PATCH 05/22] btrfs: document more parameters of submit_extent_page David Sterba
2018-03-08 14:33 ` [PATCH 06/22] btrfs: drop fs_info parameter from tree_mod_log_set_node_key David Sterba
2018-03-08 14:33 ` [PATCH 07/22] btrfs: drop fs_info parameter from tree_mod_log_insert_move David Sterba
2018-03-08 14:33 ` David Sterba [this message]
2018-03-08 14:33 ` [PATCH 09/22] btrfs: drop fs_info parameter from tree_mod_log_free_eb David Sterba
2018-03-08 14:33 ` [PATCH 10/22] " David Sterba
2018-03-08 14:33 ` [PATCH 11/22] btrfs: drop unused fs_info parameter from tree_mod_log_eb_move David Sterba
2018-03-08 14:33 ` [PATCH 12/22] btrfs: embed tree_mod_move structure to tree_mod_elem David Sterba
2018-03-08 14:33 ` [PATCH 13/22] btrfs: drop fs_info parameter from __tree_mod_log_oldest_root David Sterba
2018-03-08 14:33 ` [PATCH 14/22] btrfs: remove trivial locking wrappers of tree mod log David Sterba
2018-03-08 15:37   ` Nikolay Borisov
2018-03-08 15:56     ` David Sterba
2018-03-08 14:33 ` [PATCH 15/22] btrfs: kill trivial wrapper tree_mod_log_eb_move David Sterba
2018-03-08 14:33 ` [PATCH 16/22] btrfs: kill tree_mod_log_set_node_key helper David Sterba
2018-03-08 14:33 ` [PATCH 17/22] btrfs: kill tree_mod_log_set_root_pointer helper David Sterba
2018-03-08 15:40   ` Nikolay Borisov
2018-03-08 14:33 ` [PATCH 18/22] btrfs: move allocation after simple tests in tree_mod_log_insert_key David Sterba
2018-03-08 15:26   ` Filipe Manana
2018-03-08 15:54     ` David Sterba
2018-03-08 14:33 ` [PATCH 19/22] btrfs: separate types for submit_bio_start and submit_bio_done David Sterba
2018-03-08 14:33 ` [PATCH 20/22] btrfs: remove unused parameters from extent_submit_bio_start_t David Sterba
2018-03-08 14:33 ` [PATCH 21/22] btrfs: remove unused parameters from extent_submit_bio_done_t David Sterba
2018-03-08 14:33 ` [PATCH 22/22] btrfs: rename submit callbacks and drop double underscores 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=4bdee5b65d772cab68146e1327da37f62ed18ab0.1520518876.git.dsterba@suse.com \
    --to=dsterba@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.