From 37e1ff91ea2df51342635e7625f01b5d2987027b Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Fri, 5 Dec 2003 06:28:33 +0000 Subject: [PATCH] Moved allocation location of reserve vds from immediately following primary vds to immediately preceding the anchor at block 256, since this puts more distance between the two vdses. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5578 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/bin/makeudfimage/UdfBuilder.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/apps/bin/makeudfimage/UdfBuilder.cpp b/src/apps/bin/makeudfimage/UdfBuilder.cpp index a7b42424ea..2929818ec0 100644 --- a/src/apps/bin/makeudfimage/UdfBuilder.cpp +++ b/src/apps/bin/makeudfimage/UdfBuilder.cpp @@ -186,10 +186,17 @@ UdfBuilder::Build() _PrintUpdate(VERBOSITY_HIGH, "udf: ", primaryExtent.location(), primaryExtent.length()); } - // reserve reserve vds + // reserve reserve vds. try to grab the 16 blocks preceding block 256. if + // that fails, just grab any 16. most commercial discs just put the reserve + // vds immediately following the primary vds, which seems a bit stupid to me, + // now that I think about it... if (!error) { _PrintUpdate(VERBOSITY_MEDIUM, "udf: Reserving space for reserve vds"); - error = _Allocator().GetNextExtent(16 << _BlockShift(), true, reserveExtent); + reserveExtent.set_location(256-16); + reserveExtent.set_length(16 << _BlockShift()); + error = _Allocator().GetExtent(reserveExtent); + if (error) + error = _Allocator().GetNextExtent(16 << _BlockShift(), true, reserveExtent); if (!error) _PrintUpdate(VERBOSITY_HIGH, "udf: ", reserveExtent.location(), reserveExtent.length());