readahead: move synchronous readahead call out of splice loop
authorFengguang Wu <wfg@mail.ustc.edu.cn>
Thu, 19 Jul 2007 08:48:05 +0000 (01:48 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 19 Jul 2007 17:04:44 +0000 (10:04 -0700)
commit431a4820bfcdf7ff530e745230bafb06c9bf2d6d
tree0b2396609deec8da5697979bce4c8ee18af254e6
parentc743d96b6d2ff55a94df7b5ac7c74987bb9c343b
readahead: move synchronous readahead call out of splice loop

Move synchronous page_cache_readahead_ondemand() call out of splice loop.

This avoids one pointless page allocation/insertion in case of non-zero
ra_pages, or many pointless readahead calls in case of zero ra_pages.

Note that if a user sets ra_pages to less than PIPE_BUFFERS=16 pages, he will
not get expected readahead behavior anyway.  The splice code works in batches
of 16 pages, which can be taken as another form of synchronous readahead.

Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/splice.c