aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/glock.c3
-rw-r--r--fs/gfs2/glops.c10
-rw-r--r--fs/gfs2/incore.h5
-rw-r--r--fs/gfs2/ops_fstype.c4
-rw-r--r--fs/gfs2/rgrp.c14
5 files changed, 20 insertions, 16 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 611f84d22573..d00dc37e3d51 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
4 * 4 *
5 * This copyrighted material is made available to anyone wishing to use, 5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions 6 * modify, copy, or redistribute it subject to the terms and conditions
@@ -348,7 +348,6 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
348 gl->gl_ip = 0; 348 gl->gl_ip = 0;
349 gl->gl_ops = glops; 349 gl->gl_ops = glops;
350 gl->gl_req_gh = NULL; 350 gl->gl_req_gh = NULL;
351 gl->gl_vn = 0;
352 gl->gl_stamp = jiffies; 351 gl->gl_stamp = jiffies;
353 gl->gl_tchange = jiffies; 352 gl->gl_tchange = jiffies;
354 gl->gl_object = NULL; 353 gl->gl_object = NULL;
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index c663b7a0f410..d31badadef8f 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
4 * 4 *
5 * This copyrighted material is made available to anyone wishing to use, 5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions 6 * modify, copy, or redistribute it subject to the terms and conditions
@@ -126,7 +126,13 @@ static void meta_go_inval(struct gfs2_glock *gl, int flags)
126 return; 126 return;
127 127
128 gfs2_meta_inval(gl); 128 gfs2_meta_inval(gl);
129 gl->gl_vn++; 129 if (gl->gl_object == GFS2_I(gl->gl_sbd->sd_rindex))
130 gl->gl_sbd->sd_rindex_uptodate = 0;
131 else if (gl->gl_ops == &gfs2_rgrp_glops && gl->gl_object) {
132 struct gfs2_rgrpd *rgd = (struct gfs2_rgrpd *)gl->gl_object;
133
134 rgd->rd_flags &= ~GFS2_RDF_UPTODATE;
135 }
130} 136}
131 137
132/** 138/**
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 8dee4672c3d8..e9c58dc76869 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -85,7 +85,6 @@ struct gfs2_rgrpd {
85 u32 rd_data; /* num of data blocks in rgrp */ 85 u32 rd_data; /* num of data blocks in rgrp */
86 u32 rd_bitbytes; /* number of bytes in data bitmaps */ 86 u32 rd_bitbytes; /* number of bytes in data bitmaps */
87 struct gfs2_rgrp_host rd_rg; 87 struct gfs2_rgrp_host rd_rg;
88 u64 rd_rg_vn;
89 struct gfs2_bitmap *rd_bits; 88 struct gfs2_bitmap *rd_bits;
90 unsigned int rd_bh_count; 89 unsigned int rd_bh_count;
91 struct mutex rd_mutex; 90 struct mutex rd_mutex;
@@ -97,6 +96,7 @@ struct gfs2_rgrpd {
97 unsigned char rd_flags; 96 unsigned char rd_flags;
98#define GFS2_RDF_CHECK 0x01 /* Need to check for unlinked inodes */ 97#define GFS2_RDF_CHECK 0x01 /* Need to check for unlinked inodes */
99#define GFS2_RDF_NOALLOC 0x02 /* rg prohibits allocation */ 98#define GFS2_RDF_NOALLOC 0x02 /* rg prohibits allocation */
99#define GFS2_RDF_UPTODATE 0x04 /* rg is up to date */
100}; 100};
101 101
102enum gfs2_state_bits { 102enum gfs2_state_bits {
@@ -196,7 +196,6 @@ struct gfs2_glock {
196 char *gl_lvb; 196 char *gl_lvb;
197 atomic_t gl_lvb_count; 197 atomic_t gl_lvb_count;
198 198
199 u64 gl_vn;
200 unsigned long gl_stamp; 199 unsigned long gl_stamp;
201 unsigned long gl_tchange; 200 unsigned long gl_tchange;
202 void *gl_object; 201 void *gl_object;
@@ -533,7 +532,7 @@ struct gfs2_sbd {
533 532
534 /* Resource group stuff */ 533 /* Resource group stuff */
535 534
536 u64 sd_rindex_vn; 535 int sd_rindex_uptodate;
537 spinlock_t sd_rindex_spin; 536 spinlock_t sd_rindex_spin;
538 struct mutex sd_rindex_mutex; 537 struct mutex sd_rindex_mutex;
539 struct list_head sd_rindex_list; 538 struct list_head sd_rindex_list;
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 5b6a34517167..c4b7a210c0c0 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
4 * 4 *
5 * This copyrighted material is made available to anyone wishing to use, 5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions 6 * modify, copy, or redistribute it subject to the terms and conditions
@@ -548,7 +548,7 @@ static int init_inodes(struct gfs2_sbd *sdp, int undo)
548 } 548 }
549 ip = GFS2_I(sdp->sd_rindex); 549 ip = GFS2_I(sdp->sd_rindex);
550 set_bit(GLF_STICKY, &ip->i_gl->gl_flags); 550 set_bit(GLF_STICKY, &ip->i_gl->gl_flags);
551 sdp->sd_rindex_vn = ip->i_gl->gl_vn - 1; 551 sdp->sd_rindex_uptodate = 0;
552 552
553 /* Read in the quota inode */ 553 /* Read in the quota inode */
554 sdp->sd_quota_inode = gfs2_lookup_simple(sdp->sd_master_dir, "quota"); 554 sdp->sd_quota_inode = gfs2_lookup_simple(sdp->sd_master_dir, "quota");
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 5fd87104e595..3f10b1fafd66 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -540,7 +540,7 @@ static int read_rindex_entry(struct gfs2_inode *ip,
540 return error; 540 return error;
541 541
542 rgd->rd_gl->gl_object = rgd; 542 rgd->rd_gl->gl_object = rgd;
543 rgd->rd_rg_vn = rgd->rd_gl->gl_vn - 1; 543 rgd->rd_flags &= ~GFS2_RDF_UPTODATE;
544 rgd->rd_flags |= GFS2_RDF_CHECK; 544 rgd->rd_flags |= GFS2_RDF_CHECK;
545 return error; 545 return error;
546} 546}
@@ -576,7 +576,7 @@ static int gfs2_ri_update(struct gfs2_inode *ip)
576 } 576 }
577 } 577 }
578 578
579 sdp->sd_rindex_vn = ip->i_gl->gl_vn; 579 sdp->sd_rindex_uptodate = 1;
580 return 0; 580 return 0;
581} 581}
582 582
@@ -610,7 +610,7 @@ static int gfs2_ri_update_special(struct gfs2_inode *ip)
610 } 610 }
611 } 611 }
612 612
613 sdp->sd_rindex_vn = ip->i_gl->gl_vn; 613 sdp->sd_rindex_uptodate = 1;
614 return 0; 614 return 0;
615} 615}
616 616
@@ -643,9 +643,9 @@ int gfs2_rindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ri_gh)
643 return error; 643 return error;
644 644
645 /* Read new copy from disk if we don't have the latest */ 645 /* Read new copy from disk if we don't have the latest */
646 if (sdp->sd_rindex_vn != gl->gl_vn) { 646 if (!sdp->sd_rindex_uptodate) {
647 mutex_lock(&sdp->sd_rindex_mutex); 647 mutex_lock(&sdp->sd_rindex_mutex);
648 if (sdp->sd_rindex_vn != gl->gl_vn) { 648 if (!sdp->sd_rindex_uptodate) {
649 error = gfs2_ri_update(ip); 649 error = gfs2_ri_update(ip);
650 if (error) 650 if (error)
651 gfs2_glock_dq_uninit(ri_gh); 651 gfs2_glock_dq_uninit(ri_gh);
@@ -737,9 +737,9 @@ int gfs2_rgrp_bh_get(struct gfs2_rgrpd *rgd)
737 } 737 }
738 } 738 }
739 739
740 if (rgd->rd_rg_vn != gl->gl_vn) { 740 if (!(rgd->rd_flags & GFS2_RDF_UPTODATE)) {
741 gfs2_rgrp_in(rgd, (rgd->rd_bits[0].bi_bh)->b_data); 741 gfs2_rgrp_in(rgd, (rgd->rd_bits[0].bi_bh)->b_data);
742 rgd->rd_rg_vn = gl->gl_vn; 742 rgd->rd_flags |= GFS2_RDF_UPTODATE;
743 } 743 }
744 744
745 spin_lock(&sdp->sd_rindex_spin); 745 spin_lock(&sdp->sd_rindex_spin);