aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext2/inode.c')
-rw-r--r--fs/ext2/inode.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 9fa1bd65a028..0079b2cd5314 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -1055,6 +1055,25 @@ void ext2_set_inode_flags(struct inode *inode)
1055 inode->i_flags |= S_DIRSYNC; 1055 inode->i_flags |= S_DIRSYNC;
1056} 1056}
1057 1057
1058/* Propagate flags from i_flags to EXT2_I(inode)->i_flags */
1059void ext2_get_inode_flags(struct ext2_inode_info *ei)
1060{
1061 unsigned int flags = ei->vfs_inode.i_flags;
1062
1063 ei->i_flags &= ~(EXT2_SYNC_FL|EXT2_APPEND_FL|
1064 EXT2_IMMUTABLE_FL|EXT2_NOATIME_FL|EXT2_DIRSYNC_FL);
1065 if (flags & S_SYNC)
1066 ei->i_flags |= EXT2_SYNC_FL;
1067 if (flags & S_APPEND)
1068 ei->i_flags |= EXT2_APPEND_FL;
1069 if (flags & S_IMMUTABLE)
1070 ei->i_flags |= EXT2_IMMUTABLE_FL;
1071 if (flags & S_NOATIME)
1072 ei->i_flags |= EXT2_NOATIME_FL;
1073 if (flags & S_DIRSYNC)
1074 ei->i_flags |= EXT2_DIRSYNC_FL;
1075}
1076
1058void ext2_read_inode (struct inode * inode) 1077void ext2_read_inode (struct inode * inode)
1059{ 1078{
1060 struct ext2_inode_info *ei = EXT2_I(inode); 1079 struct ext2_inode_info *ei = EXT2_I(inode);
@@ -1188,6 +1207,7 @@ static int ext2_update_inode(struct inode * inode, int do_sync)
1188 if (ei->i_state & EXT2_STATE_NEW) 1207 if (ei->i_state & EXT2_STATE_NEW)
1189 memset(raw_inode, 0, EXT2_SB(sb)->s_inode_size); 1208 memset(raw_inode, 0, EXT2_SB(sb)->s_inode_size);
1190 1209
1210 ext2_get_inode_flags(ei);
1191 raw_inode->i_mode = cpu_to_le16(inode->i_mode); 1211 raw_inode->i_mode = cpu_to_le16(inode->i_mode);
1192 if (!(test_opt(sb, NO_UID32))) { 1212 if (!(test_opt(sb, NO_UID32))) {
1193 raw_inode->i_uid_low = cpu_to_le16(low_16_bits(uid)); 1213 raw_inode->i_uid_low = cpu_to_le16(low_16_bits(uid));