diff options
author | Dimitri John Ledkov <xnox@ubuntu.com> | 2018-02-19 15:51:31 +0000 |
---|---|---|
committer | Dimitri John Ledkov <xnox@ubuntu.com> | 2018-02-19 15:52:49 +0000 |
commit | b70cb0d0a21394d5d6b00b51f064115c2724cea8 (patch) | |
tree | f001381d2ee826e6665e003e7c6dccb084a54316 /super-recover.c | |
parent | f1b0adb46b2c193e940f8c22b35036d2ee76c673 (diff) |
New upstream releasedebian/4.15.1-1archive/debian/4.15.1-1
Diffstat (limited to 'super-recover.c')
-rw-r--r-- | super-recover.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/super-recover.c b/super-recover.c index 6b80416f..880fd771 100644 --- a/super-recover.c +++ b/super-recover.c @@ -136,7 +136,7 @@ read_dev_supers(char *filename, struct btrfs_recover_superblock *recover) max_gen = btrfs_super_generation(sb); if (max_gen > recover->max_generation) recover->max_generation = max_gen; - } else if (ret == -EIO){ + } else if (ret != -ENOENT){ /* * Skip superblock which doesn't exist, only adds * really corrupted superblock @@ -177,28 +177,6 @@ static int read_fs_supers(struct btrfs_recover_superblock *recover) return 0; } -static struct super_block_record *recover_get_good_super( - struct btrfs_recover_superblock *recover) -{ - struct super_block_record *record; - record = list_entry(recover->good_supers.next, - struct super_block_record, list); - return record; -} - -static void print_all_devices(struct list_head *devices) -{ - struct btrfs_device *dev; - - printf("All Devices:\n"); - list_for_each_entry(dev, devices, dev_list) { - printf("\t"); - printf("Device: id = %llu, name = %s\n", - dev->devid, dev->name); - } - printf("\n"); -} - static void print_super_info(struct super_block_record *record) { printf("\t\tdevice name = %s\n", record->device_name); @@ -293,7 +271,9 @@ int btrfs_recover_superblocks(const char *dname, goto no_recover; } } - record = recover_get_good_super(&recover); + record = list_first_entry(&recover.good_supers, + struct super_block_record, list); + root = open_ctree(record->device_name, record->bytenr, OPEN_CTREE_RECOVER_SUPER | OPEN_CTREE_WRITES); if (!root) { |