summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2016-01-26 02:40:44 -0500
committerJaegeuk Kim <jaegeuk@kernel.org>2016-02-22 19:07:23 -0500
commit3cf4574705b4e1a1a0aeaae0332e8c2c8b56cc8f (patch)
tree1080b5e5735ded164cf46b4d1e73d44b26528de2 /fs/f2fs/f2fs.h
parent81ca7350ce5ed438547ea769b0c33cb0abbd74ba (diff)
f2fs: introduce get_next_page_offset to speed up SEEK_DATA
When seeking data in ->llseek, if we encounter a big hole which covers several dnode pages, we will try to seek data from index of page which is the first page of next dnode page, at most we could skip searching (ADDRS_PER_BLOCK - 1) pages. However it's still not efficient, because if our indirect/double-indirect pointer are NULL, there are no dnode page locate in the tree indirect/ double-indirect pointer point to, it's not necessary to search the whole region. This patch introduces get_next_page_offset to calculate next page offset based on current searching level and max searching level returned from get_dnode_of_data, with this, we could skip searching the entire area indirect or double-indirect node block is not exist. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 00bb83fc35e6..d86b52169d6e 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -551,6 +551,8 @@ struct dnode_of_data {
551 unsigned int ofs_in_node; /* data offset in the node page */ 551 unsigned int ofs_in_node; /* data offset in the node page */
552 bool inode_page_locked; /* inode page is locked or not */ 552 bool inode_page_locked; /* inode page is locked or not */
553 bool node_changed; /* is node block changed */ 553 bool node_changed; /* is node block changed */
554 char cur_level; /* level of hole node page */
555 char max_level; /* level of current page located */
554 block_t data_blkaddr; /* block address of the node block */ 556 block_t data_blkaddr; /* block address of the node block */
555}; 557};
556 558
@@ -1793,6 +1795,7 @@ int need_dentry_mark(struct f2fs_sb_info *, nid_t);
1793bool is_checkpointed_node(struct f2fs_sb_info *, nid_t); 1795bool is_checkpointed_node(struct f2fs_sb_info *, nid_t);
1794bool need_inode_block_update(struct f2fs_sb_info *, nid_t); 1796bool need_inode_block_update(struct f2fs_sb_info *, nid_t);
1795void get_node_info(struct f2fs_sb_info *, nid_t, struct node_info *); 1797void get_node_info(struct f2fs_sb_info *, nid_t, struct node_info *);
1798pgoff_t get_next_page_offset(struct dnode_of_data *, pgoff_t);
1796int get_dnode_of_data(struct dnode_of_data *, pgoff_t, int); 1799int get_dnode_of_data(struct dnode_of_data *, pgoff_t, int);
1797int truncate_inode_blocks(struct inode *, pgoff_t); 1800int truncate_inode_blocks(struct inode *, pgoff_t);
1798int truncate_xattr_node(struct inode *, struct page *); 1801int truncate_xattr_node(struct inode *, struct page *);