-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmaster.cpp
More file actions
29 lines (22 loc) · 798 Bytes
/
master.cpp
File metadata and controls
29 lines (22 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* Copyright (c) 2022 Light Labs Inc.
* All Rights Reserved
* Licensed under the MIT license.
*/
#include "master.h"
CHS CHS::empty( 0, 0, 0 );
CHS CHS::start( 0, 0, 1 );
CHS CHS::limit( 1023, 254, 63 );
CHS CHS::fromLBA( blkcnt_t blkid ) { return blkid > limit.vgeom() ? limit : CHS( blkid ); }
FixedDisk::FixedDisk( char type, blkcnt_t offset )
: status( 0x80 )
, start( offset )
, fs( type )
, lbaStart( offset ) {}
void FixedDisk::setSectorCount( blkcnt_t size )
{
lbaCount = size;
end = CHS::fromLBA( lbaStart + lbaCount ); // FIXME use setters and ctors
}
void FixedDisk::setByteEnd( off64_t size ) { setSectorCount( ( size / Blocks::MAPPER_BS ) - lbaStart ); }
void FixedDisk::setEnd( blkcnt_t blocks, blksize_t blkSz ) { setByteEnd( blocks * blkSz ); }