BufferPool::ReleaseBuffers() didn't set fFirstFree correctly.

Setting uncached access to a file no longer returns an error (if it succeeds).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@716 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2002-08-12 16:55:12 +00:00
parent ee77e6d68f
commit e238bce6f5
2 changed files with 7 additions and 3 deletions

View File

@ -102,6 +102,7 @@ BufferPool::ReleaseBuffers()
free(buffer);
buffer = nextBuffer;
}
fFirstFree = buffer;
release_sem(fLock);
}

View File

@ -525,13 +525,16 @@ bfs_ioctl(void *_ns, void *_node, void *_cookie, int cmd, void *buffer, size_t b
switch (cmd) {
case IOCTL_FILE_UNCACHED_IO:
{
if (inode == NULL)
return B_BAD_VALUE;
// if the inode is already set up for uncached access, bail out
if (inode->Flags() & INODE_NO_CACHE) {
FATAL(("File %Ld is already uncached\n", inode->ID()));
return B_ERROR;
}
if (inode != NULL)
PRINT(("trying to make access to inode %Ld uncached. Not yet implemented!\n",inode->ID()));
PRINT(("uncached access to inode %Ld\n", inode->ID()));
// ToDo: sync the cache for this file!
// Unfortunately, we can't remove any blocks from the cache in BeOS,
@ -543,7 +546,7 @@ bfs_ioctl(void *_ns, void *_node, void *_cookie, int cmd, void *buffer, size_t b
status_t status = volume->Pool().RequestBuffers(volume->BlockSize());
if (status == B_OK)
inode->Node()->flags |= INODE_NO_CACHE;
return B_ERROR;
return status;
}
#ifdef DEBUG
case 56742: