btrfs: fixes 64 bit warnings
This commit is contained in:
parent
a1566b06b7
commit
267a780ab5
@ -162,8 +162,8 @@ Attribute::_Lookup(const char* name, size_t nameLength,
|
|||||||
status_t status = fInode->GetVolume()->FSTree()->FindExact(key,
|
status_t status = fInode->GetVolume()->FSTree()->FindExact(key,
|
||||||
(void**)&entries, &length);
|
(void**)&entries, &length);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
TRACE("AttributeIterator::Lookup(): Couldn't find entry with hash %lu "
|
TRACE("AttributeIterator::Lookup(): Couldn't find entry with hash %"
|
||||||
"\"%s\"\n", hash, name);
|
B_PRIu32 " \"%s\"\n", hash, name);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,14 +89,14 @@ status_t
|
|||||||
BPlusTree::_Find(struct btrfs_key &key, void** _value, size_t* _size,
|
BPlusTree::_Find(struct btrfs_key &key, void** _value, size_t* _size,
|
||||||
bplustree_traversing type)
|
bplustree_traversing type)
|
||||||
{
|
{
|
||||||
TRACE("Find() objectid %lld type %d offset %lld \n", key.ObjectID(),
|
TRACE("Find() objectid %" B_PRId64 " type %d offset %" B_PRId64 " \n",
|
||||||
key.Type(), key.Offset());
|
key.ObjectID(), key.Type(), key.Offset());
|
||||||
btrfs_stream *stream = fStream;
|
btrfs_stream *stream = fStream;
|
||||||
CachedBlock cached(fVolume);
|
CachedBlock cached(fVolume);
|
||||||
fsblock_t physical;
|
fsblock_t physical;
|
||||||
if (stream == NULL) {
|
if (stream == NULL) {
|
||||||
if (fVolume->FindBlock(fRootBlock, physical) != B_OK) {
|
if (fVolume->FindBlock(fRootBlock, physical) != B_OK) {
|
||||||
ERROR("Find() unmapped block %lld\n", fRootBlock);
|
ERROR("Find() unmapped block %" B_PRId64 "\n", fRootBlock);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
stream = (btrfs_stream *)cached.SetTo(physical);
|
stream = (btrfs_stream *)cached.SetTo(physical);
|
||||||
@ -107,19 +107,19 @@ BPlusTree::_Find(struct btrfs_key &key, void** _value, size_t* _size,
|
|||||||
uint32 i = 1;
|
uint32 i = 1;
|
||||||
for (; i < stream->header.ItemCount(); i++) {
|
for (; i < stream->header.ItemCount(); i++) {
|
||||||
int32 comp = _CompareKeys(stream->index[i].key, key);
|
int32 comp = _CompareKeys(stream->index[i].key, key);
|
||||||
TRACE("Find() found index %ld at %lld comp %ld\n", i,
|
TRACE("Find() found index %" B_PRIu32 " at %" B_PRId64 " comp %"
|
||||||
stream->index[i].BlockNum(), comp);
|
B_PRId32 "\n", i, stream->index[i].BlockNum(), comp);
|
||||||
if (comp < 0)
|
if (comp < 0)
|
||||||
continue;
|
continue;
|
||||||
if (comp > 0 || type == BPLUSTREE_BACKWARD)
|
if (comp > 0 || type == BPLUSTREE_BACKWARD)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
TRACE("Find() getting index %ld at %lld\n", i - 1,
|
TRACE("Find() getting index %" B_PRIu32 " at %" B_PRId64 "\n", i - 1,
|
||||||
stream->index[i - 1].BlockNum());
|
stream->index[i - 1].BlockNum());
|
||||||
|
|
||||||
if (fVolume->FindBlock(stream->index[i - 1].BlockNum(), physical)
|
if (fVolume->FindBlock(stream->index[i - 1].BlockNum(), physical)
|
||||||
!= B_OK) {
|
!= B_OK) {
|
||||||
ERROR("Find() unmapped block %lld\n",
|
ERROR("Find() unmapped block %" B_PRId64 "\n",
|
||||||
stream->index[i - 1].BlockNum());
|
stream->index[i - 1].BlockNum());
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
@ -128,18 +128,19 @@ BPlusTree::_Find(struct btrfs_key &key, void** _value, size_t* _size,
|
|||||||
|
|
||||||
uint32 i;
|
uint32 i;
|
||||||
#ifdef TRACE_BTRFS
|
#ifdef TRACE_BTRFS
|
||||||
TRACE("Find() dump count %ld\n", stream->header.ItemCount());
|
TRACE("Find() dump count %" B_PRId32 "\n", stream->header.ItemCount());
|
||||||
for (i = 0; i < stream->header.ItemCount(); i++) {
|
for (i = 0; i < stream->header.ItemCount(); i++) {
|
||||||
int32 comp = _CompareKeys(key, stream->entries[i].key);
|
int32 comp = _CompareKeys(key, stream->entries[i].key);
|
||||||
TRACE("Find() dump %ld %ld offset %lld comp %ld\n",
|
TRACE("Find() dump %" B_PRIu32 " %" B_PRIu32 " offset %" B_PRId64
|
||||||
stream->entries[i].Offset(),
|
" comp %" B_PRId32 "\n", stream->entries[i].Offset(),
|
||||||
stream->entries[i].Size(), stream->entries[i].key.Offset(), comp);
|
stream->entries[i].Size(), stream->entries[i].key.Offset(), comp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < stream->header.ItemCount(); i++) {
|
for (i = 0; i < stream->header.ItemCount(); i++) {
|
||||||
int32 comp = _CompareKeys(key, stream->entries[i].key);
|
int32 comp = _CompareKeys(key, stream->entries[i].key);
|
||||||
TRACE("Find() found %ld %ld oid %lld type %d offset %lld comp %ld\n",
|
TRACE("Find() found %" B_PRIu32 " %" B_PRIu32 " oid %" B_PRId64
|
||||||
|
" type %d offset %" B_PRId64 " comp %" B_PRId32 "\n",
|
||||||
stream->entries[i].Offset(), stream->entries[i].Size(),
|
stream->entries[i].Offset(), stream->entries[i].Size(),
|
||||||
stream->entries[i].key.ObjectID(), stream->entries[i].key.Type(),
|
stream->entries[i].key.ObjectID(), stream->entries[i].key.Type(),
|
||||||
stream->entries[i].key.Offset(), comp);
|
stream->entries[i].key.Offset(), comp);
|
||||||
@ -163,8 +164,8 @@ BPlusTree::_Find(struct btrfs_key &key, void** _value, size_t* _size,
|
|||||||
|
|
||||||
if (i < stream->header.ItemCount()
|
if (i < stream->header.ItemCount()
|
||||||
&& stream->entries[i].key.Type() == key.Type()) {
|
&& stream->entries[i].key.Type() == key.Type()) {
|
||||||
TRACE("Find() found %ld %ld\n", stream->entries[i].Offset(),
|
TRACE("Find() found %" B_PRIu32 " %" B_PRIu32 "\n",
|
||||||
stream->entries[i].Size());
|
stream->entries[i].Offset(), stream->entries[i].Size());
|
||||||
if (_value != NULL) {
|
if (_value != NULL) {
|
||||||
*_value = malloc(stream->entries[i].Size());
|
*_value = malloc(stream->entries[i].Size());
|
||||||
memcpy(*_value, ((uint8 *)&stream->entries[0]
|
memcpy(*_value, ((uint8 *)&stream->entries[0]
|
||||||
@ -178,7 +179,8 @@ BPlusTree::_Find(struct btrfs_key &key, void** _value, size_t* _size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TRACE("Find() not found %lld %lld\n", key.Offset(), key.ObjectID());
|
TRACE("Find() not found %" B_PRId64 " %" B_PRId64 "\n", key.Offset(),
|
||||||
|
key.ObjectID());
|
||||||
|
|
||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
@ -35,13 +35,15 @@ Chunk::Chunk(struct btrfs_chunk* chunk, fsblock_t offset)
|
|||||||
memcpy(fChunk, chunk, sizeof(struct btrfs_chunk)
|
memcpy(fChunk, chunk, sizeof(struct btrfs_chunk)
|
||||||
+ chunk->StripeCount() * sizeof(struct btrfs_stripe));
|
+ chunk->StripeCount() * sizeof(struct btrfs_stripe));
|
||||||
|
|
||||||
TRACE("chunk[0] length %llu owner %llu stripe_length %llu type %llu "
|
TRACE("chunk[0] length %" B_PRIu64 " owner %" B_PRIu64 " stripe_length %"
|
||||||
"stripe_count %u sub_stripes %u sector_size %lu\n", chunk->Length(),
|
B_PRIu64 " type %" B_PRIu64 " stripe_count %u sub_stripes %u "
|
||||||
chunk->Owner(), chunk->StripeLength(), chunk->Type(),
|
"sector_size %" B_PRIu32 "\n", chunk->Length(), chunk->Owner(),
|
||||||
chunk->StripeCount(), chunk->SubStripes(), chunk->SectorSize());
|
chunk->StripeLength(), chunk->Type(), chunk->StripeCount(),
|
||||||
|
chunk->SubStripes(), chunk->SectorSize());
|
||||||
for(int32 i = 0; i < chunk->StripeCount(); i++) {
|
for(int32 i = 0; i < chunk->StripeCount(); i++) {
|
||||||
TRACE("chunk.stripe[%ld].physical %lld deviceid %lld\n", i,
|
TRACE("chunk.stripe[%" B_PRId32 "].physical %" B_PRId64 " deviceid %"
|
||||||
chunk->stripes[i].Offset(), chunk->stripes[i].DeviceID());
|
B_PRId64 "\n", i, chunk->stripes[i].Offset(),
|
||||||
|
chunk->stripes[i].DeviceID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,8 +68,8 @@ Chunk::FindBlock(off_t logical, off_t &physical)
|
|||||||
if (fChunk == NULL)
|
if (fChunk == NULL)
|
||||||
return B_NO_INIT;
|
return B_NO_INIT;
|
||||||
|
|
||||||
if (logical < fChunkOffset
|
if (logical < (off_t)fChunkOffset
|
||||||
|| logical > (fChunkOffset + fChunk->Length()))
|
|| logical > (off_t)(fChunkOffset + fChunk->Length()))
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
// only one stripe
|
// only one stripe
|
||||||
|
@ -132,8 +132,8 @@ DirectoryIterator::Lookup(const char* name, size_t nameLength, ino_t* _id)
|
|||||||
status_t status = fInode->GetVolume()->FSTree()->FindExact(key,
|
status_t status = fInode->GetVolume()->FSTree()->FindExact(key,
|
||||||
(void**)&entries, &length);
|
(void**)&entries, &length);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
TRACE("DirectoryIterator::Lookup(): Couldn't find entry with hash %lu "
|
TRACE("DirectoryIterator::Lookup(): Couldn't find entry with hash %" B_PRIu32
|
||||||
"\"%s\"\n", hash, name);
|
" \"%s\"\n", hash, name);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,6 @@ Inode::CheckPermissions(int accessMode) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (accessMode & ~permissions) == 0 ? B_OK : B_NOT_ALLOWED;
|
return (accessMode & ~permissions) == 0 ? B_OK : B_NOT_ALLOWED;
|
||||||
return B_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -149,12 +148,13 @@ Inode::FindBlock(off_t pos, off_t& physical, off_t *_length)
|
|||||||
status_t status = fVolume->FSTree()->FindPrevious(search_key,
|
status_t status = fVolume->FSTree()->FindPrevious(search_key,
|
||||||
(void**)&extent_data);
|
(void**)&extent_data);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
ERROR("Inode::FindBlock(): Couldn't find extent_data 0x%lx\n", status);
|
ERROR("Inode::FindBlock(): Couldn't find extent_data 0x%" B_PRIx32
|
||||||
|
"\n", status);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Inode::FindBlock(%" B_PRIdINO ") key.Offset() %lld\n", ID(),
|
TRACE("Inode::FindBlock(%" B_PRIdINO ") key.Offset() %" B_PRId64 "\n",
|
||||||
search_key.Offset());
|
ID(), search_key.Offset());
|
||||||
|
|
||||||
off_t diff = pos - search_key.Offset();
|
off_t diff = pos - search_key.Offset();
|
||||||
off_t logical = 0;
|
off_t logical = 0;
|
||||||
@ -165,8 +165,8 @@ Inode::FindBlock(off_t pos, off_t& physical, off_t *_length)
|
|||||||
status = fVolume->FindBlock(logical, physical);
|
status = fVolume->FindBlock(logical, physical);
|
||||||
if (_length != NULL)
|
if (_length != NULL)
|
||||||
*_length = extent_data->Size() - diff;
|
*_length = extent_data->Size() - diff;
|
||||||
TRACE("Inode::FindBlock(%" B_PRIdINO ") %lld physical %lld\n", ID(),
|
TRACE("Inode::FindBlock(%" B_PRIdINO ") %" B_PRIdOFF " physical %"
|
||||||
pos, physical);
|
B_PRIdOFF "\n", ID(), pos, physical);
|
||||||
|
|
||||||
free(extent_data);
|
free(extent_data);
|
||||||
return status;
|
return status;
|
||||||
@ -180,14 +180,14 @@ Inode::ReadAt(off_t pos, uint8* buffer, size_t* _length)
|
|||||||
|
|
||||||
// set/check boundaries for pos/length
|
// set/check boundaries for pos/length
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
ERROR("inode %" B_PRIdINO ": ReadAt failed(pos %lld, length %lu)\n",
|
ERROR("inode %" B_PRIdINO ": ReadAt failed(pos %" B_PRIdOFF
|
||||||
ID(), pos, length);
|
", length %lu)\n", ID(), pos, length);
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pos >= Size() || length == 0) {
|
if (pos >= Size() || length == 0) {
|
||||||
TRACE("inode %" B_PRIdINO ": ReadAt 0 (pos %lld, length %lu)\n",
|
TRACE("inode %" B_PRIdINO ": ReadAt 0 (pos %" B_PRIdOFF
|
||||||
ID(), pos, length);
|
", length %lu)\n", ID(), pos, length);
|
||||||
*_length = 0;
|
*_length = 0;
|
||||||
return B_NO_ERROR;
|
return B_NO_ERROR;
|
||||||
}
|
}
|
||||||
@ -204,14 +204,15 @@ Inode::ReadAt(off_t pos, uint8* buffer, size_t* _length)
|
|||||||
status_t status = fVolume->FSTree()->FindPrevious(search_key,
|
status_t status = fVolume->FSTree()->FindPrevious(search_key,
|
||||||
(void**)&extent_data, &item_size);
|
(void**)&extent_data, &item_size);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
ERROR("Inode::FindBlock(): Couldn't find extent_data 0x%lx\n", status);
|
ERROR("Inode::FindBlock(): Couldn't find extent_data 0x%" B_PRIx32
|
||||||
|
"\n", status);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 compression = extent_data->Compression();
|
uint8 compression = extent_data->Compression();
|
||||||
if (FileCache() != NULL
|
if (FileCache() != NULL
|
||||||
&& extent_data->Type() == BTRFS_EXTENT_DATA_REGULAR) {
|
&& extent_data->Type() == BTRFS_EXTENT_DATA_REGULAR) {
|
||||||
TRACE("inode %" B_PRIdINO ": ReadAt cache (pos %lld, length %lu)\n",
|
TRACE("inode %" B_PRIdINO ": ReadAt cache (pos %" B_PRIdOFF ", length %lu)\n",
|
||||||
ID(), pos, length);
|
ID(), pos, length);
|
||||||
free(extent_data);
|
free(extent_data);
|
||||||
if (compression == BTRFS_EXTENT_COMPRESS_NONE)
|
if (compression == BTRFS_EXTENT_COMPRESS_NONE)
|
||||||
@ -222,7 +223,7 @@ Inode::ReadAt(off_t pos, uint8* buffer, size_t* _length)
|
|||||||
panic("unknown extent compression; %d\n", compression);
|
panic("unknown extent compression; %d\n", compression);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Inode::ReadAt(%" B_PRIdINO ") key.Offset() %lld\n", ID(),
|
TRACE("Inode::ReadAt(%" B_PRIdINO ") key.Offset() %" B_PRId64 "\n", ID(),
|
||||||
search_key.Offset());
|
search_key.Offset());
|
||||||
|
|
||||||
off_t diff = pos - search_key.Offset();
|
off_t diff = pos - search_key.Offset();
|
||||||
@ -256,8 +257,8 @@ Inode::ReadAt(off_t pos, uint8* buffer, size_t* _length)
|
|||||||
size_t inline_size = item_size - 13;
|
size_t inline_size = item_size - 13;
|
||||||
bool headerRead = false;
|
bool headerRead = false;
|
||||||
|
|
||||||
TRACE("Inode::ReadAt(%" B_PRIdINO ") diff %lld size %ld\n", ID(),
|
TRACE("Inode::ReadAt(%" B_PRIdINO ") diff %" B_PRIdOFF " size %"
|
||||||
diff, item_size);
|
B_PRIuSIZE "\n", ID(), diff, item_size);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
ssize_t bytesRead = min_c(sizeof(in), inline_size - offset);
|
ssize_t bytesRead = min_c(sizeof(in), inline_size - offset);
|
||||||
|
@ -278,14 +278,15 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fBlockSize = fSuperBlock.BlockSize();
|
fBlockSize = fSuperBlock.BlockSize();
|
||||||
TRACE("block size %ld\n", fBlockSize);
|
TRACE("block size %" B_PRIu32 "\n", fBlockSize);
|
||||||
|
|
||||||
uint8* start = (uint8*)&fSuperBlock.system_chunk_array[0];
|
uint8* start = (uint8*)&fSuperBlock.system_chunk_array[0];
|
||||||
uint8* end = (uint8*)&fSuperBlock.system_chunk_array[2048];
|
uint8* end = (uint8*)&fSuperBlock.system_chunk_array[2048];
|
||||||
while (start < end) {
|
while (start < end) {
|
||||||
struct btrfs_key* key = (struct btrfs_key*)start;
|
struct btrfs_key* key = (struct btrfs_key*)start;
|
||||||
TRACE("system_chunk_array object_id 0x%llx offset 0x%llx type 0x%x\n",
|
TRACE("system_chunk_array object_id 0x%" B_PRIx64 " offset 0x%"
|
||||||
key->ObjectID(), key->Offset(), key->Type());
|
B_PRIx64 " type 0x%x\n", key->ObjectID(), key->Offset(),
|
||||||
|
key->Type());
|
||||||
if (key->Type() != BTRFS_KEY_TYPE_CHUNK_ITEM) {
|
if (key->Type() != BTRFS_KEY_TYPE_CHUNK_ITEM) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -297,16 +298,17 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
|||||||
start += sizeof(struct btrfs_key) + fChunk->Size();
|
start += sizeof(struct btrfs_key) + fChunk->Size();
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Volume::Mount() generation: %lld\n", fSuperBlock.Generation());
|
TRACE("Volume::Mount() generation: %" B_PRIu64 "\n",
|
||||||
|
fSuperBlock.Generation());
|
||||||
fsblock_t physical = 0;
|
fsblock_t physical = 0;
|
||||||
FindBlock(fSuperBlock.Root(), physical);
|
FindBlock(fSuperBlock.Root(), physical);
|
||||||
TRACE("Volume::Mount() root: %lld (physical %lld)\n",
|
TRACE("Volume::Mount() root: %" B_PRIu64 " (physical %" B_PRIu64 ")\n",
|
||||||
fSuperBlock.Root(), physical);
|
fSuperBlock.Root(), physical);
|
||||||
FindBlock(fSuperBlock.ChunkRoot(), physical);
|
FindBlock(fSuperBlock.ChunkRoot(), physical);
|
||||||
TRACE("Volume::Mount() chunk_root: %lld (physical %lld)\n",
|
TRACE("Volume::Mount() chunk_root: %" B_PRIu64 " (physical %" B_PRIu64
|
||||||
fSuperBlock.ChunkRoot(), physical);
|
")\n", fSuperBlock.ChunkRoot(), physical);
|
||||||
FindBlock(fSuperBlock.LogRoot(), physical);
|
FindBlock(fSuperBlock.LogRoot(), physical);
|
||||||
TRACE("Volume::Mount() log_root: %lld (physical %lld)\n",
|
TRACE("Volume::Mount() log_root: %" B_PRIu64 " (physical %" B_PRIu64 ")\n",
|
||||||
fSuperBlock.LogRoot(), physical);
|
fSuperBlock.LogRoot(), physical);
|
||||||
|
|
||||||
// check if the device size is large enough to hold the file system
|
// check if the device size is large enough to hold the file system
|
||||||
@ -329,13 +331,13 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
|||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
FindBlock(fSuperBlock.Root(), physical);
|
FindBlock(fSuperBlock.Root(), physical);
|
||||||
TRACE("Volume::Mount() root: %lld (physical %lld)\n",
|
TRACE("Volume::Mount() root: %" B_PRIu64 " (physical %" B_PRIu64 ")\n",
|
||||||
fSuperBlock.Root(), physical);
|
fSuperBlock.Root(), physical);
|
||||||
FindBlock(fSuperBlock.ChunkRoot(), physical);
|
FindBlock(fSuperBlock.ChunkRoot(), physical);
|
||||||
TRACE("Volume::Mount() chunk_root: %lld (physical %lld)\n",
|
TRACE("Volume::Mount() chunk_root: %" B_PRIu64 " (physical %" B_PRIu64
|
||||||
fSuperBlock.ChunkRoot(), physical);
|
")\n", fSuperBlock.ChunkRoot(), physical);
|
||||||
FindBlock(fSuperBlock.LogRoot(), physical);
|
FindBlock(fSuperBlock.LogRoot(), physical);
|
||||||
TRACE("Volume::Mount() log_root: %lld (physical %lld)\n",
|
TRACE("Volume::Mount() log_root: %" B_PRIu64 " (physical %" B_PRIu64 ")\n",
|
||||||
fSuperBlock.LogRoot(), physical);
|
fSuperBlock.LogRoot(), physical);
|
||||||
|
|
||||||
fRootTree = new(std::nothrow) BPlusTree(this, fSuperBlock.Root());
|
fRootTree = new(std::nothrow) BPlusTree(this, fSuperBlock.Root());
|
||||||
@ -351,7 +353,8 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
|||||||
ERROR("Volume::Mount(): Couldn't find extent root\n");
|
ERROR("Volume::Mount(): Couldn't find extent root\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
TRACE("Volume::Mount(): Found extent root: %lld\n", root->BlockNum());
|
TRACE("Volume::Mount(): Found extent root: %" B_PRIu64 "\n",
|
||||||
|
root->BlockNum());
|
||||||
fExtentTree = new(std::nothrow) BPlusTree(this, root->BlockNum());
|
fExtentTree = new(std::nothrow) BPlusTree(this, root->BlockNum());
|
||||||
free(root);
|
free(root);
|
||||||
if (fExtentTree == NULL)
|
if (fExtentTree == NULL)
|
||||||
@ -363,7 +366,7 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
|||||||
ERROR("Volume::Mount(): Couldn't find fs root\n");
|
ERROR("Volume::Mount(): Couldn't find fs root\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
TRACE("Volume::Mount(): Found fs root: %lld\n", root->BlockNum());
|
TRACE("Volume::Mount(): Found fs root: %" B_PRIu64 "\n", root->BlockNum());
|
||||||
fFSTree = new(std::nothrow) BPlusTree(this, root->BlockNum());
|
fFSTree = new(std::nothrow) BPlusTree(this, root->BlockNum());
|
||||||
free(root);
|
free(root);
|
||||||
if (fFSTree == NULL)
|
if (fFSTree == NULL)
|
||||||
@ -375,7 +378,8 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
|||||||
ERROR("Volume::Mount(): Couldn't find dev root\n");
|
ERROR("Volume::Mount(): Couldn't find dev root\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
TRACE("Volume::Mount(): Found dev root: %lld\n", root->BlockNum());
|
TRACE("Volume::Mount(): Found dev root: %" B_PRIu64 "\n",
|
||||||
|
root->BlockNum());
|
||||||
fDevTree = new(std::nothrow) BPlusTree(this, root->BlockNum());
|
fDevTree = new(std::nothrow) BPlusTree(this, root->BlockNum());
|
||||||
free(root);
|
free(root);
|
||||||
if (fDevTree == NULL)
|
if (fDevTree == NULL)
|
||||||
@ -387,7 +391,8 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
|||||||
ERROR("Volume::Mount(): Couldn't find checksum root\n");
|
ERROR("Volume::Mount(): Couldn't find checksum root\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
TRACE("Volume::Mount(): Found checksum root: %lld\n", root->BlockNum());
|
TRACE("Volume::Mount(): Found checksum root: %" B_PRIu64 "\n",
|
||||||
|
root->BlockNum());
|
||||||
fChecksumTree = new(std::nothrow) BPlusTree(this, root->BlockNum());
|
fChecksumTree = new(std::nothrow) BPlusTree(this, root->BlockNum());
|
||||||
free(root);
|
free(root);
|
||||||
if (fChecksumTree == NULL)
|
if (fChecksumTree == NULL)
|
||||||
@ -401,8 +406,8 @@ Volume::Mount(const char* deviceName, uint32 flags)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Volume::Mount(): Found root node: %lld (%s)\n", fRootNode->ID(),
|
TRACE("Volume::Mount(): Found root node: %" B_PRIu64 " (%s)\n",
|
||||||
strerror(fRootNode->InitCheck()));
|
fRootNode->ID(), strerror(fRootNode->InitCheck()));
|
||||||
|
|
||||||
// all went fine
|
// all went fine
|
||||||
opener.Keep();
|
opener.Keep();
|
||||||
@ -488,7 +493,8 @@ status_t
|
|||||||
Volume::FindBlock(off_t logical, off_t &physical)
|
Volume::FindBlock(off_t logical, off_t &physical)
|
||||||
{
|
{
|
||||||
if (fChunkTree == NULL
|
if (fChunkTree == NULL
|
||||||
|| (logical >= fChunk->Offset() && logical < fChunk->End())) {
|
|| (logical >= (off_t)fChunk->Offset()
|
||||||
|
&& logical < (off_t)fChunk->End())) {
|
||||||
// try with fChunk
|
// try with fChunk
|
||||||
return fChunk->FindBlock(logical, physical);
|
return fChunk->FindBlock(logical, physical);
|
||||||
}
|
}
|
||||||
@ -509,8 +515,8 @@ Volume::FindBlock(off_t logical, off_t &physical)
|
|||||||
status = _chunk.FindBlock(logical, physical);
|
status = _chunk.FindBlock(logical, physical);
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
TRACE("Volume::FindBlock(): logical: %lld, physical: %lld\n", logical,
|
TRACE("Volume::FindBlock(): logical: %" B_PRIdOFF ", physical: %" B_PRIdOFF
|
||||||
physical);
|
"\n", logical, physical);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ btrfs_read_pages(fs_volume* _volume, fs_vnode* _node, void* _cookie,
|
|||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
file_io_vec fileVecs[8];
|
file_io_vec fileVecs[8];
|
||||||
uint32 fileVecCount = 8;
|
size_t fileVecCount = 8;
|
||||||
|
|
||||||
status = file_map_translate(inode->Map(), pos, bytesLeft, fileVecs,
|
status = file_map_translate(inode->Map(), pos, bytesLeft, fileVecs,
|
||||||
&fileVecCount, 0);
|
&fileVecCount, 0);
|
||||||
@ -321,10 +321,10 @@ btrfs_get_file_map(fs_volume* _volume, fs_vnode* _node, off_t offset,
|
|||||||
offset += blockLength;
|
offset += blockLength;
|
||||||
size -= blockLength;
|
size -= blockLength;
|
||||||
|
|
||||||
if (size <= vecs[index - 1].length || offset >= inode->Size()) {
|
if ((off_t)size <= vecs[index - 1].length || offset >= inode->Size()) {
|
||||||
// We're done!
|
// We're done!
|
||||||
*_count = index;
|
*_count = index;
|
||||||
TRACE("btrfs_get_file_map for inode %lld\n", inode->ID());
|
TRACE("btrfs_get_file_map for inode %" B_PRIdINO "\n", inode->ID());
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -362,7 +362,7 @@ static status_t
|
|||||||
btrfs_ioctl(fs_volume* _volume, fs_vnode* _node, void* _cookie, uint32 cmd,
|
btrfs_ioctl(fs_volume* _volume, fs_vnode* _node, void* _cookie, uint32 cmd,
|
||||||
void* buffer, size_t bufferLength)
|
void* buffer, size_t bufferLength)
|
||||||
{
|
{
|
||||||
TRACE("ioctl: %lu\n", cmd);
|
TRACE("ioctl: %" B_PRIu32 "\n", cmd);
|
||||||
|
|
||||||
/*Volume* volume = (Volume*)_volume->private_volume;*/
|
/*Volume* volume = (Volume*)_volume->private_volume;*/
|
||||||
return B_DEV_INVALID_IOCTL;
|
return B_DEV_INVALID_IOCTL;
|
||||||
|
Loading…
Reference in New Issue
Block a user