From aff0fbbe57480a2d6cc6f375444e760c838abbab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 28 Apr 2009 08:03:39 +0000 Subject: [PATCH] axeld: * vfs_read_pages_async() must not be called with locked cache, since it cannot be guaranteed that the operation will be performed asynchronously. (The ISO9660 FS for example does not implement the new IO hooks... yet.) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30476 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/cache/file_cache.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/cache/file_cache.cpp b/src/system/kernel/cache/file_cache.cpp index 7ef3966d8b..cc7960d7fc 100644 --- a/src/system/kernel/cache/file_cache.cpp +++ b/src/system/kernel/cache/file_cache.cpp @@ -154,7 +154,9 @@ PrecacheIO::Init() } -//! Cache has to be locked when calling this method. +/*! Cache has to be locked when calling this method, but it will be temporarily + unlocked during execution. +*/ status_t PrecacheIO::Start() { @@ -185,8 +187,14 @@ PrecacheIO::Start() return B_NO_MEMORY; } - return vfs_asynchronous_read_pages(fRef->vnode, NULL, fOffset, fVecs, - vecCount, fSize, B_PHYSICAL_IO_REQUEST, this); + fCache->Unlock(); + + status_t status = vfs_asynchronous_read_pages(fRef->vnode, NULL, fOffset, + fVecs, vecCount, fSize, B_PHYSICAL_IO_REQUEST, this); + + fCache->Lock(); + + return status; }