Commit ad3b3be
btrfs: send: add unlikely to all unexpected overflow checks
There are several checks for unexpected overflows of buffers and path
lengths that makes us fail the send operation with an error if for some
highly unexpected reason they happen. So add the unlikely tag to those
checks to hint the compiler to generate better code, while also making
it more explicit in the source that it's highly unexpected.
With gcc 14.2.0-19 from Debian on x86_64, I also got a small reduction
the text size of the btrfs module.
Before:
$ size fs/btrfs/btrfs.ko
text data bss dec hex filename
1936917 162723 15592 2115232 2046a0 fs/btrfs/btrfs.ko
After:
$ size fs/btrfs/btrfs.ko
text data bss dec hex filename
1936789 162723 15592 2115104 204620 fs/btrfs/btrfs.ko
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent d8e5214 commit ad3b3be
1 file changed
+9
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
1137 | | - | |
| 1137 | + | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
1141 | | - | |
1142 | | - | |
| 1141 | + | |
| 1142 | + | |
1143 | 1143 | | |
1144 | 1144 | | |
1145 | 1145 | | |
1146 | 1146 | | |
1147 | 1147 | | |
1148 | 1148 | | |
1149 | 1149 | | |
1150 | | - | |
| 1150 | + | |
1151 | 1151 | | |
1152 | 1152 | | |
1153 | 1153 | | |
| |||
5129 | 5129 | | |
5130 | 5130 | | |
5131 | 5131 | | |
5132 | | - | |
| 5132 | + | |
5133 | 5133 | | |
5134 | 5134 | | |
5135 | 5135 | | |
| |||
5173 | 5173 | | |
5174 | 5174 | | |
5175 | 5175 | | |
5176 | | - | |
| 5176 | + | |
5177 | 5177 | | |
5178 | 5178 | | |
5179 | 5179 | | |
5180 | 5180 | | |
5181 | 5181 | | |
5182 | 5182 | | |
5183 | | - | |
| 5183 | + | |
5184 | 5184 | | |
5185 | 5185 | | |
5186 | 5186 | | |
| |||
5580 | 5580 | | |
5581 | 5581 | | |
5582 | 5582 | | |
5583 | | - | |
5584 | | - | |
| 5583 | + | |
| 5584 | + | |
5585 | 5585 | | |
5586 | 5586 | | |
5587 | 5587 | | |
| |||
0 commit comments