Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200191
b: refs/heads/master
c: 84a8dce
h: refs/heads/master
i:
  200189: 535dd99
  200187: 21ab1f3
  200183: e883d81
  200175: 48cc87b
  200159: c225ba0
  200127: 2aa255b
  200063: 302ff22
  199935: 69a1d15
  199679: 813dfd2
v: v3
  • Loading branch information
Dmitry Monakhov authored and Theodore Ts'o committed Jun 5, 2010
1 parent 049b891 commit 7bbce07
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1f5a81e41f8b1a782c68d3843e9ec1bfaadf7d72
refs/heads/master: 84a8dce2710cc425089a2b92acc354d4fbb5788d
40 changes: 23 additions & 17 deletions trunk/fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4942,20 +4942,26 @@ void ext4_set_inode_flags(struct inode *inode)
/* Propagate flags from i_flags to EXT4_I(inode)->i_flags */
void ext4_get_inode_flags(struct ext4_inode_info *ei)
{
unsigned int flags = ei->vfs_inode.i_flags;

ei->i_flags &= ~(EXT4_SYNC_FL|EXT4_APPEND_FL|
EXT4_IMMUTABLE_FL|EXT4_NOATIME_FL|EXT4_DIRSYNC_FL);
if (flags & S_SYNC)
ei->i_flags |= EXT4_SYNC_FL;
if (flags & S_APPEND)
ei->i_flags |= EXT4_APPEND_FL;
if (flags & S_IMMUTABLE)
ei->i_flags |= EXT4_IMMUTABLE_FL;
if (flags & S_NOATIME)
ei->i_flags |= EXT4_NOATIME_FL;
if (flags & S_DIRSYNC)
ei->i_flags |= EXT4_DIRSYNC_FL;
unsigned int vfs_fl;
unsigned long old_fl, new_fl;

do {
vfs_fl = ei->vfs_inode.i_flags;
old_fl = ei->i_flags;
new_fl = old_fl & ~(EXT4_SYNC_FL|EXT4_APPEND_FL|
EXT4_IMMUTABLE_FL|EXT4_NOATIME_FL|
EXT4_DIRSYNC_FL);
if (vfs_fl & S_SYNC)
new_fl |= EXT4_SYNC_FL;
if (vfs_fl & S_APPEND)
new_fl |= EXT4_APPEND_FL;
if (vfs_fl & S_IMMUTABLE)
new_fl |= EXT4_IMMUTABLE_FL;
if (vfs_fl & S_NOATIME)
new_fl |= EXT4_NOATIME_FL;
if (vfs_fl & S_DIRSYNC)
new_fl |= EXT4_DIRSYNC_FL;
} while (cmpxchg(&ei->i_flags, old_fl, new_fl) != old_fl);
}

static blkcnt_t ext4_inode_blocks(struct ext4_inode *raw_inode,
Expand Down Expand Up @@ -5191,7 +5197,7 @@ static int ext4_inode_blocks_set(handle_t *handle,
*/
raw_inode->i_blocks_lo = cpu_to_le32(i_blocks);
raw_inode->i_blocks_high = 0;
ei->i_flags &= ~EXT4_HUGE_FILE_FL;
ext4_clear_inode_flag(inode, EXT4_INODE_HUGE_FILE);
return 0;
}
if (!EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_HUGE_FILE))
Expand All @@ -5204,9 +5210,9 @@ static int ext4_inode_blocks_set(handle_t *handle,
*/
raw_inode->i_blocks_lo = cpu_to_le32(i_blocks);
raw_inode->i_blocks_high = cpu_to_le16(i_blocks >> 32);
ei->i_flags &= ~EXT4_HUGE_FILE_FL;
ext4_clear_inode_flag(inode, EXT4_INODE_HUGE_FILE);
} else {
ei->i_flags |= EXT4_HUGE_FILE_FL;
ext4_set_inode_flag(inode, EXT4_INODE_HUGE_FILE);
/* i_block is stored in file system block size */
i_blocks = i_blocks >> (inode->i_blkbits - 9);
raw_inode->i_blocks_lo = cpu_to_le32(i_blocks);
Expand Down

0 comments on commit 7bbce07

Please sign in to comment.