]> Gentwo Git Trees - linux/.git/commitdiff
gfs2: Rename LM_FLAG_{NOEXP -> RECOVER}
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 16 Jul 2025 13:18:09 +0000 (15:18 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 26 Nov 2025 23:52:26 +0000 (23:52 +0000)
GFS sets the LM_FLAG_NOEXP flag on locking requests it makes during
journal recovery, so rename the flag to LM_FLAG_RECOVER for improved
code readability.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c
fs/gfs2/glock.h
fs/gfs2/ops_fstype.c
fs/gfs2/recovery.c
fs/gfs2/super.c
fs/gfs2/util.c

index 7dd96086eeaa4a31a10f9ace2ade57e4aaf8f5b4..fc9e54cd241b8a9bb512ba3a01717d8fd4496ca6 100644 (file)
@@ -692,7 +692,7 @@ __acquires(&gl->gl_lockref.lock)
        int ret;
 
        if (target != LM_ST_UNLOCKED && glock_blocked_by_withdraw(gl) &&
-           gh && !(gh->gh_flags & LM_FLAG_NOEXP))
+           gh && !(gh->gh_flags & LM_FLAG_RECOVER))
                goto skip_inval;
 
        GLOCK_BUG_ON(gl, gl->gl_state == target);
@@ -1550,7 +1550,7 @@ int gfs2_glock_nq(struct gfs2_holder *gh)
        struct gfs2_glock *gl = gh->gh_gl;
        int error;
 
