aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-04-24 13:11:57 -0400
committerChris Mason <clm@fb.com>2015-06-02 22:34:34 -0400
commitc0d19e2b9a521bbdc33049ad92c94b517afda1f0 (patch)
tree027f98e9d86a03a53c41fb3c34878c6f12457dc8 /fs/btrfs/ctree.h
parent1a9a8a71ed1d457d4f03284ebfd3e40fe1e217ac (diff)
btrfs: add 'cold' compiler annotations to all error handling functions
The annotated functios will be placed into .text.unlikely section. The annotation also hints compiler to move the code out of the hot paths, and may implicitly mark if-statement leading to that block as unlikely. This is a heuristic, the impact on the generated code is not significant. Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 98b33477235b..670e4be7225b 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -4050,6 +4050,7 @@ void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
4050 4050
4051#ifdef CONFIG_BTRFS_ASSERT 4051#ifdef CONFIG_BTRFS_ASSERT
4052 4052
4053__cold
4053static inline void assfail(char *expr, char *file, int line) 4054static inline void assfail(char *expr, char *file, int line)
4054{ 4055{
4055 pr_err("BTRFS: assertion failed: %s, file: %s, line: %d", 4056 pr_err("BTRFS: assertion failed: %s, file: %s, line: %d",
@@ -4065,10 +4066,12 @@ static inline void assfail(char *expr, char *file, int line)
4065 4066
4066#define btrfs_assert() 4067#define btrfs_assert()
4067__printf(5, 6) 4068__printf(5, 6)
4069__cold
4068void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function, 4070void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function,
4069 unsigned int line, int errno, const char *fmt, ...); 4071 unsigned int line, int errno, const char *fmt, ...);
4070 4072
4071 4073
4074__cold
4072void __btrfs_abort_transaction(struct btrfs_trans_handle *trans, 4075void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
4073 struct btrfs_root *root, const char *function, 4076 struct btrfs_root *root, const char *function,
4074 unsigned int line, int errno); 4077 unsigned int line, int errno);
@@ -4138,6 +4141,7 @@ do { \
4138} while (0) 4141} while (0)
4139 4142
4140__printf(5, 6) 4143__printf(5, 6)
4144__cold
4141void __btrfs_panic(struct btrfs_fs_info *fs_info, const char *function, 4145void __btrfs_panic(struct btrfs_fs_info *fs_info, const char *function,
4142 unsigned int line, int errno, const char *fmt, ...); 4146 unsigned int line, int errno, const char *fmt, ...);
4143 4147