diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-02-09 21:06:24 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-02-09 21:06:24 +0100 |
commit | 64044abf05d0842a7fed30e102fa411a744c7d9f (patch) | |
tree | 91a28727b410b354799b8bb5c1737ebf00883ce4 /fs/ext4/namei.c | |
parent | ext4: fix the number of credits needed for ext4_ext_migrate() (diff) | |
download | linux-64044abf05d0842a7fed30e102fa411a744c7d9f.tar.xz linux-64044abf05d0842a7fed30e102fa411a744c7d9f.zip |
ext4: fix the number of credits needed for ext4_unlink() and ext4_rmdir()
The ext4_unlink() and ext4_rmdir() don't actually release the blocks
associated with the file/directory. This gets done in a separate jbd2
handle called via ext4_evict_inode(). Thus, we don't need to reserve
lots of journal credits for the truncate.
Note that using too many journal credits is non-optimal because it can
leading to the journal transmit getting closed too early, before it is
strictly necessary.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r-- | fs/ext4/namei.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 36a4afd12f39..5f3d2b569c63 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2748,7 +2748,7 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry) goto end_rmdir; handle = ext4_journal_start(dir, EXT4_HT_DIR, - EXT4_DELETE_TRANS_BLOCKS(dir->i_sb)); + EXT4_DATA_TRANS_BLOCKS(dir->i_sb)); if (IS_ERR(handle)) { retval = PTR_ERR(handle); handle = NULL; @@ -2811,7 +2811,7 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry) goto end_unlink; handle = ext4_journal_start(dir, EXT4_HT_DIR, - EXT4_DELETE_TRANS_BLOCKS(dir->i_sb)); + EXT4_DATA_TRANS_BLOCKS(dir->i_sb)); if (IS_ERR(handle)) { retval = PTR_ERR(handle); handle = NULL; |