diff options
Diffstat (limited to 'fs/ext3/inode.c')
-rw-r--r-- | fs/ext3/inode.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index f9bcddbd2ef1..e1bb03171986 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -2580,6 +2580,25 @@ void ext3_set_inode_flags(struct inode *inode) | |||
2580 | inode->i_flags |= S_DIRSYNC; | 2580 | inode->i_flags |= S_DIRSYNC; |
2581 | } | 2581 | } |
2582 | 2582 | ||
2583 | /* Propagate flags from i_flags to EXT3_I(inode)->i_flags */ | ||
2584 | void ext3_get_inode_flags(struct ext3_inode_info *ei) | ||
2585 | { | ||
2586 | unsigned int flags = ei->vfs_inode.i_flags; | ||
2587 | |||
2588 | ei->i_flags &= ~(EXT3_SYNC_FL|EXT3_APPEND_FL| | ||
2589 | EXT3_IMMUTABLE_FL|EXT3_NOATIME_FL|EXT3_DIRSYNC_FL); | ||
2590 | if (flags & S_SYNC) | ||
2591 | ei->i_flags |= EXT3_SYNC_FL; | ||
2592 | if (flags & S_APPEND) | ||
2593 | ei->i_flags |= EXT3_APPEND_FL; | ||
2594 | if (flags & S_IMMUTABLE) | ||
2595 | ei->i_flags |= EXT3_IMMUTABLE_FL; | ||
2596 | if (flags & S_NOATIME) | ||
2597 | ei->i_flags |= EXT3_NOATIME_FL; | ||
2598 | if (flags & S_DIRSYNC) | ||
2599 | ei->i_flags |= EXT3_DIRSYNC_FL; | ||
2600 | } | ||
2601 | |||
2583 | void ext3_read_inode(struct inode * inode) | 2602 | void ext3_read_inode(struct inode * inode) |
2584 | { | 2603 | { |
2585 | struct ext3_iloc iloc; | 2604 | struct ext3_iloc iloc; |
@@ -2735,6 +2754,7 @@ static int ext3_do_update_inode(handle_t *handle, | |||
2735 | if (ei->i_state & EXT3_STATE_NEW) | 2754 | if (ei->i_state & EXT3_STATE_NEW) |
2736 | memset(raw_inode, 0, EXT3_SB(inode->i_sb)->s_inode_size); | 2755 | memset(raw_inode, 0, EXT3_SB(inode->i_sb)->s_inode_size); |
2737 | 2756 | ||
2757 | ext3_get_inode_flags(ei); | ||
2738 | raw_inode->i_mode = cpu_to_le16(inode->i_mode); | 2758 | raw_inode->i_mode = cpu_to_le16(inode->i_mode); |
2739 | if(!(test_opt(inode->i_sb, NO_UID32))) { | 2759 | if(!(test_opt(inode->i_sb, NO_UID32))) { |
2740 | raw_inode->i_uid_low = cpu_to_le16(low_16_bits(inode->i_uid)); | 2760 | raw_inode->i_uid_low = cpu_to_le16(low_16_bits(inode->i_uid)); |