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:
parent
4430d71191
commit
65af8c8327
@ -443,6 +443,12 @@ bfs_get_file_map(fs_volume _fs, fs_vnode _node, off_t offset, size_t size,
|
||||
// are we already done?
|
||||
if (size <= vecs[index].length
|
||||
|| 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;
|
||||
return B_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user