[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250419065335.211252-1-wdhh6@aliyun.com>
Date: Sat, 19 Apr 2025 14:53:35 +0800
From: Chaohai Chen <wdhh6@...yun.com>
To: agruenba@...hat.com
Cc: gfs2@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Chaohai Chen <wdhh6@...yun.com>
Subject: [PATCH] fs:gfs:glock: Delete the invalid pointer insert_pt in add_to_queue()
The point insert_pt is always NULL, no one will change it, delete the code
and useless logic about it.
Signed-off-by: Chaohai Chen <wdhh6@...yun.com>
---
fs/gfs2/glock.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 65c07aa95718..8a0f2140b9b3 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1483,7 +1483,6 @@ __acquires(&gl->gl_lockref.lock)
{
struct gfs2_glock *gl = gh->gh_gl;
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
- struct list_head *insert_pt = NULL;
struct gfs2_holder *gh2;
int try_futile = 0;
@@ -1525,15 +1524,7 @@ __acquires(&gl->gl_lockref.lock)
trace_gfs2_glock_queue(gh, 1);
gfs2_glstats_inc(gl, GFS2_LKS_QCOUNT);
gfs2_sbstats_inc(gl, GFS2_LKS_QCOUNT);
- if (likely(insert_pt == NULL)) {
- list_add_tail(&gh->gh_list, &gl->gl_holders);
- return;
- }
- list_add_tail(&gh->gh_list, insert_pt);
- spin_unlock(&gl->gl_lockref.lock);
- if (sdp->sd_lockstruct.ls_ops->lm_cancel)
- sdp->sd_lockstruct.ls_ops->lm_cancel(gl);
- spin_lock(&gl->gl_lockref.lock);
+ list_add_tail(&gh->gh_list, &gl->gl_holders);
return;
trap_recursive:
--
2.34.1
Powered by blists - more mailing lists