* Since the file cache can access any kind of data (and not just file data),

we must use {read|write}_pages() instead of {read|write}().
* This should fix accessing other file systems than BFS (ie. those that doesn't
  have an io() function) like ext3 and FAT.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27088 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-08-20 20:22:06 +00:00
parent 1a8eb15993
commit 7a253cf5fe
1 changed files with 9 additions and 3 deletions

View File

@ -166,10 +166,16 @@ public:
protected:
virtual status_t InternalIO(off_t offset, void* buffer, size_t* length)
{
if (fWrite)
return FS_CALL(fVnode, write, fCookie, offset, buffer, length);
iovec vec;
vec.iov_base = buffer;
vec.iov_len = *length;
return FS_CALL(fVnode, read, fCookie, offset, buffer, length);
if (fWrite) {
return FS_CALL(fVnode, write_pages, fCookie, offset, &vec, 1,
length);
}
return FS_CALL(fVnode, read_pages, fCookie, offset, &vec, 1, length);
}
private: