aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ondisk.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-11-01 10:34:15 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-30 10:34:07 -0500
commitaf339c0241d0dd3b35f9097b4f4999bb22ffe502 (patch)
treec4c3e66de3c63b7a8205717bdf833dd567f6b746 /fs/gfs2/ondisk.c
parent4cc14f0b88bf3e0b508143e091eb5a8dff3e3b9c (diff)
[GFS2] Shrink gfs2_inode (1) - di_header/di_num
The metadata header doesn't need to be stored in the incore struct gfs2_inode since its constant, and this patch removes it. Also, there is already a field for the inode's number in the struct gfs2_inode, so we don't need one in struct gfs2_dinode_host as well. This saves 28 bytes of space in the struct gfs2_inode. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ondisk.c')
-rw-r--r--fs/gfs2/ondisk.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/fs/gfs2/ondisk.c b/fs/gfs2/ondisk.c
index 77bed440833d..4bc590edb60e 100644
--- a/fs/gfs2/ondisk.c
+++ b/fs/gfs2/ondisk.c
@@ -56,7 +56,7 @@ static void gfs2_inum_print(const struct gfs2_inum_host *no)
56 printk(KERN_INFO " no_addr = %llu\n", (unsigned long long)no->no_addr); 56 printk(KERN_INFO " no_addr = %llu\n", (unsigned long long)no->no_addr);
57} 57}
58 58
59void gfs2_meta_header_in(struct gfs2_meta_header_host *mh, const void *buf) 59static void gfs2_meta_header_in(struct gfs2_meta_header_host *mh, const void *buf)
60{ 60{
61 const struct gfs2_meta_header *str = buf; 61 const struct gfs2_meta_header *str = buf;
62 62
@@ -74,13 +74,6 @@ static void gfs2_meta_header_out(const struct gfs2_meta_header_host *mh, void *b
74 str->mh_format = cpu_to_be32(mh->mh_format); 74 str->mh_format = cpu_to_be32(mh->mh_format);
75} 75}
76 76
77static void gfs2_meta_header_print(const struct gfs2_meta_header_host *mh)
78{
79 pv(mh, mh_magic, "0x%.8X");
80 pv(mh, mh_type, "%u");
81 pv(mh, mh_format, "%u");
82}
83
84void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf) 77void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf)
85{ 78{
86 const struct gfs2_sb *str = buf; 79 const struct gfs2_sb *str = buf;
@@ -160,8 +153,13 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)
160 const struct gfs2_dinode_host *di = &ip->i_di; 153 const struct gfs2_dinode_host *di = &ip->i_di;
161 struct gfs2_dinode *str = buf; 154 struct gfs2_dinode *str = buf;
162 155
163 gfs2_meta_header_out(&di->di_header, buf); 156 str->di_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
164 gfs2_inum_out(&di->di_num, (char *)&str->di_num); 157 str->di_header.mh_type = cpu_to_be32(GFS2_METATYPE_DI);
158 str->di_header.__pad0 = 0;
159 str->di_header.mh_format = cpu_to_be32(GFS2_FORMAT_DI);
160 str->di_header.__pad1 = 0;
161
162 gfs2_inum_out(&ip->i_num, &str->di_num);
165 163
166 str->di_mode = cpu_to_be32(di->di_mode); 164 str->di_mode = cpu_to_be32(di->di_mode);
167 str->di_uid = cpu_to_be32(di->di_uid); 165 str->di_uid = cpu_to_be32(di->di_uid);
@@ -187,15 +185,13 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)
187 str->di_entries = cpu_to_be32(di->di_entries); 185 str->di_entries = cpu_to_be32(di->di_entries);
188 186
189 str->di_eattr = cpu_to_be64(di->di_eattr); 187 str->di_eattr = cpu_to_be64(di->di_eattr);
190
191} 188}
192 189
193void gfs2_dinode_print(const struct gfs2_inode *ip) 190void gfs2_dinode_print(const struct gfs2_inode *ip)
194{ 191{
195 const struct gfs2_dinode_host *di = &ip->i_di; 192 const struct gfs2_dinode_host *di = &ip->i_di;
196 193
197 gfs2_meta_header_print(&di->di_header); 194 gfs2_inum_print(&ip->i_num);
198 gfs2_inum_print(&di->di_num);
199 195
200 pv(di, di_mode, "0%o"); 196 pv(di, di_mode, "0%o");
201 pv(di, di_uid, "%u"); 197 pv(di, di_uid, "%u");