aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-11-01 16:05:38 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-30 10:34:30 -0500
commitbfded27ba010d1c3b0aa3843f97dc9b80de751be (patch)
tree55d0009b96ae00188fa4ab546cdcad5686a3fdde /fs
parenta9583c7983cbba9726bfe64ee46613d654fc9e26 (diff)
[GFS2] Shrink gfs2_inode (8) - i_vn
This shrinks the size of the gfs2_inode by 8 bytes by replacing the version counter with a one bit valid/invalid flag. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/glops.c5
-rw-r--r--fs/gfs2/incore.h2
-rw-r--r--fs/gfs2/inode.c4
-rw-r--r--fs/gfs2/ops_inode.c2
4 files changed, 7 insertions, 6 deletions
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index aad45b7a927d..9c2033714b08 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -305,8 +305,9 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
305 int data = (flags & DIO_DATA); 305 int data = (flags & DIO_DATA);
306 306
307 if (meta) { 307 if (meta) {
308 struct gfs2_inode *ip = gl->gl_object;
308 gfs2_meta_inval(gl); 309 gfs2_meta_inval(gl);
309 gl->gl_vn++; 310 set_bit(GIF_INVALID, &ip->i_flags);
310 } 311 }
311 if (data) 312 if (data)
312 gfs2_page_inval(gl); 313 gfs2_page_inval(gl);
@@ -351,7 +352,7 @@ static int inode_go_lock(struct gfs2_holder *gh)
351 if (!ip) 352 if (!ip)
352 return 0; 353 return 0;
353 354
354 if (ip->i_vn != gl->gl_vn) { 355 if (test_bit(GIF_INVALID, &ip->i_flags)) {
355 error = gfs2_inode_refresh(ip); 356 error = gfs2_inode_refresh(ip);
356 if (error) 357 if (error)
357 return error; 358 return error;
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index c0a8c3b6a852..227a74dc5ec0 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -217,6 +217,7 @@ struct gfs2_alloc {
217}; 217};
218 218
219enum { 219enum {
220 GIF_INVALID = 0,
220 GIF_QD_LOCKED = 1, 221 GIF_QD_LOCKED = 1,
221 GIF_PAGED = 2, 222 GIF_PAGED = 2,
222 GIF_SW_PAGED = 3, 223 GIF_SW_PAGED = 3,
@@ -228,7 +229,6 @@ struct gfs2_inode {
228 229
229 unsigned long i_flags; /* GIF_... */ 230 unsigned long i_flags; /* GIF_... */
230 231
231 u64 i_vn;
232 struct gfs2_dinode_host i_di; /* To be replaced by ref to block */ 232 struct gfs2_dinode_host i_di; /* To be replaced by ref to block */
233 233
234 struct gfs2_glock *i_gl; /* Move into i_gh? */ 234 struct gfs2_glock *i_gl; /* Move into i_gh? */
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index f6177fc68320..e467780837e6 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -145,7 +145,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, struct gfs2_inum_host *i
145 if (unlikely(error)) 145 if (unlikely(error))
146 goto fail_put; 146 goto fail_put;
147 147
148 ip->i_vn = ip->i_gl->gl_vn - 1; 148 set_bit(GIF_INVALID, &ip->i_flags);
149 error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh); 149 error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);
150 if (unlikely(error)) 150 if (unlikely(error))
151 goto fail_iopen; 151 goto fail_iopen;
@@ -242,7 +242,7 @@ int gfs2_inode_refresh(struct gfs2_inode *ip)
242 242
243 error = gfs2_dinode_in(ip, dibh->b_data); 243 error = gfs2_dinode_in(ip, dibh->b_data);
244 brelse(dibh); 244 brelse(dibh);
245 ip->i_vn = ip->i_gl->gl_vn; 245 clear_bit(GIF_INVALID, &ip->i_flags);
246 246
247 return error; 247 return error;
248} 248}
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 0e4eade47bf2..b247f25effbf 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -844,7 +844,7 @@ static int gfs2_permission(struct inode *inode, int mask, struct nameidata *nd)
844 struct gfs2_holder i_gh; 844 struct gfs2_holder i_gh;
845 int error; 845 int error;
846 846
847 if (ip->i_vn == ip->i_gl->gl_vn) 847 if (!test_bit(GIF_INVALID, &ip->i_flags))
848 return generic_permission(inode, mask, gfs2_check_acl); 848 return generic_permission(inode, mask, gfs2_check_acl);
849 849
850 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); 850 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);