Switched from %lld to %Ld so R5 kernel dprintf statements would actually
print something useful for 64-bit integers. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4746 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -63,7 +63,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
status_t FindExtent(off_t start, udf_long_address *extent, bool *isEmpty) {
|
status_t FindExtent(off_t start, udf_long_address *extent, bool *isEmpty) {
|
||||||
DEBUG_INIT_ETC(CF_PUBLIC | CF_FILE_OPS | CF_HIGH_VOLUME, "AllocationDescriptorList<>",
|
DEBUG_INIT_ETC(CF_PUBLIC | CF_FILE_OPS | CF_HIGH_VOLUME, "AllocationDescriptorList<>",
|
||||||
("start: %lld, extent: %p, isEmpty: %p", start, extent, isEmpty));
|
("start: %Ld, extent: %p, isEmpty: %p", start, extent, isEmpty));
|
||||||
off_t startBlock = start >> fVolume->BlockShift();
|
off_t startBlock = start >> fVolume->BlockShift();
|
||||||
|
|
||||||
// This should never have to happen, as FindExtent is only called by
|
// This should never have to happen, as FindExtent is only called by
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ CachedBlock::Unset()
|
|||||||
{
|
{
|
||||||
DEBUG_INIT(CF_HIGH_VOLUME | CF_PUBLIC, "CachedBlock");
|
DEBUG_INIT(CF_HIGH_VOLUME | CF_PUBLIC, "CachedBlock");
|
||||||
if (fBlock) {
|
if (fBlock) {
|
||||||
PRINT(("releasing block #%lld\n", BlockNumber()));
|
PRINT(("releasing block #%Ld\n", BlockNumber()));
|
||||||
release_block(fVolume->Device(), fBlockNumber);
|
release_block(fVolume->Device(), fBlockNumber);
|
||||||
} else {
|
} else {
|
||||||
PRINT(("no block to release\n"));
|
PRINT(("no block to release\n"));
|
||||||
@@ -116,11 +116,11 @@ CachedBlock::Unset()
|
|||||||
inline uint8 *
|
inline uint8 *
|
||||||
CachedBlock::SetTo(off_t block, bool empty = false)
|
CachedBlock::SetTo(off_t block, bool empty = false)
|
||||||
{
|
{
|
||||||
DEBUG_INIT_ETC(CF_HIGH_VOLUME | CF_PUBLIC, "CachedBlock", ("block: %lld, empty: %s",
|
DEBUG_INIT_ETC(CF_HIGH_VOLUME | CF_PUBLIC, "CachedBlock", ("block: %Ld, empty: %s",
|
||||||
block, (empty ? "true" : "false")));
|
block, (empty ? "true" : "false")));
|
||||||
Unset();
|
Unset();
|
||||||
fBlockNumber = block;
|
fBlockNumber = block;
|
||||||
PRINT(("getting block #%lld\n", block));
|
PRINT(("getting block #%Ld\n", block));
|
||||||
return fBlock = empty ? (uint8 *)get_empty_block(fVolume->Device(), block, BlockSize())
|
return fBlock = empty ? (uint8 *)get_empty_block(fVolume->Device(), block, BlockSize())
|
||||||
: (uint8 *)get_block(fVolume->Device(), block, BlockSize());
|
: (uint8 *)get_block(fVolume->Device(), block, BlockSize());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, vnode_id *id)
|
|||||||
} else {
|
} else {
|
||||||
CS0String string(entry->id(), entry->id_length());
|
CS0String string(entry->id(), entry->id_length());
|
||||||
PRINT(("id == `%s'\n", string.String()));
|
PRINT(("id == `%s'\n", string.String()));
|
||||||
PRINT(("vnode_id: %lld\n", to_vnode_id(entry->icb())));
|
PRINT(("vnode_id: %Ld\n", to_vnode_id(entry->icb())));
|
||||||
DUMP(entry->icb());
|
DUMP(entry->icb());
|
||||||
sprintf(name, "%s", string.String());
|
sprintf(name, "%s", string.String());
|
||||||
*length = string.Length();
|
*length = string.Length();
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ status_t
|
|||||||
Icb::Read(off_t pos, void *buffer, size_t *length, uint32 *block)
|
Icb::Read(off_t pos, void *buffer, size_t *length, uint32 *block)
|
||||||
{
|
{
|
||||||
DEBUG_INIT_ETC(CF_PUBLIC | CF_HIGH_VOLUME, "Icb",
|
DEBUG_INIT_ETC(CF_PUBLIC | CF_HIGH_VOLUME, "Icb",
|
||||||
("pos: %lld, buffer: %p, length: (%p)->%ld", pos, buffer, length, (length ? *length : 0)));
|
("pos: %Ld, buffer: %p, length: (%p)->%ld", pos, buffer, length, (length ? *length : 0)));
|
||||||
|
|
||||||
if (!buffer || !length || pos < 0)
|
if (!buffer || !length || pos < 0)
|
||||||
RETURN(B_BAD_VALUE);
|
RETURN(B_BAD_VALUE);
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ template <class DescriptorList>
|
|||||||
status_t
|
status_t
|
||||||
Icb::_Read(DescriptorList &list, off_t pos, void *_buffer, size_t *length, uint32 *block)
|
Icb::_Read(DescriptorList &list, off_t pos, void *_buffer, size_t *length, uint32 *block)
|
||||||
{
|
{
|
||||||
DEBUG_INIT_ETC(CF_PRIVATE | CF_HIGH_VOLUME, "Icb", ("list: %p, pos: %lld, buffer: %p, length: (%p)->%ld",
|
DEBUG_INIT_ETC(CF_PRIVATE | CF_HIGH_VOLUME, "Icb", ("list: %p, pos: %Ld, buffer: %p, length: (%p)->%ld",
|
||||||
&list, pos, _buffer, length, (length ? *length : 0)));
|
&list, pos, _buffer, length, (length ? *length : 0)));
|
||||||
if (!_buffer || !length)
|
if (!_buffer || !length)
|
||||||
RETURN(B_BAD_VALUE);
|
RETURN(B_BAD_VALUE);
|
||||||
@@ -144,14 +144,14 @@ Icb::_Read(DescriptorList &list, off_t pos, void *_buffer, size_t *length, uint3
|
|||||||
|
|
||||||
while (bytesLeft > 0 && !err) {
|
while (bytesLeft > 0 && !err) {
|
||||||
|
|
||||||
PRINT(("pos: %lld\n", pos));
|
PRINT(("pos: %Ld\n", pos));
|
||||||
PRINT(("bytesLeft: %ld\n", bytesLeft));
|
PRINT(("bytesLeft: %ld\n", bytesLeft));
|
||||||
|
|
||||||
udf_long_address extent;
|
udf_long_address extent;
|
||||||
bool isEmpty = false;
|
bool isEmpty = false;
|
||||||
err = list.FindExtent(pos, &extent, &isEmpty);
|
err = list.FindExtent(pos, &extent, &isEmpty);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
PRINT(("found extent for offset %lld: (block: %ld, partition: %d, length: %ld, type: %d)\n",
|
PRINT(("found extent for offset %Ld: (block: %ld, partition: %d, length: %ld, type: %d)\n",
|
||||||
pos, extent.block(), extent.partition(), extent.length(), extent.type()));
|
pos, extent.block(), extent.partition(), extent.length(), extent.type()));
|
||||||
|
|
||||||
switch (extent.type()) {
|
switch (extent.type()) {
|
||||||
@@ -201,7 +201,7 @@ Icb::_Read(DescriptorList &list, off_t pos, void *_buffer, size_t *length, uint3
|
|||||||
off_t diskBlock;
|
off_t diskBlock;
|
||||||
err = volume->MapBlock(extent, &diskBlock);
|
err = volume->MapBlock(extent, &diskBlock);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
PRINT(("reading %ld bytes from disk block %lld using cached_read()\n",
|
PRINT(("reading %ld bytes from disk block %Ld using cached_read()\n",
|
||||||
readLength, diskBlock));
|
readLength, diskBlock));
|
||||||
err = cached_read(volume->Device(), diskBlock, buffer,
|
err = cached_read(volume->Device(), diskBlock, buffer,
|
||||||
readLength >> volume->BlockShift(),
|
readLength >> volume->BlockShift(),
|
||||||
@@ -234,7 +234,7 @@ Icb::_Read(DescriptorList &list, off_t pos, void *_buffer, size_t *length, uint3
|
|||||||
partialLength = bytesLeft;
|
partialLength = bytesLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
PRINT(("partialOffset: %lld\n", partialOffset));
|
PRINT(("partialOffset: %Ld\n", partialOffset));
|
||||||
PRINT(("partialLength: %ld\n", partialLength));
|
PRINT(("partialLength: %ld\n", partialLength));
|
||||||
|
|
||||||
if (isEmpty) {
|
if (isEmpty) {
|
||||||
@@ -244,7 +244,7 @@ Icb::_Read(DescriptorList &list, off_t pos, void *_buffer, size_t *length, uint3
|
|||||||
off_t diskBlock;
|
off_t diskBlock;
|
||||||
err = volume->MapBlock(extent, &diskBlock);
|
err = volume->MapBlock(extent, &diskBlock);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
PRINT(("reading %ld bytes from disk block %lld using get_block()\n",
|
PRINT(("reading %ld bytes from disk block %Ld using get_block()\n",
|
||||||
partialLength, diskBlock));
|
partialLength, diskBlock));
|
||||||
uint8 *data = (uint8*)get_block(volume->Device(), diskBlock, volume->BlockSize());
|
uint8 *data = (uint8*)get_block(volume->Device(), diskBlock, volume->BlockSize());
|
||||||
err = data ? B_OK : B_BAD_DATA;
|
err = data ? B_OK : B_BAD_DATA;
|
||||||
@@ -264,7 +264,7 @@ Icb::_Read(DescriptorList &list, off_t pos, void *_buffer, size_t *length, uint3
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PRINT(("error finding extent for offset %lld: 0x%lx, `%s'", pos,
|
PRINT(("error finding extent for offset %Ld: 0x%lx, `%s'", pos,
|
||||||
err, strerror(err)));
|
err, strerror(err)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace Udf {
|
|||||||
udf_long_address
|
udf_long_address
|
||||||
to_long_address(vnode_id id, uint32 length)
|
to_long_address(vnode_id id, uint32 length)
|
||||||
{
|
{
|
||||||
DEBUG_INIT_ETC(CF_PUBLIC | CF_HELPER, NULL, ("vnode_id: %lld, length: %ld", id, length));
|
DEBUG_INIT_ETC(CF_PUBLIC | CF_HELPER, NULL, ("vnode_id: %Ld, length: %ld", id, length));
|
||||||
udf_long_address result;
|
udf_long_address result;
|
||||||
result.set_block((id >> 16) & 0xffffffff);
|
result.set_block((id >> 16) & 0xffffffff);
|
||||||
result.set_partition(id & 0xffff);
|
result.set_partition(id & 0xffff);
|
||||||
|
|||||||
Reference in New Issue
Block a user