From 6238495ebbf74d7951329e8bdd1cbba0f0681644 Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Thu, 18 Sep 2003 20:59:37 +0000 Subject: [PATCH] Fixed second stupid to_vnode_id() bug. This time, high-end 16 bits of address block location were getting chopped off instead of being incorporated into vnode_id. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4763 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/udf/Utils.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/file_systems/udf/Utils.cpp b/src/add-ons/kernel/file_systems/udf/Utils.cpp index 0bd37d7d3e..ce606bf903 100644 --- a/src/add-ons/kernel/file_systems/udf/Utils.cpp +++ b/src/add-ons/kernel/file_systems/udf/Utils.cpp @@ -26,7 +26,7 @@ namespace Udf { udf_long_address to_long_address(vnode_id id, uint32 length) { - DEBUG_INIT_ETC(CF_PUBLIC | CF_HELPER, NULL, ("vnode_id: %Ld, length: %ld", id, length)); + DEBUG_INIT_ETC(CF_PUBLIC | CF_HELPER, NULL, ("vnode_id: %Ld (0x%Lx), length: %ld", id, id, length)); udf_long_address result; result.set_block((id >> 16) & 0xffffffff); result.set_partition(id & 0xffff); @@ -38,7 +38,15 @@ to_long_address(vnode_id id, uint32 length) vnode_id to_vnode_id(udf_long_address address) { - return (address.block() << 16) | (address.partition()); + DEBUG_INIT(CF_PUBLIC | CF_HELPER, NULL); + vnode_id result = address.block(); + result <<= 16; + result |= address.partition(); + PRINT(("block: %ld, 0x%lx\n", address.block(), address.block())); + PRINT(("partition: %d, 0x%x\n", address.partition(), address.partition())); + PRINT(("length: %ld, 0x%lx\n", address.length(), address.length())); + PRINT(("vnode_id: %Ld, 0x%Lx\n", result, result)); + return result; } time_t