Now makes use of the new block_cache_etc() function to sync data streams without a file cache attached.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20812 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
5c03270bea
commit
1d63cfdc5b
|
@ -2027,6 +2027,7 @@ Inode::Free(Transaction &transaction)
|
|||
}
|
||||
|
||||
|
||||
//! Synchronizes (writes back to disk) the file stream of the inode.
|
||||
status_t
|
||||
Inode::Sync()
|
||||
{
|
||||
|
@ -2045,8 +2046,8 @@ Inode::Sync()
|
|||
if (data->direct[i].IsZero())
|
||||
return B_OK;
|
||||
|
||||
// status = flush_blocks(fVolume->Device(), fVolume->ToBlock(data->direct[i]),
|
||||
// data->direct[i].Length());
|
||||
status = block_cache_sync_etc(fVolume->BlockCache(),
|
||||
fVolume->ToBlock(data->direct[i]), data->direct[i].Length());
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
}
|
||||
|
@ -2069,7 +2070,8 @@ Inode::Sync()
|
|||
if (runs[i].IsZero())
|
||||
return B_OK;
|
||||
|
||||
// status = flush_blocks(fVolume->Device(), fVolume->ToBlock(runs[i]), runs[i].Length());
|
||||
status = block_cache_sync_etc(fVolume->BlockCache(),
|
||||
fVolume->ToBlock(runs[i]), runs[i].Length());
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
}
|
||||
|
@ -2103,10 +2105,10 @@ Inode::Sync()
|
|||
if (runs[i].IsZero())
|
||||
return B_OK;
|
||||
|
||||
// ToDo: combine single block_runs to bigger ones when
|
||||
// TODO: combine single block_runs to bigger ones when
|
||||
// they are adjacent
|
||||
// status = flush_blocks(fVolume->Device(), fVolume->ToBlock(runs[i]),
|
||||
// runs[i].Length());
|
||||
status = block_cache_sync_etc(fVolume->BlockCache(),
|
||||
fVolume->ToBlock(runs[i]), runs[i].Length());
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue