aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2008-01-28 23:58:27 -0500
committerTheodore Ts'o <tytso@mit.edu>2008-01-28 23:58:27 -0500
commita48380f769dfed6163fb82a68b13bd562ea1e027 (patch)
tree2c898479122b3da5c9531aba4b3629c3e6ecfe9f /fs/ext4/inode.c
parent7973c0c19ecba92f113488045005f8e7ce1cd7c8 (diff)
ext4: Rename i_dir_acl to i_size_high
Rename ext4_inode.i_dir_acl to i_size_high drop ext4_inode_info.i_dir_acl as it is not used Rename ext4_inode.i_size to ext4_inode.i_size_lo Add helper function for accessing the ext4_inode combined i_size. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c55
1 files changed, 22 insertions, 33 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 7bcec1860084..e6634550cfc8 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2694,7 +2694,6 @@ void ext4_read_inode(struct inode * inode)
2694 inode->i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16; 2694 inode->i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
2695 } 2695 }
2696 inode->i_nlink = le16_to_cpu(raw_inode->i_links_count); 2696 inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
2697 inode->i_size = le32_to_cpu(raw_inode->i_size);
2698 2697
2699 ei->i_state = 0; 2698 ei->i_state = 0;
2700 ei->i_dir_start_lookup = 0; 2699 ei->i_dir_start_lookup = 0;
@@ -2720,15 +2719,11 @@ void ext4_read_inode(struct inode * inode)
2720 ei->i_flags = le32_to_cpu(raw_inode->i_flags); 2719 ei->i_flags = le32_to_cpu(raw_inode->i_flags);
2721 ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl_lo); 2720 ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl_lo);
2722 if (EXT4_SB(inode->i_sb)->s_es->s_creator_os != 2721 if (EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
2723 cpu_to_le32(EXT4_OS_HURD)) 2722 cpu_to_le32(EXT4_OS_HURD)) {
2724 ei->i_file_acl |= 2723 ei->i_file_acl |=
2725 ((__u64)le16_to_cpu(raw_inode->i_file_acl_high)) << 32; 2724 ((__u64)le16_to_cpu(raw_inode->i_file_acl_high)) << 32;
2726 if (!S_ISREG(inode->i_mode)) {
2727 ei->i_dir_acl = le32_to_cpu(raw_inode->i_dir_acl);
2728 } else {
2729 inode->i_size |=
2730 ((__u64)le32_to_cpu(raw_inode->i_size_high)) << 32;
2731 } 2725 }
2726 inode->i_size = ext4_isize(raw_inode);
2732 ei->i_disksize = inode->i_size; 2727 ei->i_disksize = inode->i_size;
2733 inode->i_generation = le32_to_cpu(raw_inode->i_generation); 2728 inode->i_generation = le32_to_cpu(raw_inode->i_generation);
2734 ei->i_block_group = iloc.block_group; 2729 ei->i_block_group = iloc.block_group;
@@ -2852,7 +2847,6 @@ static int ext4_do_update_inode(handle_t *handle,
2852 raw_inode->i_gid_high = 0; 2847 raw_inode->i_gid_high = 0;
2853 } 2848 }
2854 raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); 2849 raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
2855 raw_inode->i_size = cpu_to_le32(ei->i_disksize);
2856 2850
2857 EXT4_INODE_SET_XTIME(i_ctime, inode, raw_inode); 2851 EXT4_INODE_SET_XTIME(i_ctime, inode, raw_inode);
2858 EXT4_INODE_SET_XTIME(i_mtime, inode, raw_inode); 2852 EXT4_INODE_SET_XTIME(i_mtime, inode, raw_inode);
@@ -2867,32 +2861,27 @@ static int ext4_do_update_inode(handle_t *handle,
2867 raw_inode->i_file_acl_high = 2861 raw_inode->i_file_acl_high =
2868 cpu_to_le16(ei->i_file_acl >> 32); 2862 cpu_to_le16(ei->i_file_acl >> 32);
2869 raw_inode->i_file_acl_lo = cpu_to_le32(ei->i_file_acl); 2863 raw_inode->i_file_acl_lo = cpu_to_le32(ei->i_file_acl);
2870 if (!S_ISREG(inode->i_mode)) { 2864 ext4_isize_set(raw_inode, ei->i_disksize);
2871 raw_inode->i_dir_acl = cpu_to_le32(ei->i_dir_acl); 2865 if (ei->i_disksize > 0x7fffffffULL) {
2872 } else { 2866 struct super_block *sb = inode->i_sb;
2873 raw_inode->i_size_high = 2867 if (!EXT4_HAS_RO_COMPAT_FEATURE(sb,
2874 cpu_to_le32(ei->i_disksize >> 32); 2868 EXT4_FEATURE_RO_COMPAT_LARGE_FILE) ||
2875 if (ei->i_disksize > 0x7fffffffULL) { 2869 EXT4_SB(sb)->s_es->s_rev_level ==
2876 struct super_block *sb = inode->i_sb; 2870 cpu_to_le32(EXT4_GOOD_OLD_REV)) {
2877 if (!EXT4_HAS_RO_COMPAT_FEATURE(sb, 2871 /* If this is the first large file
2878 EXT4_FEATURE_RO_COMPAT_LARGE_FILE) || 2872 * created, add a flag to the superblock.
2879 EXT4_SB(sb)->s_es->s_rev_level == 2873 */
2880 cpu_to_le32(EXT4_GOOD_OLD_REV)) { 2874 err = ext4_journal_get_write_access(handle,
2881 /* If this is the first large file 2875 EXT4_SB(sb)->s_sbh);
2882 * created, add a flag to the superblock. 2876 if (err)
2883 */ 2877 goto out_brelse;
2884 err = ext4_journal_get_write_access(handle, 2878 ext4_update_dynamic_rev(sb);
2885 EXT4_SB(sb)->s_sbh); 2879 EXT4_SET_RO_COMPAT_FEATURE(sb,
2886 if (err)
2887 goto out_brelse;
2888 ext4_update_dynamic_rev(sb);
2889 EXT4_SET_RO_COMPAT_FEATURE(sb,
2890 EXT4_FEATURE_RO_COMPAT_LARGE_FILE); 2880 EXT4_FEATURE_RO_COMPAT_LARGE_FILE);
2891 sb->s_dirt = 1; 2881 sb->s_dirt = 1;
2892 handle->h_sync = 1; 2882 handle->h_sync = 1;
2893 err = ext4_journal_dirty_metadata(handle, 2883 err = ext4_journal_dirty_metadata(handle,
2894 EXT4_SB(sb)->s_sbh); 2884 EXT4_SB(sb)->s_sbh);
2895 }
2896 } 2885 }
2897 } 2886 }
2898 raw_inode->i_generation = cpu_to_le32(inode->i_generation); 2887 raw_inode->i_generation = cpu_to_le32(inode->i_generation);