]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[GFS2] Remove rgrp and glock version numbers
authorBob Peterson <rpeterso@redhat.com>
Thu, 31 Jan 2008 16:31:39 +0000 (10:31 -0600)
committerSteven Whitehouse <swhiteho@redhat.com>
Mon, 31 Mar 2008 09:40:29 +0000 (10:40 +0100)
This patch further reduces GFS2's memory requirements by
eliminating the 64-bit version number fields in lieu of
a couple bits.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/glock.c
fs/gfs2/glops.c
fs/gfs2/incore.h
fs/gfs2/ops_fstype.c
fs/gfs2/rgrp.c

index 611f84d225738f763e53f4c6c68480869c0be30b..d00dc37e3d51bda4e1410fffe50aad2af92f5ca5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
- * Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
+ * Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
  *
  * This copyrighted material is made available to anyone wishing to use,
  * 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,
        gl->gl_ip = 0;
        gl->gl_ops = glops;
        gl->gl_req_gh = NULL;
-       gl->gl_vn = 0;
        gl->gl_stamp = jiffies;
        gl->gl_tchange = jiffies;
        gl->gl_object = NULL;
index c663b7a0f410a3c9c2a6c2136a722be8cf429b09..d31badadef8f929bd5e5bec992cf7c717b674ddb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
- * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
+ * Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
  *
  * This copyrighted material is made available to anyone wishing to use,
  * 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)
                return;
 
        gfs2_meta_inval(gl);
-       gl->gl_vn++;
+       if (gl->gl_object == GFS2_I(gl->gl_sbd->sd_rindex))
+               gl->gl_sbd->sd_rindex_uptodate = 0;
+       else if (gl->gl_ops == &gfs2_rgrp_glops && gl->gl_object) {
+               struct gfs2_rgrpd *rgd = (struct gfs2_rgrpd *)gl->gl_object;
+
+               rgd->rd_flags &= ~GFS2_RDF_UPTODATE;
+       }
 }
 
 /**
index 8dee4672c3d8af34cd0c2ecce1c8f34ce8becb0e..e9c58dc7686903a35ec13740d5b304a4c1eb6643 100644 (file)
@@ -85,7 +85,6 @@ struct gfs2_rgrpd {
        u32 rd_data;                    /* num of data blocks in rgrp */
        u32 rd_bitbytes;                /* number of bytes in data bitmaps */
        struct gfs2_rgrp_host rd_rg;
-       u64 rd_rg_vn;
        struct gfs2_bitmap *rd_bits;
        unsigned int rd_bh_count;
        struct mutex rd_mutex;
@@ -97,6 +96,7 @@ struct gfs2_rgrpd {
        unsigned char rd_flags;
 #define GFS2_RDF_CHECK        0x01      /* Need to check for unlinked inodes */
 #define GFS2_RDF_NOALLOC      0x02      /* rg prohibits allocation */
+#define GFS2_RDF_UPTODATE     0x04      /* rg is up to date */
 };
 
 enum gfs2_state_bits {
@@ -196,7 +196,6 @@ struct gfs2_glock {
        char *gl_lvb;
        atomic_t gl_lvb_count;
 
-       u64 gl_vn;
        unsigned long gl_stamp;
        unsigned long gl_tchange;
        void *gl_object;
@@ -533,7 +532,7 @@ struct gfs2_sbd {
 
        /* Resource group stuff */
 
-       u64 sd_rindex_vn;
+       int sd_rindex_uptodate;
        spinlock_t sd_rindex_spin;
        struct mutex sd_rindex_mutex;
        struct list_head sd_rindex_list;
index 5b6a34517167f03c5c22df8edde19160456cd121..c4b7a210c0c012e9f6cb55e5c8b8b8d6088b93f3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
- * Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
+ * Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
  *
  * This copyrighted material is made available to anyone wishing to use,
  * 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)
        }
        ip = GFS2_I(sdp->sd_rindex);
        set_bit(GLF_STICKY, &ip->i_gl->gl_flags);
-       sdp->sd_rindex_vn = ip->i_gl->gl_vn - 1;
+       sdp->sd_rindex_uptodate = 0;
 
        /* Read in the quota inode */
        sdp->sd_quota_inode = gfs2_lookup_simple(sdp->sd_master_dir, "quota");
index 5fd87104e5959c28034bf8cccdb7210669a0a7d4..3f10b1fafd663a6186b1102ce9f36b4db5e05ea8 100644 (file)
@@ -540,7 +540,7 @@ static int read_rindex_entry(struct gfs2_inode *ip,
                return error;
 
        rgd->rd_gl->gl_object = rgd;
-       rgd->rd_rg_vn = rgd->rd_gl->gl_vn - 1;
+       rgd->rd_flags &= ~GFS2_RDF_UPTODATE;
        rgd->rd_flags |= GFS2_RDF_CHECK;
        return error;
 }
@@ -576,7 +576,7 @@ static int gfs2_ri_update(struct gfs2_inode *ip)
                }
        }
 
-       sdp->sd_rindex_vn = ip->i_gl->gl_vn;
+       sdp->sd_rindex_uptodate = 1;
        return 0;
 }
 
@@ -610,7 +610,7 @@ static int gfs2_ri_update_special(struct gfs2_inode *ip)
                }
        }
 
-       sdp->sd_rindex_vn = ip->i_gl->gl_vn;
+       sdp->sd_rindex_uptodate = 1;
        return 0;
 }
 
@@ -643,9 +643,9 @@ int gfs2_rindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ri_gh)
                return error;
 
        /* Read new copy from disk if we don't have the latest */
-       if (sdp->sd_rindex_vn != gl->gl_vn) {
+       if (!sdp->sd_rindex_uptodate) {
                mutex_lock(&sdp->sd_rindex_mutex);
-               if (sdp->sd_rindex_vn != gl->gl_vn) {
+               if (!sdp->sd_rindex_uptodate) {
                        error = gfs2_ri_update(ip);
                        if (error)
                                gfs2_glock_dq_uninit(ri_gh);
@@ -737,9 +737,9 @@ int gfs2_rgrp_bh_get(struct gfs2_rgrpd *rgd)
                }
        }
 
-       if (rgd->rd_rg_vn != gl->gl_vn) {
+       if (!(rgd->rd_flags & GFS2_RDF_UPTODATE)) {
                gfs2_rgrp_in(rgd, (rgd->rd_bits[0].bi_bh)->b_data);
-               rgd->rd_rg_vn = gl->gl_vn;
+               rgd->rd_flags |= GFS2_RDF_UPTODATE;
        }
 
        spin_lock(&sdp->sd_rindex_spin);