ocfs2: use max() to improve ocfs2_dlm_seq_show()

Use the max() macro to simplify the ocfs2_dlm_seq_show() function and
improve its readability.

Link: https://lkml.kernel.org/r/20240820021605.97887-3-thorsten.blum@toblux.com
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Thorsten Blum 2024-08-20 04:16:07 +02:00 committed by Andrew Morton
parent 7f86b29427
commit 105ae044d6

View File

@ -3151,11 +3151,8 @@ static int ocfs2_dlm_seq_show(struct seq_file *m, void *v)
#ifdef CONFIG_OCFS2_FS_STATS #ifdef CONFIG_OCFS2_FS_STATS
if (!lockres->l_lock_wait && dlm_debug->d_filter_secs) { if (!lockres->l_lock_wait && dlm_debug->d_filter_secs) {
now = ktime_to_us(ktime_get_real()); now = ktime_to_us(ktime_get_real());
if (lockres->l_lock_prmode.ls_last > last = max(lockres->l_lock_prmode.ls_last,
lockres->l_lock_exmode.ls_last) lockres->l_lock_exmode.ls_last);
last = lockres->l_lock_prmode.ls_last;
else
last = lockres->l_lock_exmode.ls_last;
/* /*
* Use d_filter_secs field to filter lock resources dump, * Use d_filter_secs field to filter lock resources dump,
* the default d_filter_secs(0) value filters nothing, * the default d_filter_secs(0) value filters nothing,