aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-11-08 12:51:06 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-30 10:34:45 -0500
commit6b124d8dba1f46c5f2caf3b3159bbe627f75b9b6 (patch)
tree42f03f02a7fe7ccfc9c676ddcdbdcdcb28defef6 /fs/gfs2/inode.c
parent2ca99501fa5422e84f18333918a503433449e2b5 (diff)
[GFS2] Only set inode flags when required
We were setting the inode flags from GFS2's flags far too often, even when they couldn't possibly have changed. This patch reduces the amount of flag setting going on so that we do it only when the inode is read in or when the flags have changed. The create case is covered by the "when the inode is read in" case. This also fixes a bug where we didn't set S_SYNC correctly. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index faf9b9ed791d..56b39be76925 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -54,16 +54,6 @@ void gfs2_inode_attr_in(struct gfs2_inode *ip)
54 i_size_write(inode, di->di_size); 54 i_size_write(inode, di->di_size);
55 inode->i_blocks = di->di_blocks << 55 inode->i_blocks = di->di_blocks <<
56 (GFS2_SB(inode)->sd_sb.sb_bsize_shift - GFS2_BASIC_BLOCK_SHIFT); 56 (GFS2_SB(inode)->sd_sb.sb_bsize_shift - GFS2_BASIC_BLOCK_SHIFT);
57
58 if (di->di_flags & GFS2_DIF_IMMUTABLE)
59 inode->i_flags |= S_IMMUTABLE;
60 else
61 inode->i_flags &= ~S_IMMUTABLE;
62
63 if (di->di_flags & GFS2_DIF_APPENDONLY)
64 inode->i_flags |= S_APPEND;
65 else
66 inode->i_flags &= ~S_APPEND;
67} 57}
68 58
69static int iget_test(struct inode *inode, void *opaque) 59static int iget_test(struct inode *inode, void *opaque)
@@ -210,6 +200,7 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
210 di->di_generation = be64_to_cpu(str->di_generation); 200 di->di_generation = be64_to_cpu(str->di_generation);
211 201
212 di->di_flags = be32_to_cpu(str->di_flags); 202 di->di_flags = be32_to_cpu(str->di_flags);
203 gfs2_set_inode_flags(&ip->i_inode);
213 di->di_height = be16_to_cpu(str->di_height); 204 di->di_height = be16_to_cpu(str->di_height);
214 205
215 di->di_depth = be16_to_cpu(str->di_depth); 206 di->di_depth = be16_to_cpu(str->di_depth);