diff options
author | Theodore Ts'o <tytso@mit.edu> | 2014-03-24 14:09:06 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-03-24 14:09:06 -0400 |
commit | ed3654eb981fd44694b4d2a636e13f998bc10e7f (patch) | |
tree | 133c6cd3044dc9aa628065550b873ba86d79c2f3 /fs/ext4/inode.c | |
parent | c4f65706056e9f0c2cf126b29c6920a179d91150 (diff) | |
download | linux-ed3654eb981fd44694b4d2a636e13f998bc10e7f.tar.gz linux-ed3654eb981fd44694b4d2a636e13f998bc10e7f.tar.bz2 linux-ed3654eb981fd44694b4d2a636e13f998bc10e7f.zip |
ext4: optimize Hurd tests when reading/writing inodes
Set a in-memory superblock flag to indicate whether the file system is
designed to support the Hurd.
Also, add a sanity check to make sure the 64-bit feature is not set
for Hurd file systems, since i_file_acl_high conflicts with a
Hurd-specific field.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index ed2c13a7f293..b5e182acf9b9 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4168,8 +4168,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) EXT4_INODE_GET_XTIME(i_atime, inode, raw_inode); EXT4_EINODE_GET_XTIME(i_crtime, ei, raw_inode); - if (EXT4_SB(inode->i_sb)->s_es->s_creator_os != - cpu_to_le32(EXT4_OS_HURD)) { + if (likely(!test_opt2(inode->i_sb, HURD_COMPAT))) { inode->i_version = le32_to_cpu(raw_inode->i_disk_version); if (EXT4_INODE_SIZE(inode->i_sb) > EXT4_GOOD_OLD_INODE_SIZE) { if (EXT4_FITS_IN_INODE(raw_inode, ei, i_version_hi)) @@ -4345,8 +4344,7 @@ static int ext4_do_update_inode(handle_t *handle, goto out_brelse; raw_inode->i_dtime = cpu_to_le32(ei->i_dtime); raw_inode->i_flags = cpu_to_le32(ei->i_flags & 0xFFFFFFFF); - if (EXT4_SB(inode->i_sb)->s_es->s_creator_os != - cpu_to_le32(EXT4_OS_HURD)) + if (likely(!test_opt2(inode->i_sb, HURD_COMPAT))) raw_inode->i_file_acl_high = cpu_to_le16(ei->i_file_acl >> 32); raw_inode->i_file_acl_lo = cpu_to_le32(ei->i_file_acl); @@ -4391,8 +4389,7 @@ static int ext4_do_update_inode(handle_t *handle, raw_inode->i_block[block] = ei->i_data[block]; } - if (EXT4_SB(inode->i_sb)->s_es->s_creator_os != - cpu_to_le32(EXT4_OS_HURD)) { + if (likely(!test_opt2(inode->i_sb, HURD_COMPAT))) { raw_inode->i_disk_version = cpu_to_le32(inode->i_version); if (ei->i_extra_isize) { if (EXT4_FITS_IN_INODE(raw_inode, ei, i_version_hi)) |