Commit c3df76a
btrfs: tag as unlikely fs aborted checks in space flushing code
It's not expected to have the fs in an aborted state, so surround the
abortion checks with unlikely to make it clear it's unexpected and to
hint the compiler to generate better code.
Also at maybe_fail_all_tickets() untangle all repeated checks for the
abortion into a single if-then-else. This makes things more readable
and makes the compiler generate less code. On x86_64 with gcc 14.2.0-19
from Debian I got the following object size differentes.
Before this change:
$ size fs/btrfs/btrfs.ko
text data bss dec hex filename
2021606 179704 25088 2226398 21f8de fs/btrfs/btrfs.ko
After this change:
$ size fs/btrfs/btrfs.ko
text data bss dec hex filename
2021458 179704 25088 2226250 21f84a fs/btrfs/btrfs.ko
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent aa695ae commit c3df76a
1 file changed
+18
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1114 | 1114 | | |
1115 | 1115 | | |
1116 | 1116 | | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
1117 | 1122 | | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
1124 | 1126 | | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
1128 | 1127 | | |
1129 | 1128 | | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1137 | 1135 | | |
| 1136 | + | |
1138 | 1137 | | |
1139 | 1138 | | |
1140 | 1139 | | |
| |||
1410 | 1409 | | |
1411 | 1410 | | |
1412 | 1411 | | |
1413 | | - | |
| 1412 | + | |
1414 | 1413 | | |
1415 | 1414 | | |
1416 | 1415 | | |
| |||
1444 | 1443 | | |
1445 | 1444 | | |
1446 | 1445 | | |
1447 | | - | |
| 1446 | + | |
1448 | 1447 | | |
1449 | 1448 | | |
1450 | 1449 | | |
| |||
1548 | 1547 | | |
1549 | 1548 | | |
1550 | 1549 | | |
1551 | | - | |
| 1550 | + | |
1552 | 1551 | | |
1553 | 1552 | | |
1554 | 1553 | | |
| |||
0 commit comments