Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8230a0a4 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

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: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent f185ff97
Loading
Loading
Loading
Loading
+3 −19
Original line number Original line Diff line number Diff line
@@ -462,25 +462,9 @@ static int punch_hole(struct inode *inode, loff_t offset, loff_t len)
	loff_t off_start, off_end;
	loff_t off_start, off_end;
	int ret = 0;
	int ret = 0;


	if (f2fs_has_inline_data(inode)) {
	ret = f2fs_convert_inline_data(inode, NULL, AOP_FLAG_NOFS);
		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)
	if (ret)
		return ret;
		return ret;
		} else {
			zero_user_segment(page, offset, offset + len);
			SetPageUptodate(page);
			set_page_dirty(page);
			f2fs_put_page(page, 1);
			return ret;
		}
	}


	pg_start = ((unsigned long long) offset) >> PAGE_CACHE_SHIFT;
	pg_start = ((unsigned long long) offset) >> PAGE_CACHE_SHIFT;
	pg_end = ((unsigned long long) offset + len) >> PAGE_CACHE_SHIFT;
	pg_end = ((unsigned long long) offset + len) >> PAGE_CACHE_SHIFT;