public inbox for linux-btrfs@vger.kernel.org
 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 6/8] btrfs: Remove unused next_root_backup function
Date: Tue, 15 Oct 2019 18:42:22 +0300	[thread overview]
Message-ID: <20191015154224.21537-7-nborisov@suse.com> (raw)
In-Reply-To: <20191015154224.21537-1-nborisov@suse.com>

This function is no longer used so just remove it
---
 fs/btrfs/disk-io.c | 50 ----------------------------------------------
 1 file changed, 50 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 418619dfb76c..bcb21a35d30c 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1943,56 +1943,6 @@ static int read_backup_root(struct btrfs_fs_info *fs_info, u8 priority)
 	return backup_index;
 }
 
-/*
- * this copies info out of the root backup array and back into
- * the in-memory super block.  It is meant to help iterate through
- * the array, so you send it the number of backups you've already
- * tried and the last backup index you used.
- *
- * this returns -1 when it has tried all the backups
- */
-static noinline int next_root_backup(struct btrfs_fs_info *info,
-				     struct btrfs_super_block *super,
-				     int *num_backups_tried, int *backup_index)
-{
-	struct btrfs_root_backup *root_backup;
-	int newest = *backup_index;
-
-	if (*num_backups_tried == 0) {
-		newest = find_newest_super_backup(info);
-		if (newest == -1)
-			return -1;
-
-		*backup_index = newest;
-		*num_backups_tried = 1;
-	} else if (*num_backups_tried == BTRFS_NUM_BACKUP_ROOTS) {
-		/* we've tried all the backups, all done */
-		return -1;
-	} else {
-		/* jump to the next oldest backup */
-		newest = (*backup_index + BTRFS_NUM_BACKUP_ROOTS - 1) %
-			BTRFS_NUM_BACKUP_ROOTS;
-		*backup_index = newest;
-		*num_backups_tried += 1;
-	}
-	root_backup = super->super_roots + newest;
-
-	btrfs_set_super_generation(super,
-				   btrfs_backup_tree_root_gen(root_backup));
-	btrfs_set_super_root(super, btrfs_backup_tree_root(root_backup));
-	btrfs_set_super_root_level(super,
-				   btrfs_backup_tree_root_level(root_backup));
-	btrfs_set_super_bytes_used(super, btrfs_backup_bytes_used(root_backup));
-
-	/*
-	 * fixme: the total bytes and num_devices need to match or we should
-	 * need a fsck
-	 */
-	btrfs_set_super_total_bytes(super, btrfs_backup_total_bytes(root_backup));
-	btrfs_set_super_num_devices(super, btrfs_backup_num_devices(root_backup));
-	return 0;
-}
-
 /* helper to cleanup workers */
 static void btrfs_stop_all_workers(struct btrfs_fs_info *fs_info)
 {
-- 
2.17.1


  parent reply	other threads:[~2019-10-15 15:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 15:42 [PATCH 0/8] tree reading cleanups in mount Nikolay Borisov
2019-10-15 15:42 ` [PATCH 1/8] btrfs: Cleanup and simplify find_newest_super_backup Nikolay Borisov
2019-10-17 13:56   ` David Sterba
2019-10-15 15:42 ` [PATCH 2/8] btrfs: Remove newest_gen argument from find_oldest_super_backup Nikolay Borisov
2019-10-15 15:42 ` [PATCH 3/8] btrfs: Add read_backup_root Nikolay Borisov
2019-10-15 15:42 ` [PATCH 4/8] btrfs: Factor out tree roots initialization during mount Nikolay Borisov
2019-10-15 15:42 ` [PATCH 5/8] btrfs: Don't use objectid_mutex " Nikolay Borisov
2019-10-15 15:42 ` Nikolay Borisov [this message]
2019-10-15 15:42 ` [PATCH 7/8] btrfs: Rename find_oldest_super_backup to init_backup_root_slot Nikolay Borisov
2019-10-15 15:42 ` [PATCH 8/8] btrfs: Streamline btrfs_fs_info::backup_root_index semantics Nikolay Borisov
2019-10-29 16:42 ` [PATCH 0/8] tree reading cleanups in mount 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=20191015154224.21537-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