The current kernel version needs these functions to be there (it will crash
if not). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7894 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -306,6 +306,52 @@ bfs_remove_vnode(void *_ns, void *_node, bool reenter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
bfs_can_page(fs_volume _fs, fs_vnode _v)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static ssize_t
|
||||||
|
bfs_read_pages(fs_volume _fs, fs_vnode _node, iovecs *vecs, off_t pos)
|
||||||
|
{
|
||||||
|
Inode *inode = (Inode *)_node;
|
||||||
|
|
||||||
|
if (!inode->HasUserAccessableStream())
|
||||||
|
RETURN_ERROR(B_BAD_VALUE);
|
||||||
|
|
||||||
|
ReadLocked locked(inode->Lock());
|
||||||
|
|
||||||
|
for (uint32 i = 0; i < vecs->num; i++) {
|
||||||
|
if (pos >= inode->Size()) {
|
||||||
|
memset(vecs->vec[i].iov_base, 0, vecs->vec[i].iov_len);
|
||||||
|
pos += vecs->vec[i].iov_len;
|
||||||
|
} else {
|
||||||
|
uint32 length = vecs->vec[i].iov_len;
|
||||||
|
if (length > inode->Size() - pos)
|
||||||
|
length = inode->Size() - pos;
|
||||||
|
|
||||||
|
inode->ReadAt(pos, (uint8 *)vecs->vec[i].iov_base, &length);
|
||||||
|
|
||||||
|
if (length < vecs->vec[i].iov_len)
|
||||||
|
memset((char *)vecs->vec[i].iov_base + length, 0, vecs->vec[i].iov_len - length);
|
||||||
|
|
||||||
|
pos += vecs->vec[i].iov_len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static ssize_t
|
||||||
|
bfs_write_pages(fs_volume _fs, fs_vnode _v, iovecs *vecs, off_t pos)
|
||||||
|
{
|
||||||
|
return EPERM;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
@@ -1952,9 +1998,9 @@ static file_system_info sBeFileSystem = {
|
|||||||
&bfs_remove_vnode, // remove_vnode
|
&bfs_remove_vnode, // remove_vnode
|
||||||
|
|
||||||
/* VM file access */
|
/* VM file access */
|
||||||
NULL,
|
&bfs_can_page,
|
||||||
NULL,
|
&bfs_read_pages,
|
||||||
NULL,
|
&bfs_write_pages,
|
||||||
|
|
||||||
&bfs_ioctl, // ioctl
|
&bfs_ioctl, // ioctl
|
||||||
&bfs_fsync, // sync
|
&bfs_fsync, // sync
|
||||||
|
|||||||
Reference in New Issue
Block a user