From 8aaab01e1dbc69170776b8b9a0917de568f8eb21 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 12 Apr 2014 15:42:34 -0700 Subject: [PATCH] Made preloadFileStat/preloadCache actually work for FileBackendMultiWrite * Previously the path substitution did not take place Change-Id: I58ad3e2aa44a2b08f4c6bad1a783fb92ea79dbf4 --- includes/filebackend/FileBackend.php | 6 ++---- includes/filebackend/FileBackendMultiWrite.php | 8 +++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index 716ab6e449..c75972562c 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -1196,8 +1196,7 @@ abstract class FileBackend { * * @param array $paths Storage paths */ - public function preloadCache( array $paths ) { - } + abstract public function preloadCache( array $paths ); /** * Invalidate any in-process file stat and property cache. @@ -1207,8 +1206,7 @@ abstract class FileBackend { * * @param array $paths Storage paths (optional) */ - public function clearCache( array $paths = null ) { - } + abstract public function clearCache( array $paths = null ); /** * Preload file stat information (concurrently if possible) into in-process cache. diff --git a/includes/filebackend/FileBackendMultiWrite.php b/includes/filebackend/FileBackendMultiWrite.php index f00ef65e1d..c39bbaf40e 100644 --- a/includes/filebackend/FileBackendMultiWrite.php +++ b/includes/filebackend/FileBackendMultiWrite.php @@ -662,8 +662,14 @@ class FileBackendMultiWrite extends FileBackend { } } + public function preloadCache( array $paths ) { + $realPaths = $this->substPaths( $paths, $this->backends[$this->masterIndex] ); + $this->backends[$this->masterIndex]->preloadCache( $realPaths ); + } + public function preloadFileStat( array $params ) { - $this->backends[$this->masterIndex]->preloadFileStat( $params ); + $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] ); + $this->backends[$this->masterIndex]->preloadFileStat( $realParams ); } public function getScopedLocksForOps( array $ops, Status $status ) { -- 2.20.1