GFS2: Get rid of dead code in inode_go_demote_ok
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 GFS2: Get rid of dead code in inode_go_demote_ok
Hi,
Function inode_go_demote_ok had some code that was only executed if gl_holders was not empty. However, if gl_holders was not empty, the only caller, demote_ok(), returns before inode_go_demote_ok would ever be called. Therefore, it's dead code, so I removed it.
---
fs/gfs2/glops.c +0 -7
@@ -286,17 +286,10 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)static int inode_go_demote_ok (const struct gfs2_glock *gl) {struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; -struct gfs2_holder *gh;if (sdp->sd_jindex == gl->gl_object || sdp->sd_rindex == gl->gl_object)return 0 ; -if (!list_empty (&gl->gl_holders)) { - gh = list_entry(gl->gl_holders.next, struct gfs2_holder, gh_list); -if (gh->gh_list.next != &gl->gl_holders) -return 0 ; - } -return 1 ; }
PATCH 1/1 GFS2: Get rid of dead code in inode_go_demote_ok
Looks like a useful clean up.
Steve.
Quoted 32 lines · Bob Peterson
Hi,
Function
inode_go_demote_okhad some code that was only executed ifgl_holderswas not empty. However, ifgl_holderswas not empty, the only caller,demote_ok(), returns beforeinode_go_demote_okwould ever be called. Therefore, it's dead code, so I removed it.Signed-off-by Bob Peterson <[email protected]>---
fs/gfs2/glops.c +0
-7@@ -286,17 +286,10 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)static int inode_go_demote_ok (const struct gfs2_glock *gl) {struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; -struct gfs2_holder *gh;if (sdp->sd_jindex == gl->gl_object || sdp->sd_rindex == gl->gl_object)return 0 ; -if (!list_empty (&gl->gl_holders)) { - gh = list_entry(gl->gl_holders.next, struct gfs2_holder, gh_list); -if (gh->gh_list.next != &gl->gl_holders) -return 0 ; - } -return 1 ; }