diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-12-05 17:18:15 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-12-08 10:35:15 -0800 |
commit | 8dcf2ff72120707f960d9b3b15ce6e50705b13a6 (patch) | |
tree | bfc57918d72b70aeae3f7d6b79de8a06e20ed772 /fs/f2fs/segment.c | |
parent | 126622343a8488917c5e0891eae1bc936a63f49a (diff) | |
download | linux-8dcf2ff72120707f960d9b3b15ce6e50705b13a6.tar.bz2 |
f2fs: count the number of inmemory pages
This patch adds counting # of inmemory pages in the page cache.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 3ebcf96bc5f3..42607a679923 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -201,6 +201,7 @@ retry: } get_page(page); list_add_tail(&new->list, &fi->inmem_pages); + inc_page_count(F2FS_I_SB(inode), F2FS_INMEM_PAGES); mutex_unlock(&fi->inmem_lock); } @@ -216,6 +217,7 @@ void invalidate_inmem_page(struct inode *inode, struct page *page) f2fs_put_page(cur->page, 0); list_del(&cur->list); kmem_cache_free(inmem_entry_slab, cur); + dec_page_count(F2FS_I_SB(inode), F2FS_INMEM_PAGES); } mutex_unlock(&fi->inmem_lock); } @@ -257,6 +259,7 @@ void commit_inmem_pages(struct inode *inode, bool abort) f2fs_put_page(cur->page, 1); list_del(&cur->list); kmem_cache_free(inmem_entry_slab, cur); + dec_page_count(F2FS_I_SB(inode), F2FS_INMEM_PAGES); } if (submit_bio) f2fs_submit_merged_bio(sbi, DATA, WRITE); |