Commit 4ac039ad authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Rename find_oldest_super_backup to init_backup_root_slot

The old name name was an awful misnomer because it didn't really find
the oldest super backup per-se but rather its slot. For example if we
have:

slot0: gen - 2
slot1: gen - 1
slot2: gen
slot3: empty

init_backup_root_slot will return slot3 and not slot0.

The new name is more appropriate since the function doesn't care whether
there is a valid backup in the returned slot or not.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 260eb11b
...@@ -1815,13 +1815,11 @@ static int find_newest_super_backup(struct btrfs_fs_info *info) ...@@ -1815,13 +1815,11 @@ static int find_newest_super_backup(struct btrfs_fs_info *info)
return -EINVAL; return -EINVAL;
} }
/* /*
* find the oldest backup so we know where to store new entries * Initialize backup_root_index with the next available slot, where subsequent
* in the backup array. This will set the backup_root_index * transaction commit will store the backup root
* field in the fs_info struct
*/ */
static void find_oldest_super_backup(struct btrfs_fs_info *info) static void init_backup_root_slot(struct btrfs_fs_info *info)
{ {
int newest_index; int newest_index;
...@@ -2935,7 +2933,7 @@ int __cold open_ctree(struct super_block *sb, ...@@ -2935,7 +2933,7 @@ int __cold open_ctree(struct super_block *sb,
* run through our array of backup supers and setup * run through our array of backup supers and setup
* our ring pointer to the oldest one * our ring pointer to the oldest one
*/ */
find_oldest_super_backup(fs_info); init_backup_root_slot(fs_info);
/* /*
* In the long term, we'll store the compression type in the super * In the long term, we'll store the compression type in the super
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment