Lines Matching refs:ret
327 struct full_stripe_lock *ret;
348 ret = kmalloc(sizeof(*ret), GFP_KERNEL);
349 if (!ret)
351 ret->logical = fstripe_logical;
352 ret->refs = 1;
353 mutex_init(&ret->mutex);
355 rb_link_node(&ret->node, parent, p);
356 rb_insert_color(&ret->node, &locks_root->root);
357 return ret;
395 u64 ret;
407 ret = div64_u64(bytenr - cache->start, cache->full_stripe_len) *
409 return ret;
430 int ret = 0;
451 ret = PTR_ERR(existing);
458 return ret;
478 int ret = 0;
500 ret = -ENOENT;
524 return ret;
641 int ret;
654 ret = PTR_ERR(local_root);
665 ret = btrfs_search_slot(NULL, local_root, &key, swarn->path, 0, 0);
666 if (ret) {
689 ret = PTR_ERR(ipath);
693 ret = paths_from_inode(inum, ipath);
695 if (ret < 0)
718 "%s at logical %llu on dev %s, physical %llu, root %llu, inode %llu, offset %llu: path resolving failed with ret=%d",
722 root, inum, offset, ret);
743 int ret;
758 ret = extent_from_logical(fs_info, swarn.logical, path, &found_key,
760 if (ret < 0)
772 ret = tree_backref_for_extent(&ptr, eb, &found_key, ei,
781 ret < 0 ? -1 : ref_level,
782 ret < 0 ? -1 : ref_root);
783 } while (ret != 1);
832 int ret;
879 ret = lock_full_stripe(fs_info, logical, &full_stripe_locked);
880 if (ret < 0) {
883 if (ret == -ENOMEM)
888 return ret;
933 ret = scrub_setup_recheck_block(sblock_to_check, sblocks_for_recheck);
934 if (ret) {
1057 ret = scrub_repair_block_from_good_copy(
1059 if (!ret)
1146 ret = scrub_repair_page_from_good_copy(sblock_bad,
1149 if (0 == ret)
1218 ret = unlock_full_stripe(fs_info, logical, full_stripe_locked);
1220 if (ret < 0)
1221 return ret;
1284 int ret;
1302 ret = btrfs_map_sblock(fs_info, BTRFS_MAP_GET_READ_MIRRORS,
1304 if (ret || !bbio || mapped_length < sublen) {
1400 int ret;
1408 ret = raid56_parity_recover(fs_info, bio, page->recover->bbio,
1411 if (ret)
1412 return ret;
1510 int ret;
1512 ret = memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE);
1513 return !ret;
1532 int ret = 0;
1541 ret = ret_sub;
1544 return ret;
1560 int ret;
1573 ret = bio_add_page(bio, page_good->page, PAGE_SIZE, 0);
1574 if (PAGE_SIZE != ret) {
1605 int ret;
1607 ret = scrub_write_page_to_dev_replace(sblock, page_num);
1608 if (ret)
1629 int ret;
1670 ret = bio_add_page(sbio->bio, spage->page, PAGE_SIZE, 0);
1671 if (ret != PAGE_SIZE) {
1752 int ret;
1768 ret = 0;
1770 ret = scrub_checksum_data(sblock);
1772 ret = scrub_checksum_tree_block(sblock);
1777 if (ret)
1780 return ret;
1970 int ret;
2018 ret = bio_add_page(sbio->bio, spage->page, PAGE_SIZE, 0);
2019 if (ret != PAGE_SIZE) {
2102 int ret;
2106 ret = btrfs_map_sblock(fs_info, BTRFS_MAP_GET_READ_MIRRORS, logical,
2108 if (ret || !bbio || !bbio->raid_map)
2225 int ret;
2227 ret = scrub_add_page_to_rd_bio(sctx, spage);
2228 if (ret) {
2230 return ret;
2407 int ret;
2444 ret = scrub_pages(sctx, logical, l, physical, dev, flags, gen,
2447 if (ret)
2448 return ret;
2527 int ret;
2529 ret = scrub_add_page_to_rd_bio(sctx, spage);
2530 if (ret) {
2532 return ret;
2547 int ret;
2575 ret = scrub_pages_for_parity(sparity, logical, l, physical, dev,
2578 if (ret)
2579 return ret;
2688 int ret;
2697 ret = btrfs_map_sblock(fs_info, BTRFS_MAP_WRITE, sparity->logic_start,
2699 if (ret || !bbio || !bbio->raid_map)
2763 int ret;
2801 ret = 0;
2810 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
2811 if (ret < 0)
2814 if (ret > 0) {
2815 ret = btrfs_previous_extent_item(root, path, 0);
2816 if (ret < 0)
2818 if (ret > 0) {
2820 ret = btrfs_search_slot(NULL, root, &key,
2822 if (ret < 0)
2834 ret = btrfs_next_leaf(root, path);
2835 if (ret == 0)
2837 if (ret < 0)
2901 ret = btrfs_map_block(fs_info, BTRFS_MAP_READ,
2904 if (!ret) {
2906 ret = -EIO;
2908 if (ret) {
2917 ret = btrfs_lookup_csums_range(csum_root,
2921 if (ret)
2924 ret = scrub_extent_for_parity(sparity, extent_logical,
2933 if (ret)
2962 if (ret < 0)
2972 return ret < 0 ? ret : 0;
2988 int ret;
3110 ret = 0;
3117 ret = -ECANCELED;
3137 ret = get_raid56_logic_offset(physical, num, map,
3141 if (ret) {
3145 ret = scrub_raid56_parity(sctx, map, scrub_dev,
3148 if (ret)
3161 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
3162 if (ret < 0)
3165 if (ret > 0) {
3166 ret = btrfs_previous_extent_item(root, path, 0);
3167 if (ret < 0)
3169 if (ret > 0) {
3173 ret = btrfs_search_slot(NULL, root, &key,
3175 if (ret < 0)
3187 ret = btrfs_next_leaf(root, path);
3188 if (ret == 0)
3190 if (ret < 0)
3226 ret = 0;
3276 ret = btrfs_lookup_csums_range(csum_root,
3280 if (ret)
3284 ret = scrub_extent(sctx, map, extent_logical, extent_len,
3291 if (ret)
3303 ret = get_raid56_logic_offset(physical,
3308 if (ret && physical < physical_end) {
3312 ret = scrub_raid56_parity(sctx,
3316 if (ret)
3361 return ret < 0 ? ret : 0;
3375 int ret = 0;
3388 ret = -EINVAL;
3391 return ret;
3404 ret = scrub_stripe(sctx, map, scrub_dev, i,
3406 if (ret)
3413 return ret;
3426 int ret = 0;
3448 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
3449 if (ret < 0)
3451 if (ret > 0) {
3454 ret = btrfs_next_leaf(root, path);
3455 if (ret < 0)
3457 if (ret > 0) {
3458 ret = 0;
3462 ret = 0;
3559 ret = btrfs_inc_block_group_ro(cache, sctx->is_dev_replace);
3560 if (ret == 0) {
3562 } else if (ret == -ENOSPC && !sctx->is_dev_replace &&
3578 } else if (ret == -ETXTBSY) {
3583 ret = 0;
3587 "failed setting block group ro: %d", ret);
3612 ret = scrub_chunk(sctx, scrub_dev, chunk_offset, length,
3677 if (ret)
3681 ret = -EIO;
3685 ret = -ENOMEM;
3695 return ret;
3704 int ret;
3722 ret = scrub_pages(sctx, bytenr, BTRFS_SUPER_INFO_SIZE, bytenr,
3725 if (ret)
3726 return ret;
3767 int ret = -ENOMEM;
3803 ret = 0;
3810 return ret;
3818 int ret;
3868 ret = scrub_workers_get(fs_info, is_dev_replace);
3869 if (ret)
3877 ret = -ENODEV;
3887 ret = -EROFS;
3896 ret = -EIO;
3907 ret = -EINPROGRESS;
3947 ret = scrub_supers(sctx, dev);
3961 if (!ret)
3962 ret = scrub_enumerate_chunks(sctx, dev, start, end);
3976 ret ? "not finished" : "finished", devid, ret);
3994 ret = PTR_ERR(trans);
3996 "scrub: failed to start transaction to fix super block errors: %d", ret);
3997 return ret;
3999 ret = btrfs_commit_transaction(trans);
4000 if (ret < 0)
4002 "scrub: failed to commit transaction to fix super block errors: %d", ret);
4004 return ret;
4010 return ret;
4103 int ret;
4106 ret = btrfs_map_block(fs_info, BTRFS_MAP_READ, extent_logical,
4108 if (ret || !bbio || mapped_length < extent_len ||