diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-12-27 11:13:21 +0900 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2015-05-02 14:36:01 +0200 |
commit | 414b73c06d508eb852510dbd1ee823cbe63bacca (patch) | |
tree | 35a1873b744ed2ad30385588eb7f3fe48c6ee270 /fs | |
parent | 2d00226bff3abc8e97f2a683009ee5bb07d104c6 (diff) | |
download | kernel_samsung_tuna-414b73c06d508eb852510dbd1ee823cbe63bacca.zip kernel_samsung_tuna-414b73c06d508eb852510dbd1ee823cbe63bacca.tar.gz kernel_samsung_tuna-414b73c06d508eb852510dbd1ee823cbe63bacca.tar.bz2 |
f2fs: convert inline_data for punch_hole
In the punch_hole(), let's convert inline_data all the time for simplicity and
to avoid potential deadlock conditions.
It is pretty much not a big deal to do this.
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/file.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index a618794..239b6f4 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -459,25 +459,9 @@ static int punch_hole(struct inode *inode, loff_t offset, loff_t len) loff_t off_start, off_end; int ret = 0; - if (f2fs_has_inline_data(inode)) { - struct page *page; - unsigned flags = AOP_FLAG_NOFS; - page = grab_cache_page_write_begin(inode->i_mapping, 0, flags); - if (IS_ERR(page)) - return PTR_ERR(page); - if (offset + len > MAX_INLINE_DATA) { - ret = f2fs_convert_inline_data(inode, page, flags); - f2fs_put_page(page, 1); - if (ret) - return ret; - } else { - zero_user_segment(page, offset, offset + len); - SetPageUptodate(page); - set_page_dirty(page); - f2fs_put_page(page, 1); - return ret; - } - } + ret = f2fs_convert_inline_data(inode, NULL, AOP_FLAG_NOFS); + if (ret) + return ret; pg_start = ((unsigned long long) offset) >> PAGE_CACHE_SHIFT; pg_end = ((unsigned long long) offset + len) >> PAGE_CACHE_SHIFT; |