]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
GFS2: Banish struct gfs2_rgrpd_host
authorSteven Whitehouse <swhiteho@redhat.com>
Tue, 4 Nov 2008 10:32:57 +0000 (10:32 +0000)
committerSteven Whitehouse <swhiteho@redhat.com>
Mon, 5 Jan 2009 07:39:03 +0000 (07:39 +0000)
This patch moves the final field so that we can get rid
of struct gfs2_rgrpd_host, as promised some time ago. Also
by rearranging the fields slightly, we are able to reduce
the size of the gfs2_rgrpd structure at the same time.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/incore.h
fs/gfs2/rgrp.c
fs/gfs2/super.c

index f8d9773625159efd114dec16a6bdf6d08317d980..9e3b613d0baccc6832ba1ad513a100e995e0d2e5 100644 (file)
@@ -68,10 +68,6 @@ struct gfs2_bitmap {
        u32 bi_len;
 };
 
-struct gfs2_rgrp_host {
-       u32 rg_dinodes;
-};
-
 struct gfs2_rgrpd {
        struct list_head rd_list;       /* Link with superblock */
        struct list_head rd_list_mru;
@@ -82,15 +78,15 @@ struct gfs2_rgrpd {
        u32 rd_data;                    /* num of data blocks in rgrp */
        u32 rd_bitbytes;                /* number of bytes in data bitmaps */
        u32 rd_free;
-       struct gfs2_rgrp_host rd_rg;
+       u32 rd_free_clone;
+       u32 rd_dinodes;
        u64 rd_igeneration;
        struct gfs2_bitmap *rd_bits;
-       unsigned int rd_bh_count;
        struct mutex rd_mutex;
-       u32 rd_free_clone;
        struct gfs2_log_element rd_le;
-       u32 rd_last_alloc;
        struct gfs2_sbd *rd_sbd;
+       unsigned int rd_bh_count;
+       u32 rd_last_alloc;
        unsigned char rd_flags;
 #define GFS2_RDF_CHECK        0x01      /* Need to check for unlinked inodes */
 #define GFS2_RDF_NOALLOC      0x02      /* rg prohibits allocation */
index bab9cfab34c7329235b65b671c9245e4ff315484..8b01c635d9250ece1efdc007776287886dd48a41 100644 (file)
@@ -276,9 +276,7 @@ void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd)
                return;
        }
 
-       tmp = rgd->rd_data -
-               rgd->rd_free -
-               rgd->rd_rg.rg_dinodes;
+       tmp = rgd->rd_data - rgd->rd_free - rgd->rd_dinodes;
        if (count[1] + count[2] != tmp) {
                if (gfs2_consist_rgrpd(rgd))
                        fs_err(sdp, "used data mismatch:  %u != %u\n",
@@ -286,10 +284,10 @@ void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd)
                return;
        }
 
-       if (count[3] != rgd->rd_rg.rg_dinodes) {
+       if (count[3] != rgd->rd_dinodes) {
                if (gfs2_consist_rgrpd(rgd))
                        fs_err(sdp, "used metadata mismatch:  %u != %u\n",
-                              count[3], rgd->rd_rg.rg_dinodes);
+                              count[3], rgd->rd_dinodes);
                return;
        }
 
@@ -692,7 +690,6 @@ int gfs2_rindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ri_gh)
 static void gfs2_rgrp_in(struct gfs2_rgrpd *rgd, const void *buf)
 {
        const struct gfs2_rgrp *str = buf;
-       struct gfs2_rgrp_host *rg = &rgd->rd_rg;
        u32 rg_flags;
 
        rg_flags = be32_to_cpu(str->rg_flags);
@@ -701,21 +698,20 @@ static void gfs2_rgrp_in(struct gfs2_rgrpd *rgd, const void *buf)
        else
                rgd->rd_flags &= ~GFS2_RDF_NOALLOC;
        rgd->rd_free = be32_to_cpu(str->rg_free);
-       rg->rg_dinodes = be32_to_cpu(str->rg_dinodes);
+       rgd->rd_dinodes = be32_to_cpu(str->rg_dinodes);
        rgd->rd_igeneration = be64_to_cpu(str->rg_igeneration);
 }
 
 static void gfs2_rgrp_out(struct gfs2_rgrpd *rgd, void *buf)
 {
        struct gfs2_rgrp *str = buf;
-       struct gfs2_rgrp_host *rg = &rgd->rd_rg;
        u32 rg_flags = 0;
 
        if (rgd->rd_flags & GFS2_RDF_NOALLOC)
                rg_flags |= GFS2_RGF_NOALLOC;
        str->rg_flags = cpu_to_be32(rg_flags);
        str->rg_free = cpu_to_be32(rgd->rd_free);
-       str->rg_dinodes = cpu_to_be32(rg->rg_dinodes);
+       str->rg_dinodes = cpu_to_be32(rgd->rd_dinodes);
        str->__pad = cpu_to_be32(0);
        str->rg_igeneration = cpu_to_be64(rgd->rd_igeneration);
        memset(&str->rg_reserved, 0, sizeof(str->rg_reserved));
@@ -1447,7 +1443,7 @@ u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation)
 
        gfs2_assert_withdraw(sdp, rgd->rd_free);
        rgd->rd_free--;
-       rgd->rd_rg.rg_dinodes++;
+       rgd->rd_dinodes++;
        *generation = rgd->rd_igeneration++;
        gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
        gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data);
@@ -1546,9 +1542,9 @@ static void gfs2_free_uninit_di(struct gfs2_rgrpd *rgd, u64 blkno)
                return;
        gfs2_assert_withdraw(sdp, rgd == tmp_rgd);
 
-       if (!rgd->rd_rg.rg_dinodes)
+       if (!rgd->rd_dinodes)
                gfs2_consist_rgrpd(rgd);
-       rgd->rd_rg.rg_dinodes--;
+       rgd->rd_dinodes--;
        rgd->rd_free++;
 
        gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
index e76907691ad914a6059a6412cec5036bce39a9c8..b85877062a48b87867624a10bb99c7e4f503487b 100644 (file)
@@ -469,7 +469,7 @@ static int statfs_slow_fill(struct gfs2_rgrpd *rgd,
        gfs2_rgrp_verify(rgd);
        sc->sc_total += rgd->rd_data;
        sc->sc_free += rgd->rd_free;
-       sc->sc_dinodes += rgd->rd_rg.rg_dinodes;
+       sc->sc_dinodes += rgd->rd_dinodes;
        return 0;
 }