sparity           107 fs/btrfs/scrub.c 	struct scrub_parity	*sparity;
sparity           233 fs/btrfs/scrub.c static void scrub_parity_get(struct scrub_parity *sparity);
sparity           234 fs/btrfs/scrub.c static void scrub_parity_put(struct scrub_parity *sparity);
sparity          1602 fs/btrfs/scrub.c 	if (sblock->sparity)
sparity          1997 fs/btrfs/scrub.c 		if (sblock->sparity)
sparity          1998 fs/btrfs/scrub.c 			scrub_parity_put(sblock->sparity);
sparity          2364 fs/btrfs/scrub.c static inline void __scrub_mark_bitmap(struct scrub_parity *sparity,
sparity          2371 fs/btrfs/scrub.c 	int sectorsize = sparity->sctx->fs_info->sectorsize;
sparity          2373 fs/btrfs/scrub.c 	if (len >= sparity->stripe_len) {
sparity          2374 fs/btrfs/scrub.c 		bitmap_set(bitmap, 0, sparity->nsectors);
sparity          2378 fs/btrfs/scrub.c 	start -= sparity->logic_start;
sparity          2379 fs/btrfs/scrub.c 	start = div64_u64_rem(start, sparity->stripe_len, &offset);
sparity          2386 fs/btrfs/scrub.c 	if (offset + nsectors <= sparity->nsectors) {
sparity          2391 fs/btrfs/scrub.c 	bitmap_set(bitmap, offset, sparity->nsectors - offset);
sparity          2392 fs/btrfs/scrub.c 	bitmap_set(bitmap, 0, nsectors - (sparity->nsectors - offset));
sparity          2395 fs/btrfs/scrub.c static inline void scrub_parity_mark_sectors_error(struct scrub_parity *sparity,
sparity          2398 fs/btrfs/scrub.c 	__scrub_mark_bitmap(sparity, sparity->ebitmap, start, len);
sparity          2401 fs/btrfs/scrub.c static inline void scrub_parity_mark_sectors_data(struct scrub_parity *sparity,
sparity          2404 fs/btrfs/scrub.c 	__scrub_mark_bitmap(sparity, sparity->dbitmap, start, len);
sparity          2425 fs/btrfs/scrub.c 	if (sblock->sparity && corrupted && !sblock->data_corrected) {
sparity          2430 fs/btrfs/scrub.c 		scrub_parity_mark_sectors_error(sblock->sparity,
sparity          2525 fs/btrfs/scrub.c static int scrub_pages_for_parity(struct scrub_parity *sparity,
sparity          2530 fs/btrfs/scrub.c 	struct scrub_ctx *sctx = sparity->sctx;
sparity          2547 fs/btrfs/scrub.c 	sblock->sparity = sparity;
sparity          2548 fs/btrfs/scrub.c 	scrub_parity_get(sparity);
sparity          2569 fs/btrfs/scrub.c 		list_add_tail(&spage->list, &sparity->spages);
sparity          2609 fs/btrfs/scrub.c static int scrub_extent_for_parity(struct scrub_parity *sparity,
sparity          2614 fs/btrfs/scrub.c 	struct scrub_ctx *sctx = sparity->sctx;
sparity          2620 fs/btrfs/scrub.c 		scrub_parity_mark_sectors_error(sparity, logical, len);
sparity          2625 fs/btrfs/scrub.c 		blocksize = sparity->stripe_len;
sparity          2627 fs/btrfs/scrub.c 		blocksize = sparity->stripe_len;
sparity          2643 fs/btrfs/scrub.c 		ret = scrub_pages_for_parity(sparity, logical, l, physical, dev,
sparity          2700 fs/btrfs/scrub.c static void scrub_free_parity(struct scrub_parity *sparity)
sparity          2702 fs/btrfs/scrub.c 	struct scrub_ctx *sctx = sparity->sctx;
sparity          2706 fs/btrfs/scrub.c 	nbits = bitmap_weight(sparity->ebitmap, sparity->nsectors);
sparity          2714 fs/btrfs/scrub.c 	list_for_each_entry_safe(curr, next, &sparity->spages, list) {
sparity          2719 fs/btrfs/scrub.c 	kfree(sparity);
sparity          2724 fs/btrfs/scrub.c 	struct scrub_parity *sparity = container_of(work, struct scrub_parity,
sparity          2726 fs/btrfs/scrub.c 	struct scrub_ctx *sctx = sparity->sctx;
sparity          2728 fs/btrfs/scrub.c 	scrub_free_parity(sparity);
sparity          2734 fs/btrfs/scrub.c 	struct scrub_parity *sparity = (struct scrub_parity *)bio->bi_private;
sparity          2735 fs/btrfs/scrub.c 	struct btrfs_fs_info *fs_info = sparity->sctx->fs_info;
sparity          2738 fs/btrfs/scrub.c 		bitmap_or(sparity->ebitmap, sparity->ebitmap, sparity->dbitmap,
sparity          2739 fs/btrfs/scrub.c 			  sparity->nsectors);
sparity          2743 fs/btrfs/scrub.c 	btrfs_init_work(&sparity->work, scrub_parity_bio_endio_worker, NULL,
sparity          2745 fs/btrfs/scrub.c 	btrfs_queue_work(fs_info->scrub_parity_workers, &sparity->work);
sparity          2748 fs/btrfs/scrub.c static void scrub_parity_check_and_repair(struct scrub_parity *sparity)
sparity          2750 fs/btrfs/scrub.c 	struct scrub_ctx *sctx = sparity->sctx;
sparity          2758 fs/btrfs/scrub.c 	if (!bitmap_andnot(sparity->dbitmap, sparity->dbitmap, sparity->ebitmap,
sparity          2759 fs/btrfs/scrub.c 			   sparity->nsectors))
sparity          2762 fs/btrfs/scrub.c 	length = sparity->logic_end - sparity->logic_start;
sparity          2765 fs/btrfs/scrub.c 	ret = btrfs_map_sblock(fs_info, BTRFS_MAP_WRITE, sparity->logic_start,
sparity          2771 fs/btrfs/scrub.c 	bio->bi_iter.bi_sector = sparity->logic_start >> 9;
sparity          2772 fs/btrfs/scrub.c 	bio->bi_private = sparity;
sparity          2776 fs/btrfs/scrub.c 					      length, sparity->scrub_dev,
sparity          2777 fs/btrfs/scrub.c 					      sparity->dbitmap,
sparity          2778 fs/btrfs/scrub.c 					      sparity->nsectors);
sparity          2791 fs/btrfs/scrub.c 	bitmap_or(sparity->ebitmap, sparity->ebitmap, sparity->dbitmap,
sparity          2792 fs/btrfs/scrub.c 		  sparity->nsectors);
sparity          2797 fs/btrfs/scrub.c 	scrub_free_parity(sparity);
sparity          2805 fs/btrfs/scrub.c static void scrub_parity_get(struct scrub_parity *sparity)
sparity          2807 fs/btrfs/scrub.c 	refcount_inc(&sparity->refs);
sparity          2810 fs/btrfs/scrub.c static void scrub_parity_put(struct scrub_parity *sparity)
sparity          2812 fs/btrfs/scrub.c 	if (!refcount_dec_and_test(&sparity->refs))
sparity          2815 fs/btrfs/scrub.c 	scrub_parity_check_and_repair(sparity);
sparity          2841 fs/btrfs/scrub.c 	struct scrub_parity *sparity;
sparity          2849 fs/btrfs/scrub.c 	sparity = kzalloc(sizeof(struct scrub_parity) + 2 * bitmap_len,
sparity          2851 fs/btrfs/scrub.c 	if (!sparity) {
sparity          2858 fs/btrfs/scrub.c 	sparity->stripe_len = map->stripe_len;
sparity          2859 fs/btrfs/scrub.c 	sparity->nsectors = nsectors;
sparity          2860 fs/btrfs/scrub.c 	sparity->sctx = sctx;
sparity          2861 fs/btrfs/scrub.c 	sparity->scrub_dev = sdev;
sparity          2862 fs/btrfs/scrub.c 	sparity->logic_start = logic_start;
sparity          2863 fs/btrfs/scrub.c 	sparity->logic_end = logic_end;
sparity          2864 fs/btrfs/scrub.c 	refcount_set(&sparity->refs, 1);
sparity          2865 fs/btrfs/scrub.c 	INIT_LIST_HEAD(&sparity->spages);
sparity          2866 fs/btrfs/scrub.c 	sparity->dbitmap = sparity->bitmap;
sparity          2867 fs/btrfs/scrub.c 	sparity->ebitmap = (void *)sparity->bitmap + bitmap_len;
sparity          2964 fs/btrfs/scrub.c 			scrub_parity_mark_sectors_data(sparity, extent_logical,
sparity          2992 fs/btrfs/scrub.c 			ret = scrub_extent_for_parity(sparity, extent_logical,
sparity          3031 fs/btrfs/scrub.c 		scrub_parity_mark_sectors_error(sparity, logic_start,
sparity          3033 fs/btrfs/scrub.c 	scrub_parity_put(sparity);