aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2014-04-29 04:28:32 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-05-06 21:21:58 -0400
commit54b591dfda1f5ab0bc2a9ce1bee5364110168777 (patch)
tree7f7f2ad061083fad401fcbc96728817e3cbe790e /fs/f2fs/node.c
parent8aa6f1c5bd7043734fff1961a4795da9cc5d0f50 (diff)
f2fs: split grab_cache_page and wait_on_page_writeback for node pages
This patch splits grab_cache_page_write_begin into grab_cache_page and wait_on_page_writeback for node pages. This patch intends to enhance the latency to get node pages by alleviating unnecessary wait_on_page_writeback. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 2803ef6cf533..059aaf5dda2b 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -853,8 +853,7 @@ struct page *new_node_page(struct dnode_of_data *dn,
853 if (unlikely(is_inode_flag_set(F2FS_I(dn->inode), FI_NO_ALLOC))) 853 if (unlikely(is_inode_flag_set(F2FS_I(dn->inode), FI_NO_ALLOC)))
854 return ERR_PTR(-EPERM); 854 return ERR_PTR(-EPERM);
855 855
856 page = grab_cache_page_write_begin(NODE_MAPPING(sbi), 856 page = grab_cache_page(NODE_MAPPING(sbi), dn->nid);
857 dn->nid, AOP_FLAG_NOFS);
858 if (!page) 857 if (!page)
859 return ERR_PTR(-ENOMEM); 858 return ERR_PTR(-ENOMEM);
860 859
@@ -871,6 +870,7 @@ struct page *new_node_page(struct dnode_of_data *dn,
871 new_ni.ino = dn->inode->i_ino; 870 new_ni.ino = dn->inode->i_ino;
872 set_node_addr(sbi, &new_ni, NEW_ADDR, false); 871 set_node_addr(sbi, &new_ni, NEW_ADDR, false);
873 872
873 f2fs_wait_on_page_writeback(page, NODE);
874 fill_node_footer(page, dn->nid, dn->inode->i_ino, ofs, true); 874 fill_node_footer(page, dn->nid, dn->inode->i_ino, ofs, true);
875 set_cold_node(dn->inode, page); 875 set_cold_node(dn->inode, page);
876 SetPageUptodate(page); 876 SetPageUptodate(page);
@@ -950,8 +950,7 @@ struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
950 struct page *page; 950 struct page *page;
951 int err; 951 int err;
952repeat: 952repeat:
953 page = grab_cache_page_write_begin(NODE_MAPPING(sbi), 953 page = grab_cache_page(NODE_MAPPING(sbi), nid);
954 nid, AOP_FLAG_NOFS);
955 if (!page) 954 if (!page)
956 return ERR_PTR(-ENOMEM); 955 return ERR_PTR(-ENOMEM);
957 956
@@ -1562,6 +1561,7 @@ static void recover_inline_xattr(struct inode *inode, struct page *page)
1562 src_addr = inline_xattr_addr(page); 1561 src_addr = inline_xattr_addr(page);
1563 inline_size = inline_xattr_size(inode); 1562 inline_size = inline_xattr_size(inode);
1564 1563
1564 f2fs_wait_on_page_writeback(ipage, NODE);
1565 memcpy(dst_addr, src_addr, inline_size); 1565 memcpy(dst_addr, src_addr, inline_size);
1566 1566
1567 update_inode(inode, ipage); 1567 update_inode(inode, ipage);