-       if (glock_blocked_by_withdraw(gl) && !(gh->gh_flags & LM_FLAG_NOEXP))
+       if (glock_blocked_by_withdraw(gl) && !(gh->gh_flags & LM_FLAG_RECOVER))
                return -EIO;
 
        if (gh->gh_flags & GL_NOBLOCK) {
@@ -1575,7 +1575,7 @@ int gfs2_glock_nq(struct gfs2_holder *gh)
        gh->gh_error = 0;
        spin_lock(&gl->gl_lockref.lock);
        add_to_queue(gh);
-       if (unlikely((LM_FLAG_NOEXP & gh->gh_flags) &&
+       if (unlikely((LM_FLAG_RECOVER & gh->gh_flags) &&
                     test_and_clear_bit(GLF_HAVE_FROZEN_REPLY, &gl->gl_flags))) {
                set_bit(GLF_HAVE_REPLY, &gl->gl_flags);
                gl->gl_lockref.count++;
@@ -1880,7 +1880,7 @@ void gfs2_glock_cb(struct gfs2_glock *gl, unsigned int state)
  *
  * Glocks are not frozen if (a) the result of the dlm operation is
  * an error, (b) the locking operation was an unlock operation or
- * (c) if there is a "noexp" flagged request anywhere in the queue
+ * (c) if there is a "recover" flagged request anywhere in the queue
  *
  * Returns: 1 if freezing should occur, 0 otherwise
  */
@@ -1897,7 +1897,7 @@ static int gfs2_should_freeze(const struct gfs2_glock *gl)
        list_for_each_entry(gh, &gl->gl_holders, gh_list) {
                if (test_bit(HIF_HOLDER, &gh->gh_iflags))
                        continue;
-               if (LM_FLAG_NOEXP & gh->gh_flags)
+               if (LM_FLAG_RECOVER & gh->gh_flags)
                        return 0;
        }
 
@@ -2246,7 +2246,7 @@ static const char *hflags2str(char *buf, u16 flags, unsigned long iflags)
                *p++ = 't';
        if (flags & LM_FLAG_TRY_1CB)
                *p++ = 'T';
-       if (flags & LM_FLAG_NOEXP)
+       if (flags & LM_FLAG_RECOVER)
                *p++ = 'e';
        if (flags & LM_FLAG_ANY)
                *p++ = 'A';
index dfbe06346b35e7259772d3f3febe06486760ee5f..e84ef6c6164dd162c2c0eb6f71606e977a768200 100644 (file)
@@ -58,10 +58,10 @@ enum {
  * LM_FLAG_TRY_1CB
  * Send one blocking callback if TRY is set and the lock is not granted.
  *
- * LM_FLAG_NOEXP
+ * LM_FLAG_RECOVER
  * GFS sets this flag on lock requests it makes while doing journal recovery.
- * These special requests should not be blocked due to the recovery like
- * ordinary locks would be.
+ * While ordinary requests are blocked until the end of recovery, requests
+ * with this flag set do proceed.
  *
  * LM_FLAG_ANY
  * A SHARED request may also be granted in DEFERRED, or a DEFERRED request may
@@ -80,7 +80,7 @@ enum {
 
 #define LM_FLAG_TRY            0x0001
 #define LM_FLAG_TRY_1CB                0x0002
-#define LM_FLAG_NOEXP          0x0004
+#define LM_FLAG_RECOVER                0x0004
 #define LM_FLAG_ANY            0x0008
 #define LM_FLAG_NODE_SCOPE     0x0020
 #define GL_ASYNC               0x0040
index 3138cc4658d3d644f529a1ea5f6523cc2f8d31cf..c62bcc413df0e7e422488bac3ea4dc104feebe1f 100644 (file)
@@ -370,7 +370,7 @@ static int init_locking(struct gfs2_sbd *sdp, struct gfs2_holder *mount_gh,
        error = gfs2_glock_nq_num(sdp,
                                  GFS2_MOUNT_LOCK, &gfs2_nondisk_glops,
                                  LM_ST_EXCLUSIVE,
-                                 LM_FLAG_NOEXP | GL_NOCACHE | GL_NOPID,
+                                 LM_FLAG_RECOVER | GL_NOCACHE | GL_NOPID,
                                  mount_gh);
        if (error) {
                fs_err(sdp, "can't acquire mount glock: %d\n", error);
@@ -380,7 +380,7 @@ static int init_locking(struct gfs2_sbd *sdp, struct gfs2_holder *mount_gh,
        error = gfs2_glock_nq_num(sdp,
                                  GFS2_LIVE_LOCK, &gfs2_nondisk_glops,
                                  LM_ST_SHARED,
-                                 LM_FLAG_NOEXP | GL_EXACT | GL_NOPID,
+                                 LM_FLAG_RECOVER | GL_EXACT | GL_NOPID,
                                  &sdp->sd_live_gh);
        if (error) {
                fs_err(sdp, "can't acquire live glock: %d\n", error);
@@ -745,7 +745,8 @@ static int init_journal(struct gfs2_sbd *sdp, int undo)
                error = gfs2_glock_nq_num(sdp, sdp->sd_lockstruct.ls_jid,
                                          &gfs2_journal_glops,
                                          LM_ST_EXCLUSIVE,
-                                         LM_FLAG_NOEXP | GL_NOCACHE | GL_NOPID,
+                                         LM_FLAG_RECOVER |
+                                         GL_NOCACHE | GL_NOPID,
                                          &sdp->sd_journal_gh);
                if (error) {
                        fs_err(sdp, "can't acquire journal glock: %d\n", error);
@@ -755,7 +756,7 @@ static int init_journal(struct gfs2_sbd *sdp, int undo)
                ip = GFS2_I(sdp->sd_jdesc->jd_inode);
                sdp->sd_jinode_gl = ip->i_gl;
                error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED,
-                                          LM_FLAG_NOEXP | GL_EXACT |
+                                          LM_FLAG_RECOVER | GL_EXACT |
                                           GL_NOCACHE | GL_NOPID,
                                           &sdp->sd_jinode_gh);
                if (error) {
index 4873b1c0e1bdf7f237c627ed29caa22fc9382023..8c8202c68b645ffe852ff7f821cddb7efff508bc 100644 (file)
@@ -424,7 +424,8 @@ void gfs2_recover_func(struct work_struct *work)
 
                error = gfs2_glock_nq_num(sdp, jd->jd_jid, &gfs2_journal_glops,
                                          LM_ST_EXCLUSIVE,
-                                         LM_FLAG_NOEXP | LM_FLAG_TRY | GL_NOCACHE,
+                                         LM_FLAG_RECOVER | LM_FLAG_TRY |
+                                         GL_NOCACHE,
                                          &j_gh);
                switch (error) {
                case 0:
@@ -440,7 +441,8 @@ void gfs2_recover_func(struct work_struct *work)
                }
 
                error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED,
-                                          LM_FLAG_NOEXP | GL_NOCACHE, &ji_gh);
+                                          LM_FLAG_RECOVER | GL_NOCACHE,
+                                          &ji_gh);
                if (error)
                        goto fail_gunlock_j;
        } else {
index a384b1713409faf77146997b6138f84bdf5884d4..6472e92571a636b052625e3bd797e1f78011324e 100644 (file)
@@ -351,7 +351,7 @@ static int gfs2_lock_fs_check_clean(struct gfs2_sbd *sdp)
        gfs2_freeze_unlock(sdp);
 
        error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_EXCLUSIVE,
-                                  LM_FLAG_NOEXP | GL_NOPID,
+                                  LM_FLAG_RECOVER | GL_NOPID,
                                   &sdp->sd_freeze_gh);
        if (error)
                goto relock_shared;
index d0c1345421fc421cf5bbf4ce891a19ab0522d462..8e47f106e2baa048ea1565fe2ae276acdacc2d01 100644 (file)
@@ -58,7 +58,7 @@ int check_journal_clean(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
        struct gfs2_inode *ip;
 
        ip = GFS2_I(jd->jd_inode);
-       error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_NOEXP |
+       error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_RECOVER |
                                   GL_EXACT | GL_NOCACHE, &j_gh);
        if (error) {
                if (verbose)
@@ -99,7 +99,7 @@ int check_journal_clean(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
  */
 int gfs2_freeze_lock_shared(struct gfs2_sbd *sdp)
 {
-       int flags = LM_FLAG_NOEXP | GL_EXACT;
+       int flags = LM_FLAG_RECOVER | GL_EXACT;
        int error;
 
        error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, flags,
@@ -224,7 +224,7 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
        fs_warn(sdp, "Requesting recovery of jid %d.\n",
                sdp->sd_lockstruct.ls_jid);
        gfs2_holder_reinit(LM_ST_EXCLUSIVE,
-                          LM_FLAG_TRY_1CB | LM_FLAG_NOEXP | GL_NOPID,
+                          LM_FLAG_TRY_1CB | LM_FLAG_RECOVER | GL_NOPID,
                           &sdp->sd_live_gh);
        msleep(GL_GLOCK_MAX_HOLD);
        /*