Commit 064046d
btrfs: optimize balance_level() path reference handling
Instead of incrementing refcount on 'left' node when it's referenced by
path, simply transfer ownership to path and set left to NULL. This
eliminates:
- Unnecessary refcount increment/decrement operations
- Redundant conditional checks for left node cleanup
The path now consistently owns the left node reference when used.
Signed-off-by: Sun YangKai <sunk67188@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent cd333ea commit 064046d
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1125 | 1125 | | |
1126 | 1126 | | |
1127 | 1127 | | |
1128 | | - | |
1129 | 1128 | | |
1130 | 1129 | | |
1131 | 1130 | | |
1132 | 1131 | | |
| 1132 | + | |
| 1133 | + | |
1133 | 1134 | | |
1134 | 1135 | | |
1135 | 1136 | | |
| |||
1149 | 1150 | | |
1150 | 1151 | | |
1151 | 1152 | | |
1152 | | - | |
1153 | | - | |
| 1153 | + | |
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
| |||
0 commit comments