summaryrefslogtreecommitdiff
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-06-17 13:59:05 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2015-08-04 14:09:53 -0700
commit97a7b2c274d5dbe51170e099c16d49cfd1b467af (patch)
treea4a1b98cff8a47b8149a96557309c2cef8c0577c /fs/f2fs/file.c
parentc9b63bd01dd8da096d079c490771ad8a049fd480 (diff)
f2fs: convert inline_data for various fallocate
For newly added fallocate types, it should convert inline_data before handling block swapping. Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index b0f38c3b37f4..fe8398f1d627 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -885,6 +885,14 @@ static int f2fs_collapse_range(struct inode *inode, loff_t offset, loff_t len)
if (offset & (F2FS_BLKSIZE - 1) || len & (F2FS_BLKSIZE - 1))
return -EINVAL;
+ f2fs_balance_fs(F2FS_I_SB(inode));
+
+ if (f2fs_has_inline_data(inode)) {
+ ret = f2fs_convert_inline_inode(inode);
+ if (ret)
+ return ret;
+ }
+
pg_start = offset >> PAGE_CACHE_SHIFT;
pg_end = (offset + len) >> PAGE_CACHE_SHIFT;
@@ -1033,6 +1041,12 @@ static int f2fs_insert_range(struct inode *inode, loff_t offset, loff_t len)
f2fs_balance_fs(sbi);
+ if (f2fs_has_inline_data(inode)) {
+ ret = f2fs_convert_inline_inode(inode);
+ if (ret)
+ return ret;
+ }
+
ret = truncate_blocks(inode, i_size_read(inode), true);
if (ret)
return ret;