From: Bob Peterson Date: Tue, 11 Dec 2007 19:04:49 -0600 Subject: [Cluster-devel] [GFS2] [Patch 4/10] Get rid of sd_statfs_mutex Message-ID: <1197421489.23671.36.camel@technetium.msp.redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, This patch eliminates the sd_statfs_mutex variable when doing updates to local statfs change files. The new code uses the sd_statfs_spin spin_lock that's already taken to get the same effect. Regards, Bob Peterson Red Hat GFS Signed-off-by: Bob Peterson -- .../fs/gfs2/incore.h | 1 - .../fs/gfs2/ops_fstype.c | 1 - .../fs/gfs2/super.c | 10 ++-------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/gfs2-2.6.git.patch3/fs/gfs2/incore.h b/gfs2-2.6.git.patch4/fs/gfs2/incore.h index 14862d1..9a83429 100644 --- a/gfs2-2.6.git.patch3/fs/gfs2/incore.h +++ b/gfs2-2.6.git.patch4/fs/gfs2/incore.h @@ -527,7 +527,6 @@ struct gfs2_sbd { /* StatFS stuff */ spinlock_t sd_statfs_spin; - struct mutex sd_statfs_mutex; struct gfs2_statfs_change_host sd_statfs_master; struct gfs2_statfs_change_host sd_statfs_local; unsigned long sd_statfs_sync_time; diff --git a/gfs2-2.6.git.patch3/fs/gfs2/ops_fstype.c b/gfs2-2.6.git.patch4/fs/gfs2/ops_fstype.c index 35ec630..22e260e 100644 --- a/gfs2-2.6.git.patch3/fs/gfs2/ops_fstype.c +++ b/gfs2-2.6.git.patch4/fs/gfs2/ops_fstype.c @@ -60,7 +60,6 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb) mutex_init(&sdp->sd_inum_mutex); spin_lock_init(&sdp->sd_statfs_spin); - mutex_init(&sdp->sd_statfs_mutex); spin_lock_init(&sdp->sd_rindex_spin); mutex_init(&sdp->sd_rindex_mutex); diff --git a/gfs2-2.6.git.patch3/fs/gfs2/super.c b/gfs2-2.6.git.patch4/fs/gfs2/super.c index dda7747..da5b29c 100644 --- a/gfs2-2.6.git.patch3/fs/gfs2/super.c +++ b/gfs2-2.6.git.patch4/fs/gfs2/super.c @@ -686,11 +686,8 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free, if (error) return; - mutex_lock(&sdp->sd_statfs_mutex); - gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); - mutex_unlock(&sdp->sd_statfs_mutex); - spin_lock(&sdp->sd_statfs_spin); + gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); l_sc->sc_total += total; l_sc->sc_free += free; l_sc->sc_dinodes += dinodes; @@ -736,11 +733,8 @@ int gfs2_statfs_sync(struct gfs2_sbd *sdp) if (error) goto out_bh2; - mutex_lock(&sdp->sd_statfs_mutex); - gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); - mutex_unlock(&sdp->sd_statfs_mutex); - spin_lock(&sdp->sd_statfs_spin); + gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); m_sc->sc_total += l_sc->sc_total; m_sc->sc_free += l_sc->sc_free; m_sc->sc_dinodes += l_sc->sc_dinodes;