summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/inline.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-05-20 16:32:49 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-06-02 18:05:12 -0700
commitee6d182f2a19d5d44607b5ae4bec523726d76a99 (patch)
tree514092851eb0e974c6ac8add90fed10056b84998 /fs/f2fs/inline.c
parent0f18b462b2e5aff64b8638e8a47284b907351ef3 (diff)
downloadlinux-ee6d182f2a19d5d44607b5ae4bec523726d76a99.tar.gz
linux-ee6d182f2a19d5d44607b5ae4bec523726d76a99.tar.bz2
linux-ee6d182f2a19d5d44607b5ae4bec523726d76a99.zip
f2fs: remove syncing inode page in all the cases
This patch reduces to call them across the whole tree. - sync_inode_page() - update_inode_page() - update_inode() - f2fs_write_inode() Instead, checkpoint will flush all the dirty inode metadata before syncing node pages. Note that, this is doable, since we call mark_inode_dirty_sync() for all inode's field change which needs to update on-disk inode as well. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inline.c')
-rw-r--r--fs/f2fs/inline.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 4bc025c29f82..77c9c2439993 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -73,7 +73,7 @@ bool truncate_inline_inode(struct page *ipage, u64 from)
f2fs_wait_on_page_writeback(ipage, NODE, true);
memset(addr + from, 0, MAX_INLINE_DATA - from);
-
+ set_page_dirty(ipage);
return true;
}
@@ -146,7 +146,6 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page)
clear_out:
stat_dec_inline_inode(dn->inode);
f2fs_clear_inline_inode(dn->inode);
- sync_inode_page(dn);
f2fs_put_dnode(dn);
return 0;
}
@@ -212,11 +211,11 @@ int f2fs_write_inline_data(struct inode *inode, struct page *page)
dst_addr = inline_data_addr(dn.inode_page);
memcpy(dst_addr, src_addr, MAX_INLINE_DATA);
kunmap_atomic(src_addr);
+ set_page_dirty(dn.inode_page);
set_inode_flag(inode, FI_APPEND_WRITE);
set_inode_flag(inode, FI_DATA_EXIST);
- sync_inode_page(&dn);
clear_inline_node(dn.inode_page);
f2fs_put_dnode(&dn);
return 0;
@@ -255,7 +254,7 @@ process_inline:
set_inode_flag(inode, FI_INLINE_DATA);
set_inode_flag(inode, FI_DATA_EXIST);
- update_inode(inode, ipage);
+ set_page_dirty(ipage);
f2fs_put_page(ipage, 1);
return true;
}
@@ -266,7 +265,6 @@ process_inline:
if (!truncate_inline_inode(ipage, 0))
return false;
f2fs_clear_inline_inode(inode);
- update_inode(inode, ipage);
f2fs_put_page(ipage, 1);
} else if (ri && (ri->i_inline & F2FS_INLINE_DATA)) {
if (truncate_blocks(inode, 0, false))
@@ -339,10 +337,8 @@ int make_empty_inline_dir(struct inode *inode, struct inode *parent,
set_page_dirty(ipage);
/* update i_size to MAX_INLINE_DATA */
- if (i_size_read(inode) < MAX_INLINE_DATA) {
+ if (i_size_read(inode) < MAX_INLINE_DATA)
f2fs_i_size_write(inode, MAX_INLINE_DATA);
- set_inode_flag(inode, FI_UPDATE_DIR);
- }
return 0;
}
@@ -401,12 +397,8 @@ static int f2fs_move_inline_dirents(struct inode *dir, struct page *ipage,
clear_inode_flag(dir, FI_INLINE_DENTRY);
f2fs_i_depth_write(dir, 1);
- if (i_size_read(dir) < PAGE_SIZE) {
+ if (i_size_read(dir) < PAGE_SIZE)
f2fs_i_size_write(dir, PAGE_SIZE);
- set_inode_flag(dir, FI_UPDATE_DIR);
- }
-
- sync_inode_page(&dn);
out:
f2fs_put_page(page, 1);
return err;
@@ -486,7 +478,6 @@ static int f2fs_move_rehashed_dirents(struct inode *dir, struct page *ipage,
stat_dec_inline_dir(dir);
clear_inode_flag(dir, FI_INLINE_DENTRY);
- update_inode(dir, ipage);
kfree(backup_dentry);
return 0;
recover:
@@ -494,7 +485,7 @@ recover:
memcpy(inline_dentry, backup_dentry, MAX_INLINE_DATA);
f2fs_i_depth_write(dir, 0);
f2fs_i_size_write(dir, MAX_INLINE_DATA);
- update_inode(dir, ipage);
+ set_page_dirty(ipage);
f2fs_put_page(ipage, 1);
kfree(backup_dentry);
@@ -559,7 +550,6 @@ int f2fs_add_inline_entry(struct inode *dir, const struct qstr *name,
/* we don't need to mark_inode_dirty now */
if (inode) {
f2fs_i_pino_write(inode, dir->i_ino);
- update_inode(inode, page);
f2fs_put_page(page, 1);
}
@@ -567,11 +557,6 @@ int f2fs_add_inline_entry(struct inode *dir, const struct qstr *name,
fail:
if (inode)
up_write(&F2FS_I(inode)->i_sem);
-
- if (is_inode_flag_set(dir, FI_UPDATE_DIR)) {
- update_inode(dir, ipage);
- clear_inode_flag(dir, FI_UPDATE_DIR);
- }
out:
f2fs_put_page(ipage, 1);
return err;