summaryrefslogtreecommitdiff
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-03-17 06:12:23 +0300
committerTheodore Ts'o <tytso@mit.edu>2009-03-17 06:12:23 +0300
commitafd4672dc7610b7feef5190168aa917cc2e417e4 (patch)
tree53a3aa709232b00473c8da70b792b350150956ff /fs/ext4/namei.c
parent7d39db14a42cbd719c7515b9da8f85a2eb6a0633 (diff)
downloadlinux-afd4672dc7610b7feef5190168aa917cc2e417e4.tar.xz
ext4: Add auto_da_alloc mount option
Add a mount option which allows the user to disable automatic allocation of blocks whose allocation by delayed allocation when the file was originally truncated or when the file is renamed over an existing file. This feature is intended to save users from the effects of naive application writers, but it reduces the effectiveness of the delayed allocation code. This mount option disables this safety feature, which may be desirable for prodcutions systems where the risk of unclean shutdowns or unexpected system crashes is low. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index eb20246c8965..22098e1cd085 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2497,7 +2497,8 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
ext4_mark_inode_dirty(handle, new_inode);
if (!new_inode->i_nlink)
ext4_orphan_add(handle, new_inode);
- force_da_alloc = 1;
+ if (!test_opt(new_dir->i_sb, NO_AUTO_DA_ALLOC))
+ force_da_alloc = 1;
}
retval = 0;