aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 8416fa28c422..49035c5a2c43 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2583,6 +2583,25 @@ void ext4_set_inode_flags(struct inode *inode)
2583 inode->i_flags |= S_DIRSYNC; 2583 inode->i_flags |= S_DIRSYNC;
2584} 2584}
2585 2585
2586/* Propagate flags from i_flags to EXT4_I(inode)->i_flags */
2587void ext4_get_inode_flags(struct ext4_inode_info *ei)
2588{
2589 unsigned int flags = ei->vfs_inode.i_flags;
2590
2591 ei->i_flags &= ~(EXT4_SYNC_FL|EXT4_APPEND_FL|
2592 EXT4_IMMUTABLE_FL|EXT4_NOATIME_FL|EXT4_DIRSYNC_FL);
2593 if (flags & S_SYNC)
2594 ei->i_flags |= EXT4_SYNC_FL;
2595 if (flags & S_APPEND)
2596 ei->i_flags |= EXT4_APPEND_FL;
2597 if (flags & S_IMMUTABLE)
2598 ei->i_flags |= EXT4_IMMUTABLE_FL;
2599 if (flags & S_NOATIME)
2600 ei->i_flags |= EXT4_NOATIME_FL;
2601 if (flags & S_DIRSYNC)
2602 ei->i_flags |= EXT4_DIRSYNC_FL;
2603}
2604
2586void ext4_read_inode(struct inode * inode) 2605void ext4_read_inode(struct inode * inode)
2587{ 2606{
2588 struct ext4_iloc iloc; 2607 struct ext4_iloc iloc;
@@ -2744,6 +2763,7 @@ static int ext4_do_update_inode(handle_t *handle,
2744 if (ei->i_state & EXT4_STATE_NEW) 2763 if (ei->i_state & EXT4_STATE_NEW)
2745 memset(raw_inode, 0, EXT4_SB(inode->i_sb)->s_inode_size); 2764 memset(raw_inode, 0, EXT4_SB(inode->i_sb)->s_inode_size);
2746 2765
2766 ext4_get_inode_flags(ei);
2747 raw_inode->i_mode = cpu_to_le16(inode->i_mode); 2767 raw_inode->i_mode = cpu_to_le16(inode->i_mode);
2748 if(!(test_opt(inode->i_sb, NO_UID32))) { 2768 if(!(test_opt(inode->i_sb, NO_UID32))) {
2749 raw_inode->i_uid_low = cpu_to_le16(low_16_bits(inode->i_uid)); 2769 raw_inode->i_uid_low = cpu_to_le16(low_16_bits(inode->i_uid));