diff options
author | Thorsten Blum <thorsten.blum@toblux.com> | 2024-08-20 04:16:07 +0200 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-09-02 05:43:38 +0200 |
commit | 105ae044d6f3d7f8136d1ddac4c708595f643562 (patch) | |
tree | 2266f1430eba548c6b0b44be3b8a35889f7b2e7e /fs/ocfs2 | |
parent | ocfs2: fix shift-out-of-bounds UBSAN bug in ocfs2_verify_volume() (diff) | |
download | linux-105ae044d6f3d7f8136d1ddac4c708595f643562.tar.xz linux-105ae044d6f3d7f8136d1ddac4c708595f643562.zip |
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>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/dlmglue.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index da78a04d6f0b..60df52e4c1f8 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3151,11 +3151,8 @@ static int ocfs2_dlm_seq_show(struct seq_file *m, void *v) #ifdef CONFIG_OCFS2_FS_STATS if (!lockres->l_lock_wait && dlm_debug->d_filter_secs) { now = ktime_to_us(ktime_get_real()); - if (lockres->l_lock_prmode.ls_last > - lockres->l_lock_exmode.ls_last) - last = lockres->l_lock_prmode.ls_last; - else - last = lockres->l_lock_exmode.ls_last; + last = max(lockres->l_lock_prmode.ls_last, + lockres->l_lock_exmode.ls_last); /* * Use d_filter_secs field to filter lock resources dump, * the default d_filter_secs(0) value filters nothing, |