aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/glock.c10
-rw-r--r--fs/gfs2/incore.h1
-rw-r--r--fs/gfs2/lock_dlm.c8
-rw-r--r--fs/gfs2/quota.c6
-rw-r--r--fs/gfs2/rgrp.c2
5 files changed, 12 insertions, 15 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 2284de4d05ce..274b6bed5d67 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -108,7 +108,7 @@ static void gfs2_glock_dealloc(struct rcu_head *rcu)
108 if (gl->gl_ops->go_flags & GLOF_ASPACE) { 108 if (gl->gl_ops->go_flags & GLOF_ASPACE) {
109 kmem_cache_free(gfs2_glock_aspace_cachep, gl); 109 kmem_cache_free(gfs2_glock_aspace_cachep, gl);
110 } else { 110 } else {
111 kfree(gl->gl_lvb); 111 kfree(gl->gl_lksb.sb_lvbptr);
112 kmem_cache_free(gfs2_glock_cachep, gl); 112 kmem_cache_free(gfs2_glock_cachep, gl);
113 } 113 }
114} 114}
@@ -740,15 +740,13 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
740 return -ENOMEM; 740 return -ENOMEM;
741 741
742 memset(&gl->gl_lksb, 0, sizeof(struct dlm_lksb)); 742 memset(&gl->gl_lksb, 0, sizeof(struct dlm_lksb));
743 gl->gl_lvb = NULL;
744 743
745 if (glops->go_flags & GLOF_LVB) { 744 if (glops->go_flags & GLOF_LVB) {
746 gl->gl_lvb = kzalloc(GFS2_MIN_LVB_SIZE, GFP_KERNEL); 745 gl->gl_lksb.sb_lvbptr = kzalloc(GFS2_MIN_LVB_SIZE, GFP_KERNEL);
747 if (!gl->gl_lvb) { 746 if (!gl->gl_lksb.sb_lvbptr) {
748 kmem_cache_free(cachep, gl); 747 kmem_cache_free(cachep, gl);
749 return -ENOMEM; 748 return -ENOMEM;
750 } 749 }
751 gl->gl_lksb.sb_lvbptr = gl->gl_lvb;
752 } 750 }
753 751
754 atomic_inc(&sdp->sd_glock_disposal); 752 atomic_inc(&sdp->sd_glock_disposal);
@@ -789,7 +787,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
789 tmp = search_bucket(hash, sdp, &name); 787 tmp = search_bucket(hash, sdp, &name);
790 if (tmp) { 788 if (tmp) {
791 spin_unlock_bucket(hash); 789 spin_unlock_bucket(hash);
792 kfree(gl->gl_lvb); 790 kfree(gl->gl_lksb.sb_lvbptr);
793 kmem_cache_free(cachep, gl); 791 kmem_cache_free(cachep, gl);
794 atomic_dec(&sdp->sd_glock_disposal); 792 atomic_dec(&sdp->sd_glock_disposal);
795 gl = tmp; 793 gl = tmp;
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index bd577fc59e0b..c373a24fedd9 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -322,7 +322,6 @@ struct gfs2_glock {
322 ktime_t gl_dstamp; 322 ktime_t gl_dstamp;
323 struct gfs2_lkstats gl_stats; 323 struct gfs2_lkstats gl_stats;
324 struct dlm_lksb gl_lksb; 324 struct dlm_lksb gl_lksb;
325 char *gl_lvb;
326 unsigned long gl_tchange; 325 unsigned long gl_tchange;
327 void *gl_object; 326 void *gl_object;
328 327
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index d28ae37ceb3c..8dad6b093716 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -120,8 +120,8 @@ static void gdlm_ast(void *arg)
120 gfs2_update_reply_times(gl); 120 gfs2_update_reply_times(gl);
121 BUG_ON(gl->gl_lksb.sb_flags & DLM_SBF_DEMOTED); 121 BUG_ON(gl->gl_lksb.sb_flags & DLM_SBF_DEMOTED);
122 122
123 if (gl->gl_lksb.sb_flags & DLM_SBF_VALNOTVALID && gl->gl_lvb) 123 if ((gl->gl_lksb.sb_flags & DLM_SBF_VALNOTVALID) && gl->gl_lksb.sb_lvbptr)
124 memset(gl->gl_lvb, 0, GDLM_LVB_SIZE); 124 memset(gl->gl_lksb.sb_lvbptr, 0, GDLM_LVB_SIZE);
125 125
126 switch (gl->gl_lksb.sb_status) { 126 switch (gl->gl_lksb.sb_status) {
127 case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */ 127 case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */
@@ -205,7 +205,7 @@ static u32 make_flags(struct gfs2_glock *gl, const unsigned int gfs_flags,
205{ 205{
206 u32 lkf = 0; 206 u32 lkf = 0;
207 207
208 if (gl->gl_lvb) 208 if (gl->gl_lksb.sb_lvbptr)
209 lkf |= DLM_LKF_VALBLK; 209 lkf |= DLM_LKF_VALBLK;
210 210
211 if (gfs_flags & LM_FLAG_TRY) 211 if (gfs_flags & LM_FLAG_TRY)
@@ -294,7 +294,7 @@ static void gdlm_put_lock(struct gfs2_glock *gl)
294 294
295 /* don't want to skip dlm_unlock writing the lvb when lock is ex */ 295 /* don't want to skip dlm_unlock writing the lvb when lock is ex */
296 if (test_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags) && 296 if (test_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags) &&
297 gl->gl_lvb && gl->gl_state != LM_ST_EXCLUSIVE) { 297 gl->gl_lksb.sb_lvbptr && (gl->gl_state != LM_ST_EXCLUSIVE)) {
298 gfs2_glock_free(gl); 298 gfs2_glock_free(gl);
299 return; 299 return;
300 } 300 }
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 6bbf64f0f5b6..ae55e248c3b7 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -869,7 +869,7 @@ static int update_qd(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd)
869 if (error < 0) 869 if (error < 0)
870 return error; 870 return error;
871 871
872 qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lvb; 872 qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lksb.sb_lvbptr;
873 qlvb->qb_magic = cpu_to_be32(GFS2_MAGIC); 873 qlvb->qb_magic = cpu_to_be32(GFS2_MAGIC);
874 qlvb->__pad = 0; 874 qlvb->__pad = 0;
875 qlvb->qb_limit = q.qu_limit; 875 qlvb->qb_limit = q.qu_limit;
@@ -893,7 +893,7 @@ restart:
893 if (error) 893 if (error)
894 return error; 894 return error;
895 895
896 qd->qd_qb = *(struct gfs2_quota_lvb *)qd->qd_gl->gl_lvb; 896 qd->qd_qb = *(struct gfs2_quota_lvb *)qd->qd_gl->gl_lksb.sb_lvbptr;
897 897
898 if (force_refresh || qd->qd_qb.qb_magic != cpu_to_be32(GFS2_MAGIC)) { 898 if (force_refresh || qd->qd_qb.qb_magic != cpu_to_be32(GFS2_MAGIC)) {
899 gfs2_glock_dq_uninit(q_gh); 899 gfs2_glock_dq_uninit(q_gh);
@@ -1506,7 +1506,7 @@ static int gfs2_get_dqblk(struct super_block *sb, struct kqid qid,
1506 if (error) 1506 if (error)
1507 goto out; 1507 goto out;
1508 1508
1509 qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lvb; 1509 qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lksb.sb_lvbptr;
1510 fdq->d_version = FS_DQUOT_VERSION; 1510 fdq->d_version = FS_DQUOT_VERSION;
1511 fdq->d_flags = (type == QUOTA_USER) ? FS_USER_QUOTA : FS_GROUP_QUOTA; 1511 fdq->d_flags = (type == QUOTA_USER) ? FS_USER_QUOTA : FS_GROUP_QUOTA;
1512 fdq->d_id = from_kqid(&init_user_ns, qid); 1512 fdq->d_id = from_kqid(&init_user_ns, qid);
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 5625e93bf61f..37ee061d899e 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -879,7 +879,7 @@ static int read_rindex_entry(struct gfs2_inode *ip)
879 goto fail; 879 goto fail;
880 880
881 rgd->rd_gl->gl_object = rgd; 881 rgd->rd_gl->gl_object = rgd;
882 rgd->rd_rgl = (struct gfs2_rgrp_lvb *)rgd->rd_gl->gl_lvb; 882 rgd->rd_rgl = (struct gfs2_rgrp_lvb *)rgd->rd_gl->gl_lksb.sb_lvbptr;
883 rgd->rd_flags &= ~GFS2_RDF_UPTODATE; 883 rgd->rd_flags &= ~GFS2_RDF_UPTODATE;
884 if (rgd->rd_data > sdp->sd_max_rg_data) 884 if (rgd->rd_data > sdp->sd_max_rg_data)
885 sdp->sd_max_rg_data = rgd->rd_data; 885 sdp->sd_max_rg_data = rgd->rd_data;