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:
Axel Dörfler
2007-04-25 12:11:21 +00:00
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 status_t
Inode::Sync() Inode::Sync()
{ {
@@ -2045,8 +2046,8 @@ Inode::Sync()
if (data->direct[i].IsZero()) if (data->direct[i].IsZero())
return B_OK; return B_OK;
// status = flush_blocks(fVolume->Device(), fVolume->ToBlock(data->direct[i]), status = block_cache_sync_etc(fVolume->BlockCache(),
// data->direct[i].Length()); fVolume->ToBlock(data->direct[i]), data->direct[i].Length());
if (status != B_OK) if (status != B_OK)
return status; return status;
} }
@@ -2069,7 +2070,8 @@ Inode::Sync()
if (runs[i].IsZero()) if (runs[i].IsZero())
return B_OK; 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) if (status != B_OK)
return status; return status;
} }
@@ -2103,10 +2105,10 @@ Inode::Sync()
if (runs[i].IsZero()) if (runs[i].IsZero())
return B_OK; return B_OK;
// ToDo: combine single block_runs to bigger ones when // TODO: combine single block_runs to bigger ones when
// they are adjacent // they are adjacent
// status = flush_blocks(fVolume->Device(), fVolume->ToBlock(runs[i]), status = block_cache_sync_etc(fVolume->BlockCache(),
// runs[i].Length()); fVolume->ToBlock(runs[i]), runs[i].Length());
if (status != B_OK) if (status != B_OK)
return status; return status;
} }