diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-02-05 11:01:39 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-03-03 18:58:47 +0100 |
commit | 62c8af651b37490c18a42c02586fa6a4fb39320a (patch) | |
tree | a86e61b8e2d691f54db3208b6e77d25e25b1ec8b /fs/f2fs/f2fs.h | |
parent | f2fs: add trace for rb-tree extent cache ops (diff) | |
download | linux-62c8af651b37490c18a42c02586fa6a4fb39320a.tar.xz linux-62c8af651b37490c18a42c02586fa6a4fb39320a.zip |
f2fs: support fast lookup in extent cache
This patch adds a fast lookup path for rb-tree extent cache.
In this patch we add a recently accessed extent node pointer 'cached_en' in
extent tree. In lookup path of extent cache, we will firstly lookup the last
accessed extent node which cached_en points, if we do not hit in this node,
we will try to lookup extent node in rb-tree.
By this way we can avoid unnecessary slow lookup in rb-tree sometimes.
Note that, side-effect of this patch is that we will increase memory cost,
because we will store a pointer variable in each struct extent tree
additionally.
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.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 85ce9b30b539..08fc7e0d5e4a 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -298,6 +298,7 @@ struct extent_node { struct extent_tree { nid_t ino; /* inode number */ struct rb_root root; /* root of extent info rb-tree */ + struct extent_node *cached_en; /* recently accessed extent node */ rwlock_t lock; /* protect extent info rb-tree */ atomic_t refcount; /* reference count of rb-tree */ unsigned int count; /* # of extent node in rb-tree*/ |