]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[GFS2] Shrink gfs2_inode (7) - di_payload_format
authorSteven Whitehouse <swhiteho@redhat.com>
Thu, 2 Nov 2006 01:09:14 +0000 (20:09 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Thu, 30 Nov 2006 15:34:26 +0000 (10:34 -0500)
This is almost never used. Its there for backward
compatibility with GFS1. It doesn't need its own
field since it can always be calculated from the
inode mode & flags. This saves a bit more space
in the gfs2_inode.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/dir.c
fs/gfs2/inode.c
fs/gfs2/ondisk.c
fs/gfs2/ops_inode.c
include/linux/gfs2_ondisk.h

index ca23c8beb3f0c1831144de9e4fb73bcd26988c77..c82d7cb4a6547eebdf4f115093dba98ed377f4e1 100644 (file)
@@ -902,7 +902,6 @@ static int dir_make_exhash(struct inode *inode)
        dip->i_di.di_size = sdp->sd_sb.sb_bsize / 2;
        dip->i_di.di_blocks++;
        dip->i_di.di_flags |= GFS2_DIF_EXHASH;
-       dip->i_di.di_payload_format = 0;
 
        for (x = sdp->sd_hash_ptrs, y = -1; x; x >>= 1, y++) ;
        dip->i_di.di_depth = y;
index c22ae3c3a4448c2d75f02b19094c7c1f7c1c130a..f6177fc683200d6faa959ba7789ab266591d683e 100644 (file)
@@ -210,7 +210,6 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
        di->di_generation = be64_to_cpu(str->di_generation);
 
        di->di_flags = be32_to_cpu(str->di_flags);
-       di->di_payload_format = be32_to_cpu(str->di_payload_format);
        di->di_height = be16_to_cpu(str->di_height);
 
        di->di_depth = be16_to_cpu(str->di_depth);
@@ -699,7 +698,7 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
        }
 
        di->__pad1 = 0;
-       di->di_payload_format = cpu_to_be32(0);
+       di->di_payload_format = cpu_to_be32(S_ISDIR(mode) ? GFS2_FORMAT_DE : 0);
        di->di_height = cpu_to_be32(0);
        di->__pad2 = 0;
        di->__pad3 = 0;
index 82003e872a3708ca43c223bd655ae3fac5e87e3c..b2baba5c50b7ccf9c9735933da4c621e027327de 100644 (file)
@@ -176,9 +176,10 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)
        str->di_generation = cpu_to_be64(di->di_generation);
 
        str->di_flags = cpu_to_be32(di->di_flags);
-       str->di_payload_format = cpu_to_be32(di->di_payload_format);
        str->di_height = cpu_to_be16(di->di_height);
-
+       str->di_payload_format = cpu_to_be32(S_ISDIR(ip->i_inode.i_mode) &&
+                                            !(ip->i_di.di_flags & GFS2_DIF_EXHASH) ?
+                                            GFS2_FORMAT_DE : 0);
        str->di_depth = cpu_to_be16(di->di_depth);
        str->di_entries = cpu_to_be32(di->di_entries);
 
@@ -197,7 +198,6 @@ void gfs2_dinode_print(const struct gfs2_inode *ip)
        printk(KERN_INFO "  di_goal_data = %llu\n", (unsigned long long)di->di_goal_data);
 
        pv(di, di_flags, "0x%.8X");
-       pv(di, di_payload_format, "%u");
        pv(di, di_height, "%u");
 
        pv(di, di_depth, "%u");
index 585b43a94ace25eb3f2426288b88df3da5cf4f2d..0e4eade47bf2be7c6e7d0c1321872db3632a8bc5 100644 (file)
@@ -389,7 +389,6 @@ static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        ip->i_inode.i_nlink = 2;
        ip->i_di.di_size = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode);
        ip->i_di.di_flags |= GFS2_DIF_JDATA;
-       ip->i_di.di_payload_format = GFS2_FORMAT_DE;
        ip->i_di.di_entries = 2;
 
        error = gfs2_meta_inode_buffer(ip, &dibh);
index 7f5a4a16224bd7de697cfeadd4e54daf1099c473..536575efb62a56ea79c29dfb44706b6fc48aa062 100644 (file)
@@ -333,7 +333,6 @@ struct gfs2_dinode_host {
        __u64 di_generation;    /* generation number for NFS */
 
        __u32 di_flags; /* GFS2_DIF_... */
-       __u32 di_payload_format;  /* GFS2_FORMAT_... */
        __u16 di_height;        /* height of metadata */
 
        /* These only apply to directories  */