Thanks for pointing out the reason for the extra reference.
Here's my present understanding of page->count (on file I/O is):
* one reference for the page being allocated ( != free)
* one reference for the page being associated with I/O
(has bufferheads associated with it)
* one reference for being in the page cache.
The first reference is immediately dropped after its use
in generic_file_read(), after the data has been copied to user.
The last reference can be dropped by invalidate_inode_pages(),
which leaves one reference (for the buffers) as you point out.
Now truncate_inode_pages() removes the buffers associated with
a page (through block_flushpage()), so if i use
truncate_inode_pages(inode, 0) will that remove the page
from the page cache, remove the buffers & free the page to
the system wide free pool?
regards,
ananth.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/