]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
gfs2: Get rid of the gfs2_glock_is_held_* helpers
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 20 Sep 2023 18:07:06 +0000 (20:07 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Fri, 22 Sep 2023 11:42:19 +0000 (13:42 +0200)
Those helpers don't add any clarity and are easy to use wrong.  Spell
them out to make more obvious what's happening.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/aops.c
fs/gfs2/glock.h
fs/gfs2/inode.c

index c26d48355cc2702759ffe8f52f68655f047d8d29..52fad5bcb0472e5a92e9c69993981c9097427f81 100644 (file)
@@ -155,7 +155,7 @@ static int gfs2_jdata_writepage(struct page *page, struct writeback_control *wbc
        struct gfs2_inode *ip = GFS2_I(inode);
        struct gfs2_sbd *sdp = GFS2_SB(inode);
 
-       if (gfs2_assert_withdraw(sdp, gfs2_glock_is_held_excl(ip->i_gl)))
+       if (gfs2_assert_withdraw(sdp, ip->i_gl->gl_state == LM_ST_EXCLUSIVE))
                goto out;
        if (folio_test_checked(folio) || current->journal_info)
                goto out_ignore;
index c8685ca7d2a26a751553a25d95fd3b6e66765cb9..4daad53f9436c0b6510a0a0aacd272ee95240040 100644 (file)
@@ -156,21 +156,6 @@ out:
        return gh;
 }
 
-static inline int gfs2_glock_is_held_excl(struct gfs2_glock *gl)
-{
-       return gl->gl_state == LM_ST_EXCLUSIVE;
-}
-
-static inline int gfs2_glock_is_held_dfrd(struct gfs2_glock *gl)
-{
-       return gl->gl_state == LM_ST_DEFERRED;
-}
-
-static inline int gfs2_glock_is_held_shrd(struct gfs2_glock *gl)
-{
-       return gl->gl_state == LM_ST_SHARED;
-}
-
 static inline struct address_space *gfs2_glock2aspace(struct gfs2_glock *gl)
 {
        if (gl->gl_ops->go_flags & GLOF_ASPACE) {
index 0eac0450790471d09b49741fbffad643ba74db85..2880d6ca19e10bdc5e12e9ac2ed68e6fb7f98b1a 100644 (file)
@@ -2153,7 +2153,7 @@ static int gfs2_update_time(struct inode *inode, int flags)
        int error;
 
        gh = gfs2_glock_is_locked_by_me(gl);
-       if (gh && !gfs2_glock_is_held_excl(gl)) {
+       if (gh && gl->gl_state != LM_ST_EXCLUSIVE) {
                gfs2_glock_dq(gh);
                gfs2_holder_reinit(LM_ST_EXCLUSIVE, 0, gh);
                error = gfs2_glock_nq(gh);