Merge branches 'rgrp-glock-sharing' and 'gfs2-revoke' from https://git.kernel.org...
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 22 Feb 2021 20:22:16 +0000 (21:22 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 23 Feb 2021 17:54:22 +0000 (18:54 +0100)
Merge the resource group glock sharing feature and the revoke accounting rework.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1  2  3 
fs/gfs2/bmap.c
fs/gfs2/incore.h
fs/gfs2/log.c
fs/gfs2/lops.c
fs/gfs2/lops.h
fs/gfs2/ops_fstype.c
fs/gfs2/super.c
fs/gfs2/trans.h
fs/gfs2/xattr.c

diff --cc fs/gfs2/bmap.c
Simple merge
Simple merge
diff --cc fs/gfs2/log.c
@@@@ -549,43 -549,43 -661,16 +661,16 @@@@ static unsigned int calc_reserved(struc
        return reserved;
   }
   
-- static unsigned int current_tail(struct gfs2_sbd *sdp)
 - {
 -      struct gfs2_trans *tr;
 -      unsigned int tail;
 - 
 -      spin_lock(&sdp->sd_ail_lock);
 - 
 -      if (list_empty(&sdp->sd_ail1_list)) {
 -              tail = sdp->sd_log_head;
 -      } else {
 -              tr = list_last_entry(&sdp->sd_ail1_list, struct gfs2_trans,
 -                              tr_list);
 -              tail = tr->tr_first;
 -      }
 - 
 -      spin_unlock(&sdp->sd_ail_lock);
 - 
 -      return tail;
 - }
 - 
 - static void log_pull_tail(struct gfs2_sbd *sdp, unsigned int new_tail)
++ static void log_pull_tail(struct gfs2_sbd *sdp)
   {
-       struct gfs2_trans *tr;
-       unsigned int tail;
-  
-       spin_lock(&sdp->sd_ail_lock);
-  
-       if (list_empty(&sdp->sd_ail1_list)) {
-               tail = sdp->sd_log_head;
-       } else {
-               tr = list_last_entry(&sdp->sd_ail1_list, struct gfs2_trans,
-                               tr_list);
-               tail = tr->tr_first;
-       }
-  
-       spin_unlock(&sdp->sd_ail_lock);
-  
-       return tail;
-  }
-  
-  static void log_pull_tail(struct gfs2_sbd *sdp, unsigned int new_tail)
-  {
--      unsigned int dist = log_distance(sdp, new_tail, sdp->sd_log_tail);
++      unsigned int new_tail = sdp->sd_log_flush_tail;
++      unsigned int dist;
   
++      if (new_tail == sdp->sd_log_tail)
++              return;
++      dist = log_distance(sdp, new_tail, sdp->sd_log_tail);
        ail2_empty(sdp, new_tail);
-- 
--      atomic_add(dist, &sdp->sd_log_blks_free);
--      trace_gfs2_log_blocks(sdp, dist);
--      gfs2_assert_withdraw(sdp, atomic_read(&sdp->sd_log_blks_free) <=
--                           sdp->sd_jdesc->jd_blocks);
-- 
++      gfs2_log_release(sdp, dist);
        sdp->sd_log_tail = new_tail;
   }
   
@@@@ -822,10 -822,10 -883,8 +883,8 @@@@ void gfs2_write_log_header(struct gfs2_
                     sb->s_blocksize - LH_V1_SIZE - 4);
        lh->lh_crc = cpu_to_be32(crc);
   
 --     gfs2_log_write(sdp, page, sb->s_blocksize, 0, dblock);
 --     gfs2_log_submit_bio(&sdp->sd_log_bio, REQ_OP_WRITE | op_flags);
 - out:
 -      log_flush_wait(sdp);
 ++     gfs2_log_write(sdp, jd, page, sb->s_blocksize, 0, dblock);
 ++     gfs2_log_submit_bio(&jd->jd_log_bio, REQ_OP_WRITE | op_flags);
-  out:
-       log_flush_wait(sdp);
   }
   
   /**
@@@@ -1004,10 -1004,11 -1086,9 +1086,8 @@@@ repeat
                goto out_withdraw;
   
        if (sdp->sd_log_head != sdp->sd_log_flush_head) {
 --             log_flush_wait(sdp);
                log_write_header(sdp, flags);
--      } else if (sdp->sd_log_tail != current_tail(sdp) && !sdp->sd_log_idle){
--              atomic_dec(&sdp->sd_log_blks_free); /* Adjust for unreserved buffer */
--              trace_gfs2_log_blocks(sdp, -1);
++      } else if (sdp->sd_log_tail != sdp->sd_log_flush_tail && !sdp->sd_log_idle) {
                log_write_header(sdp, flags);
        }
        if (gfs2_withdrawn(sdp))
diff --cc fs/gfs2/lops.c
Simple merge
diff --cc fs/gfs2/lops.h
Simple merge
Simple merge
diff --cc fs/gfs2/super.c
@@@@ -620,15 -652,18 -645,18 +613,15 @@@@ int gfs2_make_fs_ro(struct gfs2_sbd *sd
   
                gfs2_log_flush(sdp, NULL, GFS2_LOG_HEAD_FLUSH_SHUTDOWN |
                               GFS2_LFC_MAKE_FS_RO);
--              wait_event(sdp->sd_reserving_log_wait,
--                         atomic_read(&sdp->sd_reserving_log) == 0);
--              gfs2_assert_warn(sdp, atomic_read(&sdp->sd_log_blks_free) ==
--                               sdp->sd_jdesc->jd_blocks);
++              wait_event_timeout(sdp->sd_log_waitq,
++                                 gfs2_log_is_empty(sdp),
++                                 HZ * 5);
++              gfs2_assert_warn(sdp, gfs2_log_is_empty(sdp));
        } else {
--              wait_event_timeout(sdp->sd_reserving_log_wait,
--                                 atomic_read(&sdp->sd_reserving_log) == 0,
++              wait_event_timeout(sdp->sd_log_waitq,
++                                 gfs2_log_is_empty(sdp),
                                   HZ * 5);
        }
 --     if (gfs2_holder_initialized(&freeze_gh))
 --             gfs2_glock_dq_uninit(&freeze_gh);
 --
        gfs2_quota_cleanup(sdp);
   
        if (!log_write_allowed)
diff --cc fs/gfs2/trans.h
Simple merge
diff --cc fs/gfs2/xattr.c
Simple merge