lkml.org 
[lkml]   [2022]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] f2fs: merge f2fs_show_injection_info() into time_to_inject()
On 2022/12/19 21:25, Yangtao Li wrote:
> There is no need to additionally use f2fs_show_injection_info()
> to output information. Concatenate time_to_inject() and
> __time_to_inject() via a macro. In the new __time_to_inject()
> function, pass in the caller function name. And in order to avoid
> this inline function is not expanded causing __builtin_return_address(0)
> return address of of time_to_inject(), mark time_to_inject() as
> __always_inline.

IMO, we'd better have a good reason (maybe performace related) to change
inline to __always_inline, rather than avoiding printed message change
due to compile option.

> -static inline bool time_to_inject(struct f2fs_sb_info *sbi, int type)
> +#define time_to_inject(sbi, type) __time_to_inject(sbi, type, __func__)
> +static __always_inline bool __time_to_inject(struct f2fs_sb_info *sbi, int type,
> + const char *func_name)

How about:

#define time_to_inject(sbi, type) __time_to_inject(sbi, type, __func__, \
__builtin_return_address(0))
static inline bool __time_to_inject(struct f2fs_sb_info *sbi, int type,
const char *func, const char *parent_func)

Thanks,

\
 
 \ /
  Last update: 2023-03-26 23:15    [W:0.042 / U:1.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site