• Fan Li's avatar
    f2fs: modify the readahead method in ra_node_page() · 999270de
    Fan Li authored
    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: default avatarFan li <fanofcode.li@samsung.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    999270de
node.c 53.1 KB