aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-10-16 22:50:48 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-10-16 22:50:48 -0400
commitf287a1a56130be5fdb96a4a62d1290bd064f308e (patch)
tree992ac8f5fef83cafae53b8fe00844f2ad3e79d07 /fs/ext4/inode.c
parent3e624fc72fba09b6f999a9fbb87b64efccd38036 (diff)
ext4: Remove automatic enabling of the HUGE_FILE feature flag
If the HUGE_FILE feature flag is not set, don't allow the creation of large files, instead of automatically enabling the feature flag. Recent versions of mke2fs will set the HUGE_FILE flag automatically anyway for ext4 filesystems. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 27fc6b951221..8dbf6953845b 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4194,7 +4194,6 @@ static int ext4_inode_blocks_set(handle_t *handle,
4194 struct inode *inode = &(ei->vfs_inode); 4194 struct inode *inode = &(ei->vfs_inode);
4195 u64 i_blocks = inode->i_blocks; 4195 u64 i_blocks = inode->i_blocks;
4196 struct super_block *sb = inode->i_sb; 4196 struct super_block *sb = inode->i_sb;
4197 int err = 0;
4198 4197
4199 if (i_blocks <= ~0U) { 4198 if (i_blocks <= ~0U) {
4200 /* 4199 /*
@@ -4204,36 +4203,27 @@ static int ext4_inode_blocks_set(handle_t *handle,
4204 raw_inode->i_blocks_lo = cpu_to_le32(i_blocks); 4203 raw_inode->i_blocks_lo = cpu_to_le32(i_blocks);
4205 raw_inode->i_blocks_high = 0; 4204 raw_inode->i_blocks_high = 0;
4206 ei->i_flags &= ~EXT4_HUGE_FILE_FL; 4205 ei->i_flags &= ~EXT4_HUGE_FILE_FL;
4207 } else if (i_blocks <= 0xffffffffffffULL) { 4206 return 0;
4207 }
4208 if (!EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_HUGE_FILE))
4209 return -EFBIG;
4210
4211 if (i_blocks <= 0xffffffffffffULL) {
4208 /* 4212 /*
4209 * i_blocks can be represented in a 48 bit variable 4213 * i_blocks can be represented in a 48 bit variable
4210 * as multiple of 512 bytes 4214 * as multiple of 512 bytes
4211 */ 4215 */
4212 err = ext4_update_rocompat_feature(handle, sb,
4213 EXT4_FEATURE_RO_COMPAT_HUGE_FILE);
4214 if (err)
4215 goto err_out;
4216 /* i_block is stored in the split 48 bit fields */
4217 raw_inode->i_blocks_lo = cpu_to_le32(i_blocks); 4216 raw_inode->i_blocks_lo = cpu_to_le32(i_blocks);
4218 raw_inode->i_blocks_high = cpu_to_le16(i_blocks >> 32); 4217 raw_inode->i_blocks_high = cpu_to_le16(i_blocks >> 32);
4219 ei->i_flags &= ~EXT4_HUGE_FILE_FL; 4218 ei->i_flags &= ~EXT4_HUGE_FILE_FL;
4220 } else { 4219 } else {
4221 /*
4222 * i_blocks should be represented in a 48 bit variable
4223 * as multiple of file system block size
4224 */
4225 err = ext4_update_rocompat_feature(handle, sb,
4226 EXT4_FEATURE_RO_COMPAT_HUGE_FILE);
4227 if (err)
4228 goto err_out;
4229 ei->i_flags |= EXT4_HUGE_FILE_FL; 4220 ei->i_flags |= EXT4_HUGE_FILE_FL;
4230 /* i_block is stored in file system block size */ 4221 /* i_block is stored in file system block size */
4231 i_blocks = i_blocks >> (inode->i_blkbits - 9); 4222 i_blocks = i_blocks >> (inode->i_blkbits - 9);
4232 raw_inode->i_blocks_lo = cpu_to_le32(i_blocks); 4223 raw_inode->i_blocks_lo = cpu_to_le32(i_blocks);
4233 raw_inode->i_blocks_high = cpu_to_le16(i_blocks >> 32); 4224 raw_inode->i_blocks_high = cpu_to_le16(i_blocks >> 32);
4234 } 4225 }
4235err_out: 4226 return 0;
4236 return err;
4237} 4227}
4238 4228
4239/* 4229/*