summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/inline.c
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2016-02-19 16:02:51 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2016-02-22 21:39:59 -0800
commit8060656aa337f7cd34f1818b24417e8a7a00f4a5 (patch)
tree7f3a9f96665e74feac803aeb6e4f4b6154752ec0 /fs/f2fs/inline.c
parent993a04996f0c6ac3a1b85953240b76036ddee40a (diff)
downloadlinux-8060656aa337f7cd34f1818b24417e8a7a00f4a5.tar.bz2
f2fs: reuse read_inline_data for f2fs_convert_inline_page
f2fs_convert_inline_page introduce what read_inline_data already does for copying out the inline data from inode_page. We can use read_inline_data instead to simplify the code. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inline.c')
-rw-r--r--fs/f2fs/inline.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 0be4a9b400c6..6caad8bea8aa 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -105,7 +105,6 @@ int f2fs_read_inline_data(struct inode *inode, struct page *page)
int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page)
{
- void *src_addr, *dst_addr;
struct f2fs_io_info fio = {
.sbi = F2FS_I_SB(dn->inode),
.type = DATA,
@@ -115,8 +114,6 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page)
};
int dirty, err;
- f2fs_bug_on(F2FS_I_SB(dn->inode), page->index);
-
if (!f2fs_exist_data(dn->inode))
goto clear_out;
@@ -125,19 +122,8 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page)
return err;
f2fs_bug_on(F2FS_P_SB(page), PageWriteback(page));
- if (PageUptodate(page))
- goto no_update;
- zero_user_segment(page, MAX_INLINE_DATA, PAGE_CACHE_SIZE);
-
- /* Copy the whole inline data block */
- src_addr = inline_data_addr(dn->inode_page);
- dst_addr = kmap_atomic(page);
- memcpy(dst_addr, src_addr, MAX_INLINE_DATA);
- flush_dcache_page(page);
- kunmap_atomic(dst_addr);
- SetPageUptodate(page);
-no_update:
+ read_inline_data(page, dn->inode_page);
set_page_dirty(page);
/* clear dirty state */