diff options
author | David Sterba <dsterba@suse.com> | 2018-02-19 11:24:18 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-26 09:09:39 -0400 |
commit | e67c718b5b9a306bde7e966be7b4ca48fa063d73 (patch) | |
tree | 5b4905cba33483869094404c531cba4d30767780 /fs/btrfs/tree-checker.c | |
parent | ffc5a3794f9779c1a09e18e6d75bb6cc22b37523 (diff) |
btrfs: add more __cold annotations
The __cold functions are placed to a special section, as they're
expected to be called rarely. This could help i-cache prefetches or help
compiler to decide which branches are more/less likely to be taken
without any other annotations needed.
Though we can't add more __exit annotations, it's still possible to add
__cold (that's also added with __exit). That way the following function
categories are tagged:
- printf wrappers, error messages
- exit helpers
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-checker.c')
-rw-r--r-- | fs/btrfs/tree-checker.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c index e96cfd93ae3f..8871286c1a91 100644 --- a/fs/btrfs/tree-checker.c +++ b/fs/btrfs/tree-checker.c | |||
@@ -52,6 +52,7 @@ | |||
52 | * Allows callers to customize the output. | 52 | * Allows callers to customize the output. |
53 | */ | 53 | */ |
54 | __printf(4, 5) | 54 | __printf(4, 5) |
55 | __cold | ||
55 | static void generic_err(const struct btrfs_fs_info *fs_info, | 56 | static void generic_err(const struct btrfs_fs_info *fs_info, |
56 | const struct extent_buffer *eb, int slot, | 57 | const struct extent_buffer *eb, int slot, |
57 | const char *fmt, ...) | 58 | const char *fmt, ...) |
@@ -76,6 +77,7 @@ static void generic_err(const struct btrfs_fs_info *fs_info, | |||
76 | * offset has its own meaning. | 77 | * offset has its own meaning. |
77 | */ | 78 | */ |
78 | __printf(4, 5) | 79 | __printf(4, 5) |
80 | __cold | ||
79 | static void file_extent_err(const struct btrfs_fs_info *fs_info, | 81 | static void file_extent_err(const struct btrfs_fs_info *fs_info, |
80 | const struct extent_buffer *eb, int slot, | 82 | const struct extent_buffer *eb, int slot, |
81 | const char *fmt, ...) | 83 | const char *fmt, ...) |
@@ -229,6 +231,7 @@ static int check_csum_item(struct btrfs_fs_info *fs_info, | |||
229 | * which represents inode number | 231 | * which represents inode number |
230 | */ | 232 | */ |
231 | __printf(4, 5) | 233 | __printf(4, 5) |
234 | __cold | ||
232 | static void dir_item_err(const struct btrfs_fs_info *fs_info, | 235 | static void dir_item_err(const struct btrfs_fs_info *fs_info, |
233 | const struct extent_buffer *eb, int slot, | 236 | const struct extent_buffer *eb, int slot, |
234 | const char *fmt, ...) | 237 | const char *fmt, ...) |