Lines Matching refs:failrec
2117 struct io_failure_record *failrec; in clean_io_failure() local
2134 failrec = (struct io_failure_record *)(unsigned long) private_failure; in clean_io_failure()
2135 BUG_ON(!failrec->this_mirror); in clean_io_failure()
2137 if (failrec->in_validation) { in clean_io_failure()
2140 failrec->start); in clean_io_failure()
2148 failrec->start, in clean_io_failure()
2152 if (state && state->start <= failrec->start && in clean_io_failure()
2153 state->end >= failrec->start + failrec->len - 1) { in clean_io_failure()
2154 num_copies = btrfs_num_copies(fs_info, failrec->logical, in clean_io_failure()
2155 failrec->len); in clean_io_failure()
2157 repair_io_failure(inode, start, failrec->len, in clean_io_failure()
2158 failrec->logical, page, in clean_io_failure()
2159 pg_offset, failrec->failed_mirror); in clean_io_failure()
2164 free_io_failure(inode, failrec); in clean_io_failure()
2178 struct io_failure_record *failrec; in btrfs_free_io_failure_record() local
2194 failrec = (struct io_failure_record *)(unsigned long)state->private; in btrfs_free_io_failure_record()
2196 kfree(failrec); in btrfs_free_io_failure_record()
2206 struct io_failure_record *failrec; in btrfs_get_io_failure_record() local
2217 failrec = kzalloc(sizeof(*failrec), GFP_NOFS); in btrfs_get_io_failure_record()
2218 if (!failrec) in btrfs_get_io_failure_record()
2221 failrec->start = start; in btrfs_get_io_failure_record()
2222 failrec->len = end - start + 1; in btrfs_get_io_failure_record()
2223 failrec->this_mirror = 0; in btrfs_get_io_failure_record()
2224 failrec->bio_flags = 0; in btrfs_get_io_failure_record()
2225 failrec->in_validation = 0; in btrfs_get_io_failure_record()
2228 em = lookup_extent_mapping(em_tree, start, failrec->len); in btrfs_get_io_failure_record()
2231 kfree(failrec); in btrfs_get_io_failure_record()
2241 kfree(failrec); in btrfs_get_io_failure_record()
2249 failrec->bio_flags = EXTENT_BIO_COMPRESSED; in btrfs_get_io_failure_record()
2250 extent_set_compress_type(&failrec->bio_flags, in btrfs_get_io_failure_record()
2255 logical, start, failrec->len); in btrfs_get_io_failure_record()
2257 failrec->logical = logical; in btrfs_get_io_failure_record()
2265 (u64)(unsigned long)failrec); in btrfs_get_io_failure_record()
2271 kfree(failrec); in btrfs_get_io_failure_record()
2275 failrec = (struct io_failure_record *)(unsigned long)private; in btrfs_get_io_failure_record()
2277 failrec->logical, failrec->start, failrec->len, in btrfs_get_io_failure_record()
2278 failrec->in_validation); in btrfs_get_io_failure_record()
2286 *failrec_ret = failrec; in btrfs_get_io_failure_record()
2292 struct io_failure_record *failrec, int failed_mirror) in btrfs_check_repairable() argument
2297 failrec->logical, failrec->len); in btrfs_check_repairable()
2305 num_copies, failrec->this_mirror, failed_mirror); in btrfs_check_repairable()
2323 BUG_ON(failrec->in_validation); in btrfs_check_repairable()
2324 failrec->in_validation = 1; in btrfs_check_repairable()
2325 failrec->this_mirror = failed_mirror; in btrfs_check_repairable()
2332 if (failrec->in_validation) { in btrfs_check_repairable()
2333 BUG_ON(failrec->this_mirror != failed_mirror); in btrfs_check_repairable()
2334 failrec->in_validation = 0; in btrfs_check_repairable()
2335 failrec->this_mirror = 0; in btrfs_check_repairable()
2337 failrec->failed_mirror = failed_mirror; in btrfs_check_repairable()
2338 failrec->this_mirror++; in btrfs_check_repairable()
2339 if (failrec->this_mirror == failed_mirror) in btrfs_check_repairable()
2340 failrec->this_mirror++; in btrfs_check_repairable()
2343 if (failrec->this_mirror > num_copies) { in btrfs_check_repairable()
2345 num_copies, failrec->this_mirror, failed_mirror); in btrfs_check_repairable()
2354 struct io_failure_record *failrec, in btrfs_create_repair_bio() argument
2367 bio->bi_iter.bi_sector = failrec->logical >> 9; in btrfs_create_repair_bio()
2384 bio_add_page(bio, page, failrec->len, pg_offset); in btrfs_create_repair_bio()
2401 struct io_failure_record *failrec; in bio_readpage_error() local
2410 ret = btrfs_get_io_failure_record(inode, start, end, &failrec); in bio_readpage_error()
2414 ret = btrfs_check_repairable(inode, failed_bio, failrec, failed_mirror); in bio_readpage_error()
2416 free_io_failure(inode, failrec); in bio_readpage_error()
2426 bio = btrfs_create_repair_bio(inode, failed_bio, failrec, page, in bio_readpage_error()
2431 free_io_failure(inode, failrec); in bio_readpage_error()
2436 read_mode, failrec->this_mirror, failrec->in_validation); in bio_readpage_error()
2439 failrec->this_mirror, in bio_readpage_error()
2440 failrec->bio_flags, 0); in bio_readpage_error()
2442 free_io_failure(inode, failrec); in bio_readpage_error()