You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user