]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: modify the readahead method in ra_node_page()
authorFan Li <fanofcode.li@samsung.com>
Mon, 29 Feb 2016 06:29:51 +0000 (14:29 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 18 Mar 2016 04:19:43 +0000 (21:19 -0700)
commit0a230a4a925b5b9f625c390deb392354c891cdd2
treebdaf82728ffc7db19e00bffe41353f53388f4c30
parent2a915aedb35b62fa27fa0f78d1d6e77d0ed01bd8
f2fs: modify the readahead method in ra_node_page()

ra_node_page() is used to read ahead one node page. Comparing to regular
read, it's faster because it doesn't wait for IO completion.
But if it is called twice for reading the same block, and the IO request
from the first call hasn't been completed before the second call, the second
call will have to wait until the read is over.

Here use the code in __do_page_cache_readahead() to solve this problem.
It does nothing when someone else already puts the page in mapping. The
status of page should be assured by whoever puts it there.
This implement also prevents alteration of page reference count.

Signed-off-by: Fan li <fanofcode.li@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c