Lines Matching full:logical

86 	u64			logical;  member
96 * Each page will have its page::private used to record the logical
102 /* Logical bytenr of the sblock */
103 u64 logical; member
206 u64 logical; member
212 u64 logical; member
220 u64 logical; member
224 static int attach_scrub_page_private(struct page *page, u64 logical) in attach_scrub_page_private() argument
227 attach_page_private(page, (void *)logical); in attach_scrub_page_private()
235 spp->logical = logical; in attach_scrub_page_private()
257 u64 logical, u64 physical, in alloc_scrub_block() argument
268 sblock->logical = logical; in alloc_scrub_block()
287 u64 logical, gfp_t gfp) in alloc_scrub_sector() argument
289 const pgoff_t page_index = (logical - sblock->logical) >> PAGE_SHIFT; in alloc_scrub_sector()
293 ASSERT(logical - sblock->logical < U32_MAX); in alloc_scrub_sector()
309 sblock->logical + (page_index << PAGE_SHIFT)); in alloc_scrub_sector()
322 ssector->offset = logical - sblock->logical; in alloc_scrub_sector()
405 static int scrub_sectors(struct scrub_ctx *sctx, u64 logical, u32 len,
500 if (fstripe_logical < entry->logical) { in insert_full_stripe_lock()
502 } else if (fstripe_logical > entry->logical) { in insert_full_stripe_lock()
516 ret->logical = fstripe_logical; in insert_full_stripe_lock()
543 if (fstripe_logical < entry->logical) in search_full_stripe_lock()
545 else if (fstripe_logical > entry->logical) in search_full_stripe_lock()
554 * Helper to get full stripe logical from a normal bytenr.
673 fstripe_lock->logical); in unlock_full_stripe()
863 "%s at logical %llu on dev %s, physical %llu, root %llu, inode %llu, offset %llu, length %u, links … in scrub_print_warning_inode()
864 swarn->errstr, swarn->logical, in scrub_print_warning_inode()
877 …"%s at logical %llu on dev %s, physical %llu, root %llu, inode %llu, offset %llu: path resolving f… in scrub_print_warning_inode()
878 swarn->errstr, swarn->logical, in scrub_print_warning_inode()
920 swarn.logical = sblock->logical; in scrub_print_warning()
924 ret = extent_from_logical(fs_info, swarn.logical, path, &found_key, in scrub_print_warning()
929 extent_item_pos = swarn.logical - found_key.objectid; in scrub_print_warning()
942 "%s at logical %llu on dev %s, physical %llu: metadata %s (level %d) in tree %llu", in scrub_print_warning()
943 errstr, swarn.logical, in scrub_print_warning()
992 u64 logical; in scrub_handle_errored_block() local
1023 logical = sblock_to_check->logical; in scrub_handle_errored_block()
1030 if (!sctx->is_dev_replace && btrfs_repair_one_zone(fs_info, logical)) in scrub_handle_errored_block()
1050 ret = lock_full_stripe(fs_info, logical, &full_stripe_locked); in scrub_handle_errored_block()
1102 logical, 0, 0, mirror_index); in scrub_handle_errored_block()
1114 /* Setup the context, map the logical blocks and alloc the sectors */ in scrub_handle_errored_block()
1360 "fixed up error at logical %llu on dev %s", in scrub_handle_errored_block()
1361 logical, rcu_str_deref(dev->name)); in scrub_handle_errored_block()
1369 "unable to fixup (regular) error at logical %llu on dev %s", in scrub_handle_errored_block()
1370 logical, rcu_str_deref(dev->name)); in scrub_handle_errored_block()
1398 ret = unlock_full_stripe(fs_info, logical, full_stripe_locked); in scrub_handle_errored_block()
1415 static inline void scrub_stripe_index_and_offset(u64 logical, u64 map_type, in scrub_stripe_index_and_offset() argument
1430 if (logical >= raid_map[i] && in scrub_stripe_index_and_offset()
1431 logical < raid_map[i] + BTRFS_STRIPE_LEN) in scrub_stripe_index_and_offset()
1436 *stripe_offset = logical - raid_map[i]; in scrub_stripe_index_and_offset()
1449 u64 logical = original_sblock->logical; in scrub_setup_recheck_block() local
1476 logical, &mapped_length, &bioc); in scrub_setup_recheck_block()
1506 sector = alloc_scrub_sector(sblock, logical, GFP_NOFS); in scrub_setup_recheck_block()
1522 scrub_stripe_index_and_offset(logical, in scrub_setup_recheck_block()
1549 logical += sublen; in scrub_setup_recheck_block()
1567 bio->bi_iter.bi_sector = (sector->offset + sector->sblock->logical) >> in scrub_submit_raid56_bio_wait()
1831 sbio->logical = sblock->logical + sector->offset; in scrub_add_sector_to_wr_bio()
1843 sbio->logical + sbio->sector_count * sectorsize != in scrub_add_sector_to_wr_bio()
1844 sblock->logical + sector->offset) { in scrub_add_sector_to_wr_bio()
2039 if (sblock->logical != btrfs_stack_header_bytenr(h)) in scrub_checksum_tree_block()
2088 if (sblock->logical != btrfs_super_bytenr(s)) in scrub_checksum_super()
2242 sbio->logical = sblock->logical + sector->offset; in scrub_add_sector_to_rd_bio()
2254 sbio->logical + sbio->sector_count * sectorsize != in scrub_add_sector_to_rd_bio()
2255 sblock->logical + sector->offset || in scrub_add_sector_to_rd_bio()
2301 u64 logical; in scrub_missing_raid56_worker() local
2304 logical = sblock->logical; in scrub_missing_raid56_worker()
2315 "IO error rebuilding logical %llu for dev %s", in scrub_missing_raid56_worker()
2316 logical, rcu_str_deref(dev->name)); in scrub_missing_raid56_worker()
2322 "failed to rebuild valid logical %llu for dev %s", in scrub_missing_raid56_worker()
2323 logical, rcu_str_deref(dev->name)); in scrub_missing_raid56_worker()
2343 u64 logical = sblock->logical; in scrub_missing_raid56_pages() local
2351 ret = btrfs_map_sblock(fs_info, BTRFS_MAP_GET_READ_MIRRORS, logical, in scrub_missing_raid56_pages()
2368 bio->bi_iter.bi_sector = logical >> 9; in scrub_missing_raid56_pages()
2381 sector->offset + sector->sblock->logical); in scrub_missing_raid56_pages()
2401 static int scrub_sectors(struct scrub_ctx *sctx, u64 logical, u32 len, in scrub_sectors() argument
2410 sblock = alloc_scrub_block(sctx, dev, logical, physical, in scrub_sectors()
2428 sector = alloc_scrub_sector(sblock, logical, GFP_KERNEL); in scrub_sectors()
2445 logical += l; in scrub_sectors()
2589 u64 start = sblock->logical; in scrub_block_complete()
2590 u64 end = sblock->logical + in scrub_block_complete()
2608 * Find the desired csum for range [logical, logical + sectorsize), and store
2613 * that is before @logical.
2618 static int scrub_find_csum(struct scrub_ctx *sctx, u64 logical, u8 *csum) in scrub_find_csum() argument
2630 if (sum->bytenr > logical) in scrub_find_csum()
2639 if (sum->bytenr + sum->len <= logical) { in scrub_find_csum()
2646 index = (logical - sum->bytenr) >> sctx->fs_info->sectorsize_bits; in scrub_find_csum()
2664 u64 logical, u32 len, in scrub_extent() argument
2708 scrub_find_good_copy(sctx->fs_info, logical, len, &src_physical, in scrub_extent()
2716 have_csum = scrub_find_csum(sctx, logical, csum); in scrub_extent()
2720 ret = scrub_sectors(sctx, logical, l, src_physical, src_dev, in scrub_extent()
2726 logical += l; in scrub_extent()
2734 u64 logical, u32 len, in scrub_sectors_for_parity() argument
2745 sblock = alloc_scrub_block(sctx, dev, logical, physical, physical, mirror_num); in scrub_sectors_for_parity()
2759 sector = alloc_scrub_sector(sblock, logical, GFP_KERNEL); in scrub_sectors_for_parity()
2782 logical += sectorsize; in scrub_sectors_for_parity()
2804 u64 logical, u32 len, in scrub_extent_for_parity() argument
2814 scrub_parity_mark_sectors_error(sparity, logical, len); in scrub_extent_for_parity()
2833 have_csum = scrub_find_csum(sctx, logical, csum); in scrub_extent_for_parity()
2837 ret = scrub_sectors_for_parity(sparity, logical, l, physical, dev, in scrub_extent_for_parity()
2844 logical += l; in scrub_extent_for_parity()
2852 * logical offset. if this is a parity stripe, it will return
2853 * the most left data stripe's logical offset.
3147 u64 logical) in scrub_raid56_data_stripe_for_parity() argument
3150 struct btrfs_root *extent_root = btrfs_extent_root(fs_info, logical); in scrub_raid56_data_stripe_for_parity()
3151 struct btrfs_root *csum_root = btrfs_csum_root(fs_info, logical); in scrub_raid56_data_stripe_for_parity()
3152 u64 cur_logical = logical; in scrub_raid56_data_stripe_for_parity()
3160 while (cur_logical < logical + map->stripe_len) { in scrub_raid56_data_stripe_for_parity()
3172 logical + map->stripe_len - cur_logical); in scrub_raid56_data_stripe_for_parity()
3186 logical, map->stripe_len)) { in scrub_raid56_data_stripe_for_parity()
3188 "scrub: tree block %llu spanning stripes, ignored. logical=%llu", in scrub_raid56_data_stripe_for_parity()
3189 extent_start, logical); in scrub_raid56_data_stripe_for_parity()
3202 logical + map->stripe_len) - cur_logical; in scrub_raid56_data_stripe_for_parity()
3330 static int sync_write_pointer_for_zoned(struct scrub_ctx *sctx, u64 logical, in sync_write_pointer_for_zoned() argument
3343 ret = btrfs_sync_zone_write_pointer(sctx->wr_tgtdev, logical, in sync_write_pointer_for_zoned()
3386 /* Go through each extent items inside the logical range */ in scrub_simple_mirror()
3494 /* Get the logical bytenr for the stripe */
3574 u64 logical; in scrub_stripe() local
3576 /* The logical increment after finishing one stripe */ in scrub_stripe()
3653 /* Calculate the logical end of the stripe */ in scrub_stripe()
3668 &logical, &stripe_logical); in scrub_stripe()
3669 logical += chunk_logical; in scrub_stripe()
3691 logical, map->stripe_len, in scrub_stripe()
3696 logical += increment; in scrub_stripe()
3892 * logical start offset of the deleted block group, stored at in scrub_enumerate_chunks()
3893 * @chunk_offset, might be part of the logical address range of in scrub_enumerate_chunks()
3921 * group doesn't get its logical address and its device extents in scrub_enumerate_chunks()