Commit 9eaeba70 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: move f2fs_balance_fs to punch_hole

The f2fs_fallocate() has two operations: punch_hole and expand_size.

Only in the case of punch_hole, dirty node pages can be produced, so let's
trigger f2fs_balance_fs() in this case only.
Furthermore, let's trigger it at every data truncation routine.

Signed-off-by: default avatarNamjae Jeon <>
Signed-off-by: default avatarJaegeuk Kim <>
parent 7d82db83
......@@ -410,6 +410,8 @@ int truncate_hole(struct inode *inode, pgoff_t pg_start, pgoff_t pg_end)
struct dnode_of_data dn;
struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
mutex_lock_op(sbi, DATA_TRUNC);
set_new_dnode(&dn, inode, NULL, NULL, 0);
err = get_dnode_of_data(&dn, index, RDONLY_NODE);
......@@ -537,7 +539,6 @@ static long f2fs_fallocate(struct file *file, int mode,
loff_t offset, loff_t len)
struct inode *inode = file->f_path.dentry->d_inode;
struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
long ret;
......@@ -552,8 +553,6 @@ static long f2fs_fallocate(struct file *file, int mode,
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
return ret;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment