[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e8b5af8b-6265-4f48-9c8f-d5a8d1302e5d@linux.alibaba.com>
Date: Tue, 20 Aug 2024 20:17:33 +0800
From: Joseph Qi <joseph.qi@...ux.alibaba.com>
To: Thorsten Blum <thorsten.blum@...lux.com>, mark@...heh.com,
jlbec@...lplan.org, akpm <akpm@...ux-foundation.org>
Cc: ocfs2-devel@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ocfs2: Use max() to improve ocfs2_dlm_seq_show()
On 8/20/24 10:16 AM, Thorsten Blum wrote:
> Use the max() macro to simplify the ocfs2_dlm_seq_show() function and
> improve its readability.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@...lux.com>
Reviewed-by: Joseph Qi <joseph.qi@...ux.alibaba.com>
> ---
> fs/ocfs2/dlmglue.c | 7 ++-----
> 1 file 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,
Powered by blists - more mailing lists