Lines Matching refs:failrec
2185 struct io_failure_record *failrec; in clean_io_failure() local
2202 failrec = (struct io_failure_record *)(unsigned long) private_failure; in clean_io_failure()
2203 BUG_ON(!failrec->this_mirror); in clean_io_failure()
2205 if (failrec->in_validation) { in clean_io_failure()
2208 failrec->start); in clean_io_failure()
2216 failrec->start, in clean_io_failure()
2220 if (state && state->start <= failrec->start && in clean_io_failure()
2221 state->end >= failrec->start + failrec->len - 1) { in clean_io_failure()
2222 num_copies = btrfs_num_copies(fs_info, failrec->logical, in clean_io_failure()
2223 failrec->len); in clean_io_failure()
2225 repair_io_failure(inode, start, failrec->len, in clean_io_failure()
2226 failrec->logical, page, in clean_io_failure()
2227 pg_offset, failrec->failed_mirror); in clean_io_failure()
2232 free_io_failure(inode, failrec); in clean_io_failure()
2246 struct io_failure_record *failrec; in btrfs_free_io_failure_record() local
2262 failrec = (struct io_failure_record *)(unsigned long)state->private; in btrfs_free_io_failure_record()
2264 kfree(failrec); in btrfs_free_io_failure_record()
2274 struct io_failure_record *failrec; in btrfs_get_io_failure_record() local
2285 failrec = kzalloc(sizeof(*failrec), GFP_NOFS); in btrfs_get_io_failure_record()
2286 if (!failrec) in btrfs_get_io_failure_record()
2289 failrec->start = start; in btrfs_get_io_failure_record()
2290 failrec->len = end - start + 1; in btrfs_get_io_failure_record()
2291 failrec->this_mirror = 0; in btrfs_get_io_failure_record()
2292 failrec->bio_flags = 0; in btrfs_get_io_failure_record()
2293 failrec->in_validation = 0; in btrfs_get_io_failure_record()
2296 em = lookup_extent_mapping(em_tree, start, failrec->len); in btrfs_get_io_failure_record()
2299 kfree(failrec); in btrfs_get_io_failure_record()
2309 kfree(failrec); in btrfs_get_io_failure_record()
2317 failrec->bio_flags = EXTENT_BIO_COMPRESSED; in btrfs_get_io_failure_record()
2318 extent_set_compress_type(&failrec->bio_flags, in btrfs_get_io_failure_record()
2323 logical, start, failrec->len); in btrfs_get_io_failure_record()
2325 failrec->logical = logical; in btrfs_get_io_failure_record()
2333 (u64)(unsigned long)failrec); in btrfs_get_io_failure_record()
2339 kfree(failrec); in btrfs_get_io_failure_record()
2343 failrec = (struct io_failure_record *)(unsigned long)private; in btrfs_get_io_failure_record()
2345 failrec->logical, failrec->start, failrec->len, in btrfs_get_io_failure_record()
2346 failrec->in_validation); in btrfs_get_io_failure_record()
2354 *failrec_ret = failrec; in btrfs_get_io_failure_record()
2360 struct io_failure_record *failrec, int failed_mirror) in btrfs_check_repairable() argument
2365 failrec->logical, failrec->len); in btrfs_check_repairable()
2373 num_copies, failrec->this_mirror, failed_mirror); in btrfs_check_repairable()
2391 BUG_ON(failrec->in_validation); in btrfs_check_repairable()
2392 failrec->in_validation = 1; in btrfs_check_repairable()
2393 failrec->this_mirror = failed_mirror; in btrfs_check_repairable()
2400 if (failrec->in_validation) { in btrfs_check_repairable()
2401 BUG_ON(failrec->this_mirror != failed_mirror); in btrfs_check_repairable()
2402 failrec->in_validation = 0; in btrfs_check_repairable()
2403 failrec->this_mirror = 0; in btrfs_check_repairable()
2405 failrec->failed_mirror = failed_mirror; in btrfs_check_repairable()
2406 failrec->this_mirror++; in btrfs_check_repairable()
2407 if (failrec->this_mirror == failed_mirror) in btrfs_check_repairable()
2408 failrec->this_mirror++; in btrfs_check_repairable()
2411 if (failrec->this_mirror > num_copies) { in btrfs_check_repairable()
2413 num_copies, failrec->this_mirror, failed_mirror); in btrfs_check_repairable()
2422 struct io_failure_record *failrec, in btrfs_create_repair_bio() argument
2435 bio->bi_iter.bi_sector = failrec->logical >> 9; in btrfs_create_repair_bio()
2452 bio_add_page(bio, page, failrec->len, pg_offset); in btrfs_create_repair_bio()
2469 struct io_failure_record *failrec; in bio_readpage_error() local
2478 ret = btrfs_get_io_failure_record(inode, start, end, &failrec); in bio_readpage_error()
2482 ret = btrfs_check_repairable(inode, failed_bio, failrec, failed_mirror); in bio_readpage_error()
2484 free_io_failure(inode, failrec); in bio_readpage_error()
2494 bio = btrfs_create_repair_bio(inode, failed_bio, failrec, page, in bio_readpage_error()
2499 free_io_failure(inode, failrec); in bio_readpage_error()
2504 read_mode, failrec->this_mirror, failrec->in_validation); in bio_readpage_error()
2507 failrec->this_mirror, in bio_readpage_error()
2508 failrec->bio_flags, 0); in bio_readpage_error()
2510 free_io_failure(inode, failrec); in bio_readpage_error()