aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-11-04 05:25:13 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2009-01-05 02:39:02 -0500
commitcfc8b54922db7b647b6d88914dc7ef8c63b6671d (patch)
tree27ceb908468bee50f94de44ce380fadf9e0b547a
parentd8b71f7381769177998acb2f59ddc73465a60fe0 (diff)
GFS2: Move rg_free from gfs2_rgrpd_host to gfs2_rgrpd
The second of three fields which need to move, in order to remove the struct gfs2_rgrpd_host. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
-rw-r--r--fs/gfs2/incore.h2
-rw-r--r--fs/gfs2/rgrp.c28
-rw-r--r--fs/gfs2/super.c2
3 files changed, 16 insertions, 16 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 869ac83297e6..f8d977362515 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -69,7 +69,6 @@ struct gfs2_bitmap {
69}; 69};
70 70
71struct gfs2_rgrp_host { 71struct gfs2_rgrp_host {
72 u32 rg_free;
73 u32 rg_dinodes; 72 u32 rg_dinodes;
74}; 73};
75 74
@@ -82,6 +81,7 @@ struct gfs2_rgrpd {
82 u32 rd_length; /* length of rgrp header in fs blocks */ 81 u32 rd_length; /* length of rgrp header in fs blocks */
83 u32 rd_data; /* num of data blocks in rgrp */ 82 u32 rd_data; /* num of data blocks in rgrp */
84 u32 rd_bitbytes; /* number of bytes in data bitmaps */ 83 u32 rd_bitbytes; /* number of bytes in data bitmaps */
84 u32 rd_free;
85 struct gfs2_rgrp_host rd_rg; 85 struct gfs2_rgrp_host rd_rg;
86 u64 rd_igeneration; 86 u64 rd_igeneration;
87 struct gfs2_bitmap *rd_bits; 87 struct gfs2_bitmap *rd_bits;
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 8e93d62991cc..bab9cfab34c7 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -269,15 +269,15 @@ void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd)
269 bi->bi_len, x); 269 bi->bi_len, x);
270 } 270 }
271 271
272 if (count[0] != rgd->rd_rg.rg_free) { 272 if (count[0] != rgd->rd_free) {
273 if (gfs2_consist_rgrpd(rgd)) 273 if (gfs2_consist_rgrpd(rgd))
274 fs_err(sdp, "free data mismatch: %u != %u\n", 274 fs_err(sdp, "free data mismatch: %u != %u\n",
275 count[0], rgd->rd_rg.rg_free); 275 count[0], rgd->rd_free);
276 return; 276 return;
277 } 277 }
278 278
279 tmp = rgd->rd_data - 279 tmp = rgd->rd_data -
280 rgd->rd_rg.rg_free - 280 rgd->rd_free -
281 rgd->rd_rg.rg_dinodes; 281 rgd->rd_rg.rg_dinodes;
282 if (count[1] + count[2] != tmp) { 282 if (count[1] + count[2] != tmp) {
283 if (gfs2_consist_rgrpd(rgd)) 283 if (gfs2_consist_rgrpd(rgd))
@@ -700,7 +700,7 @@ static void gfs2_rgrp_in(struct gfs2_rgrpd *rgd, const void *buf)
700 rgd->rd_flags |= GFS2_RDF_NOALLOC; 700 rgd->rd_flags |= GFS2_RDF_NOALLOC;
701 else 701 else
702 rgd->rd_flags &= ~GFS2_RDF_NOALLOC; 702 rgd->rd_flags &= ~GFS2_RDF_NOALLOC;
703 rg->rg_free = be32_to_cpu(str->rg_free); 703 rgd->rd_free = be32_to_cpu(str->rg_free);
704 rg->rg_dinodes = be32_to_cpu(str->rg_dinodes); 704 rg->rg_dinodes = be32_to_cpu(str->rg_dinodes);
705 rgd->rd_igeneration = be64_to_cpu(str->rg_igeneration); 705 rgd->rd_igeneration = be64_to_cpu(str->rg_igeneration);
706} 706}
@@ -714,7 +714,7 @@ static void gfs2_rgrp_out(struct gfs2_rgrpd *rgd, void *buf)
714 if (rgd->rd_flags & GFS2_RDF_NOALLOC) 714 if (rgd->rd_flags & GFS2_RDF_NOALLOC)
715 rg_flags |= GFS2_RGF_NOALLOC; 715 rg_flags |= GFS2_RGF_NOALLOC;
716 str->rg_flags = cpu_to_be32(rg_flags); 716 str->rg_flags = cpu_to_be32(rg_flags);
717 str->rg_free = cpu_to_be32(rg->rg_free); 717 str->rg_free = cpu_to_be32(rgd->rd_free);
718 str->rg_dinodes = cpu_to_be32(rg->rg_dinodes); 718 str->rg_dinodes = cpu_to_be32(rg->rg_dinodes);
719 str->__pad = cpu_to_be32(0); 719 str->__pad = cpu_to_be32(0);
720 str->rg_igeneration = cpu_to_be64(rgd->rd_igeneration); 720 str->rg_igeneration = cpu_to_be64(rgd->rd_igeneration);
@@ -776,7 +776,7 @@ int gfs2_rgrp_bh_get(struct gfs2_rgrpd *rgd)
776 } 776 }
777 777
778 spin_lock(&sdp->sd_rindex_spin); 778 spin_lock(&sdp->sd_rindex_spin);
779 rgd->rd_free_clone = rgd->rd_rg.rg_free; 779 rgd->rd_free_clone = rgd->rd_free;
780 rgd->rd_bh_count++; 780 rgd->rd_bh_count++;
781 spin_unlock(&sdp->sd_rindex_spin); 781 spin_unlock(&sdp->sd_rindex_spin);
782 782
@@ -850,7 +850,7 @@ void gfs2_rgrp_repolish_clones(struct gfs2_rgrpd *rgd)
850 } 850 }
851 851
852 spin_lock(&sdp->sd_rindex_spin); 852 spin_lock(&sdp->sd_rindex_spin);
853 rgd->rd_free_clone = rgd->rd_rg.rg_free; 853 rgd->rd_free_clone = rgd->rd_free;
854 spin_unlock(&sdp->sd_rindex_spin); 854 spin_unlock(&sdp->sd_rindex_spin);
855} 855}
856 856
@@ -1403,8 +1403,8 @@ u64 gfs2_alloc_block(struct gfs2_inode *ip, unsigned int *n)
1403 block = rgd->rd_data0 + blk; 1403 block = rgd->rd_data0 + blk;
1404 ip->i_goal = block; 1404 ip->i_goal = block;
1405 1405
1406 gfs2_assert_withdraw(sdp, rgd->rd_rg.rg_free >= *n); 1406 gfs2_assert_withdraw(sdp, rgd->rd_free >= *n);
1407 rgd->rd_rg.rg_free -= *n; 1407 rgd->rd_free -= *n;
1408 1408
1409 gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1); 1409 gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
1410 gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data); 1410 gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data);
@@ -1445,8 +1445,8 @@ u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation)
1445 1445
1446 block = rgd->rd_data0 + blk; 1446 block = rgd->rd_data0 + blk;
1447 1447
1448 gfs2_assert_withdraw(sdp, rgd->rd_rg.rg_free); 1448 gfs2_assert_withdraw(sdp, rgd->rd_free);
1449 rgd->rd_rg.rg_free--; 1449 rgd->rd_free--;
1450 rgd->rd_rg.rg_dinodes++; 1450 rgd->rd_rg.rg_dinodes++;
1451 *generation = rgd->rd_igeneration++; 1451 *generation = rgd->rd_igeneration++;
1452 gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1); 1452 gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
@@ -1481,7 +1481,7 @@ void gfs2_free_data(struct gfs2_inode *ip, u64 bstart, u32 blen)
1481 if (!rgd) 1481 if (!rgd)
1482 return; 1482 return;
1483 1483
1484 rgd->rd_rg.rg_free += blen; 1484 rgd->rd_free += blen;
1485 1485
1486 gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1); 1486 gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
1487 gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data); 1487 gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data);
@@ -1509,7 +1509,7 @@ void gfs2_free_meta(struct gfs2_inode *ip, u64 bstart, u32 blen)
1509 if (!rgd) 1509 if (!rgd)
1510 return; 1510 return;
1511 1511
1512 rgd->rd_rg.rg_free += blen; 1512 rgd->rd_free += blen;
1513 1513
1514 gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1); 1514 gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
1515 gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data); 1515 gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data);
@@ -1549,7 +1549,7 @@ static void gfs2_free_uninit_di(struct gfs2_rgrpd *rgd, u64 blkno)
1549 if (!rgd->rd_rg.rg_dinodes) 1549 if (!rgd->rd_rg.rg_dinodes)
1550 gfs2_consist_rgrpd(rgd); 1550 gfs2_consist_rgrpd(rgd);
1551 rgd->rd_rg.rg_dinodes--; 1551 rgd->rd_rg.rg_dinodes--;
1552 rgd->rd_rg.rg_free++; 1552 rgd->rd_free++;
1553 1553
1554 gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1); 1554 gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
1555 gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data); 1555 gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data);
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index f5cef2ad7ae1..e76907691ad9 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -468,7 +468,7 @@ static int statfs_slow_fill(struct gfs2_rgrpd *rgd,
468{ 468{
469 gfs2_rgrp_verify(rgd); 469 gfs2_rgrp_verify(rgd);
470 sc->sc_total += rgd->rd_data; 470 sc->sc_total += rgd->rd_data;
471 sc->sc_free += rgd->rd_rg.rg_free; 471 sc->sc_free += rgd->rd_free;
472 sc->sc_dinodes += rgd->rd_rg.rg_dinodes; 472 sc->sc_dinodes += rgd->rd_rg.rg_dinodes;
473 return 0; 473 return 0;
474} 474}