bfs_get_file_map() no longer returns the preallocation area as part of the
file data - it checks if the current run goes beyond the file size and cuts it off after the block containing that last few bytes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13943 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -443,6 +443,12 @@ bfs_get_file_map(fs_volume _fs, fs_vnode _node, off_t offset, size_t size,
|
|||||||
// are we already done?
|
// are we already done?
|
||||||
if (size <= vecs[index].length
|
if (size <= vecs[index].length
|
||||||
|| offset >= inode->Size()) {
|
|| offset >= inode->Size()) {
|
||||||
|
if (offset > inode->Size()) {
|
||||||
|
// make sure the extent ends with the last official file
|
||||||
|
// block (without taking any preallocations into account)
|
||||||
|
vecs[index].length = (inode->Size() - fileOffset + volume->BlockSize() - 1)
|
||||||
|
& ~(volume->BlockSize() - 1);
|
||||||
|
}
|
||||||
*_count = index + 1;
|
*_count = index + 1;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user