コード例 #1
0
ファイル: Inode.cpp プロジェクト: SummerSnail2014/haiku
status_t 
Inode::FindBlockRun(off_t pos, block_run &run, off_t &offset)
{
	// the whole file data is covered by this one block_run structure...
	run.SetTo(0,0,1);
	offset = 0;
	return B_OK;
}
コード例 #2
0
ファイル: bfs.cpp プロジェクト: SummerSnail2014/haiku
status_t
Volume::ValidateBlockRun(block_run run)
{
	if (run.AllocationGroup() < 0 || run.AllocationGroup() > (int32)AllocationGroups()
		|| run.Start() > (1UL << AllocationGroupShift())
		|| run.length == 0
		|| uint32(run.Length() + run.Start()) > (1UL << AllocationGroupShift())) {
		dprintf("bfs: invalid run(%ld,%d,%d)\n", run.AllocationGroup(), run.Start(), run.Length());
		return B_BAD_DATA;
	}
	return B_OK;
}
コード例 #3
0
ファイル: Volume.cpp プロジェクト: Sylvain78/haiku
status_t
Volume::ValidateBlockRun(block_run run)
{
	if (run.AllocationGroup() < 0
		|| run.AllocationGroup() > (int32)AllocationGroups()
		|| run.Start() > (1UL << AllocationGroupShift())
		|| run.length == 0
		|| uint32(run.Length() + run.Start())
				> (1UL << AllocationGroupShift())) {
		Panic();
		FATAL(("*** invalid run(%d,%d,%d)\n", (int)run.AllocationGroup(),
			run.Start(), run.Length()));
		return B_BAD_DATA;
	}
	return B_OK;
}