linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 12/14] btrfs: Remove fs_info argument from create_pending_snapshots/create_pending_snapshot
Date: Wed,  7 Feb 2018 17:55:48 +0200	[thread overview]
Message-ID: <1518018950-31456-13-git-send-email-nborisov@suse.com> (raw)
In-Reply-To: <1518018950-31456-1-git-send-email-nborisov@suse.com>

We already pass the trans handle which has a reference to fs_info to
create_pending_snapshot so we can refer to it directly. Doing this
obviates the need to pass the fs_info to create_pending_snapshots as
well. No functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/transaction.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 81143ac1d88d..abee26b269a1 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1435,9 +1435,10 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans,
  * the creation of the pending snapshots, just return 0.
  */
 static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
-				   struct btrfs_fs_info *fs_info,
 				   struct btrfs_pending_snapshot *pending)
 {
+
+	struct btrfs_fs_info *fs_info = trans->fs_info;
 	struct btrfs_key key;
 	struct btrfs_root_item *new_root_item;
 	struct btrfs_root *tree_root = fs_info->tree_root;
@@ -1704,8 +1705,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
 /*
  * create all the snapshots we've scheduled for creation
  */
-static noinline int create_pending_snapshots(struct btrfs_trans_handle *trans,
-					     struct btrfs_fs_info *fs_info)
+static noinline int create_pending_snapshots(struct btrfs_trans_handle *trans)
 {
 	struct btrfs_pending_snapshot *pending, *next;
 	struct list_head *head = &trans->transaction->pending_snapshots;
@@ -1713,7 +1713,7 @@ static noinline int create_pending_snapshots(struct btrfs_trans_handle *trans,
 
 	list_for_each_entry_safe(pending, next, head, list) {
 		list_del(&pending->list);
-		ret = create_pending_snapshot(trans, fs_info, pending);
+		ret = create_pending_snapshot(trans, pending);
 		if (ret)
 			break;
 	}
@@ -2110,7 +2110,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
 	 * deal with them in create_pending_snapshot(), which is the
 	 * core function of the snapshot creation.
 	 */
-	ret = create_pending_snapshots(trans, fs_info);
+	ret = create_pending_snapshots(trans);
 	if (ret) {
 		mutex_unlock(&fs_info->reloc_mutex);
 		goto scrub_continue;
-- 
2.7.4


  parent reply	other threads:[~2018-02-07 15:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 15:55 [PATCH 00/14] Misc transaction cleanups Nikolay Borisov
2018-02-07 15:55 ` [PATCH 01/14] btrfs: Make btrfs_trans_release_metadata private to transaction.c Nikolay Borisov
2018-02-07 15:55 ` [PATCH 02/14] btrfs: Open code btrfs_write_and_wait_marked_extents Nikolay Borisov
2018-02-07 15:55 ` [PATCH 03/14] btrfs: Remove fs_info argument from btrfs_trans_release_metadata Nikolay Borisov
2018-02-07 15:55 ` [PATCH 04/14] btrfs: Remove fs_info argument from btrfs_create_pending_block_groups Nikolay Borisov
2018-02-07 15:55 ` [PATCH 05/14] btrfs: Don't pass fs_info arg to btrfs_start_dirty_block_groups Nikolay Borisov
2018-02-07 15:55 ` [PATCH 06/14] btrfs: Don't pass fs_info to __btrfs_run_delayed_items Nikolay Borisov
2018-02-07 15:55 ` [PATCH 07/14] btrfs: Don't pass fs_info to btrfs_run_delayed_items/_nr Nikolay Borisov
2018-02-07 15:55 ` [PATCH 08/14] btrfs: Don't pass fs_info to commit_fs_roots Nikolay Borisov
2018-02-07 15:55 ` [PATCH 09/14] btrfs: Don't pass fs_info to commit_cowonly_roots Nikolay Borisov
2018-02-07 15:55 ` [PATCH 10/14] btrfs: Remove root argument of cleanup_transaction Nikolay Borisov
2018-02-07 15:55 ` [PATCH 11/14] btrfs: Remove fs_info argument from switch_commit_roots Nikolay Borisov
2018-02-07 15:55 ` Nikolay Borisov [this message]
2018-02-07 15:55 ` [PATCH 13/14] btrfs: Remove fs_info argument from btrfs_update_commit_device_bytes_used Nikolay Borisov
2018-02-07 15:55 ` [PATCH 14/14] btrfs: Remove fs_info argument of btrfs_write_and_wait_transaction Nikolay Borisov
2018-02-12 17:58 ` [PATCH 00/14] Misc transaction cleanups 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=1518018950-31456-13-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).