Flushing the page cache associated with an inode
I modified the block mapping in an inode and want to flush the page cache associated with the inode so that the new inode with new mapping will be loaded from disk. I tried below functions but it works some time and fails some other time.
invalidate_mapping_pages() - for flushing non-dirty pages truncate_inode_pa开发者_运维问答ges() - for flushing dirty pages
Is there something I am missing in addition to this.
Thank you.
-- Bala
I found that filemap_datawrite_wait function can be used to write a dirty page to disk and read the updated page into memory.
-- Bala
精彩评论