Skip to content

Commit 07a0382

Browse files
committed
ext4: Convert more i_flags references to use accessor functions
These changes are not ones which are likely to result in races, but they should be fixed. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent a037515 commit 07a0382

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎fs/ext4/dir.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ static int ext4_readdir(struct file *filp,
121121
* We don't set the inode dirty flag since it's not
122122
* critical that it get flushed back to the disk.
123123
*/
124-
ext4_clear_inode_flag(filp->f_path.dentry->d_inode, EXT4_INODE_INDEX);
124+
ext4_clear_inode_flag(filp->f_path.dentry->d_inode,
125+
EXT4_INODE_INDEX);
125126
}
126127
stored = 0;
127128
offset = filp->f_pos & (sb->s_blocksize - 1);

‎fs/ext4/inode.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4976,7 +4976,7 @@ static blkcnt_t ext4_inode_blocks(struct ext4_inode *raw_inode,
49764976
/* we are using combined 48 bit field */
49774977
i_blocks = ((u64)le16_to_cpu(raw_inode->i_blocks_high)) << 32 |
49784978
le32_to_cpu(raw_inode->i_blocks_lo);
4979-
if (ei->i_flags & EXT4_HUGE_FILE_FL) {
4979+
if (ext4_test_inode_flag(inode, EXT4_INODE_HUGE_FILE)) {
49804980
/* i_blocks represent file system block size */
49814981
return i_blocks << (inode->i_blkbits - 9);
49824982
} else {
@@ -5126,7 +5126,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
51265126
ei->i_file_acl);
51275127
ret = -EIO;
51285128
goto bad_inode;
5129-
} else if (ei->i_flags & EXT4_EXTENTS_FL) {
5129+
} else if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {
51305130
if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
51315131
(S_ISLNK(inode->i_mode) &&
51325132
!ext4_inode_is_fast_symlink(inode)))

‎fs/ext4/migrate.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static int ext4_ext_swap_inode_data(handle_t *handle, struct inode *inode,
376376
* We have the extent map build with the tmp inode.
377377
* Now copy the i_data across
378378
*/
379-
ei->i_flags |= EXT4_EXTENTS_FL;
379+
ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS);
380380
memcpy(ei->i_data, tmp_ei->i_data, sizeof(ei->i_data));
381381

382382
/*

0 commit comments

Comments
 (0)