diff options
| author | Qu Wenruo <wqu@suse.com> | 2020-02-24 09:19:02 +0800 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2020-05-25 11:25:18 +0200 |
| commit | 2a979612d594c16953ca512f2de7f0bb385ffb65 (patch) | |
| tree | 10569ba060c0aa9d672fbbdb1f0be27f47e266e4 /tools/perf/scripts/python/stackcollapse.py | |
| parent | btrfs: reloc: refactor indirect tree backref processing into its own function (diff) | |
| download | linux-2a979612d594c16953ca512f2de7f0bb385ffb65.tar.gz linux-2a979612d594c16953ca512f2de7f0bb385ffb65.zip | |
btrfs: reloc: use wrapper to replace open-coded edge linking
Since backref_edge is used to connect upper and lower backref nodes, and
needs to access both nodes, some code can look pretty nasty:
list_add_tail(&edge->list[LOWER], &cur->upper);
The above code will link @cur to the LOWER side of the edge, while both
"LOWER" and "upper" words show up. This can sometimes be very confusing
for reader to grasp.
This patch introduces a new wrapper, link_backref_edge(), to handle the
linking behavior. Which also has extra ASSERT() to ensure caller won't
pass wrong nodes.
Also, this updates the comment of related lists of backref_node and
backref_edge, to make it more clear that each list points to what.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
