relocation.c (370a11b8114bcca3738fe6a5d7ed8babcc212f39) relocation.c (f616f5cd9da7fceb7d884812da380b26040cd083)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2009 Oracle. All rights reserved.
4 */
5
6#include <linux/sched.h>
7#include <linux/pagemap.h>
8#include <linux/writeback.h>

--- 1875 unchanged lines hidden (view full) ---

1884 /*
1885 * Info qgroup to trace both subtrees.
1886 *
1887 * We must trace both trees.
1888 * 1) Tree reloc subtree
1889 * If not traced, we will leak data numbers
1890 * 2) Fs subtree
1891 * If not traced, we will double count old data
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2009 Oracle. All rights reserved.
4 */
5
6#include <linux/sched.h>
7#include <linux/pagemap.h>
8#include <linux/writeback.h>

--- 1875 unchanged lines hidden (view full) ---

1884 /*
1885 * Info qgroup to trace both subtrees.
1886 *
1887 * We must trace both trees.
1888 * 1) Tree reloc subtree
1889 * If not traced, we will leak data numbers
1890 * 2) Fs subtree
1891 * If not traced, we will double count old data
1892 * and tree block numbers, if current trans doesn't free
1893 * data reloc tree inode.
1892 *
1893 * We don't scan the subtree right now, but only record
1894 * the swapped tree blocks.
1895 * The real subtree rescan is delayed until we have new
1896 * CoW on the subtree root node before transaction commit.
1894 */
1897 */
1895 ret = btrfs_qgroup_trace_subtree_swap(trans, rc->block_group,
1896 parent, slot, path->nodes[level],
1897 path->slots[level], last_snapshot);
1898 if (ret < 0)
1899 break;
1900
1901 btrfs_node_key_to_cpu(parent, &first_key, slot);
1902 ret = btrfs_qgroup_add_swapped_blocks(trans, dest,
1903 rc->block_group, parent, slot,
1904 path->nodes[level], path->slots[level],
1905 last_snapshot);
1906 if (ret < 0)
1907 break;
1908 /*
1909 * swap blocks in fs tree and reloc tree.

--- 2821 unchanged lines hidden ---
1898 ret = btrfs_qgroup_add_swapped_blocks(trans, dest,
1899 rc->block_group, parent, slot,
1900 path->nodes[level], path->slots[level],
1901 last_snapshot);
1902 if (ret < 0)
1903 break;
1904 /*
1905 * swap blocks in fs tree and reloc tree.

--- 2821 unchanged lines hidden ---