소스 검색

[PATCH] splice: call handle_ra_miss() on failure to lookup page

Notify the readahead logic of the missing page. Suggested by
Oleg Nesterov.

Signed-off-by: Jens Axboe <axboe@suse.de>
Jens Axboe 19 년 전
부모
커밋
e27dedd84c
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      fs/splice.c

+ 6 - 0
fs/splice.c

@@ -301,6 +301,12 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
 		 */
 		 */
 		page = find_get_page(mapping, index);
 		page = find_get_page(mapping, index);
 		if (!page) {
 		if (!page) {
+			/*
+			 * Make sure the read-ahead engine is notified
+			 * about this failure.
+			 */
+			handle_ra_miss(mapping, &in->f_ra, index);
+
 			/*
 			/*
 			 * page didn't exist, allocate one.
 			 * page didn't exist, allocate one.
 			 */
 			 */