@@ -265,24 +265,22 @@ static int cachefiles_read_backing_file_one(struct cachefiles_object *object,
265
265
goto nomem_monitor ;
266
266
}
267
267
268
- ret = add_to_page_cache (newpage , bmapping ,
269
- netpage -> index , cachefiles_gfp );
268
+ ret = add_to_page_cache_lru (newpage , bmapping ,
269
+ netpage -> index , cachefiles_gfp );
270
270
if (ret == 0 )
271
271
goto installed_new_backing_page ;
272
272
if (ret != - EEXIST )
273
273
goto nomem_page ;
274
274
}
275
275
276
- /* we've installed a new backing page, so now we need to add it
277
- * to the LRU list and start it reading */
276
+ /* we've installed a new backing page, so now we need to start
277
+ * it reading */
278
278
installed_new_backing_page :
279
279
_debug ("- new %p" , newpage );
280
280
281
281
backpage = newpage ;
282
282
newpage = NULL ;
283
283
284
- lru_cache_add_file (backpage );
285
-
286
284
read_backing_page :
287
285
ret = bmapping -> a_ops -> readpage (NULL , backpage );
288
286
if (ret < 0 )
@@ -510,24 +508,23 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,
510
508
goto nomem ;
511
509
}
512
510
513
- ret = add_to_page_cache (newpage , bmapping ,
514
- netpage -> index , cachefiles_gfp );
511
+ ret = add_to_page_cache_lru (newpage , bmapping ,
512
+ netpage -> index ,
513
+ cachefiles_gfp );
515
514
if (ret == 0 )
516
515
goto installed_new_backing_page ;
517
516
if (ret != - EEXIST )
518
517
goto nomem ;
519
518
}
520
519
521
- /* we've installed a new backing page, so now we need to add it
522
- * to the LRU list and start it reading */
520
+ /* we've installed a new backing page, so now we need
521
+ * to start it reading */
523
522
installed_new_backing_page :
524
523
_debug ("- new %p" , newpage );
525
524
526
525
backpage = newpage ;
527
526
newpage = NULL ;
528
527
529
- lru_cache_add_file (backpage );
530
-
531
528
reread_backing_page :
532
529
ret = bmapping -> a_ops -> readpage (NULL , backpage );
533
530
if (ret < 0 )
@@ -538,8 +535,8 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,
538
535
monitor_backing_page :
539
536
_debug ("- monitor add" );
540
537
541
- ret = add_to_page_cache (netpage , op -> mapping , netpage -> index ,
542
- cachefiles_gfp );
538
+ ret = add_to_page_cache_lru (netpage , op -> mapping ,
539
+ netpage -> index , cachefiles_gfp );
543
540
if (ret < 0 ) {
544
541
if (ret == - EEXIST ) {
545
542
page_cache_release (netpage );
@@ -549,8 +546,6 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,
549
546
goto nomem ;
550
547
}
551
548
552
- lru_cache_add_file (netpage );
553
-
554
549
/* install a monitor */
555
550
page_cache_get (netpage );
556
551
monitor -> netfs_page = netpage ;
@@ -613,8 +608,8 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,
613
608
backing_page_already_uptodate :
614
609
_debug ("- uptodate" );
615
610
616
- ret = add_to_page_cache (netpage , op -> mapping , netpage -> index ,
617
- cachefiles_gfp );
611
+ ret = add_to_page_cache_lru (netpage , op -> mapping ,
612
+ netpage -> index , cachefiles_gfp );
618
613
if (ret < 0 ) {
619
614
if (ret == - EEXIST ) {
620
615
page_cache_release (netpage );
@@ -631,8 +626,6 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,
631
626
632
627
fscache_mark_page_cached (op , netpage );
633
628
634
- lru_cache_add_file (netpage );
635
-
636
629
/* the netpage is unlocked and marked up to date here */
637
630
fscache_end_io (op , netpage , 0 );
638
631
page_cache_release (netpage );
0 commit comments