Permalink
Browse files

update to xnu-1504.9.17

  • Loading branch information...
1 parent 5a50200 commit 10a2cfc470cb35efd1da28979138f8f171e25c2a @comex committed Nov 23, 2010
Showing with 4,339 additions and 1,445 deletions.
  1. +11 −3 bsd/dev/unix_startup.c
  2. +2 −0 bsd/hfs/hfs.h
  3. +5 −4 bsd/hfs/hfs_catalog.c
  4. +73 −38 bsd/hfs/hfs_vfsops.c
  5. +25 −7 bsd/hfs/hfs_vfsutils.c
  6. +7 −0 bsd/hfs/hfs_vnops.c
  7. +3 −3 bsd/hfs/hfs_xattr.c
  8. +9 −9 bsd/hfs/hfscommon/Misc/FileExtentMapping.c
  9. +67 −29 bsd/hfs/hfscommon/Misc/VolumeAllocation.c
  10. +14 −3 bsd/hfs/hfscommon/headers/FileMgrInternal.h
  11. +79 −8 bsd/kern/kern_credential.c
  12. +1 −1 bsd/kern/kern_descrip.c
  13. +2 −0 bsd/kern/kern_fork.c
  14. +131 −128 bsd/kern/kern_malloc.c
  15. +12 −1 bsd/kern/kern_symfile.c
  16. +1 −1 bsd/kern/kpi_mbuf.c
  17. +2 −0 bsd/kern/tty.c
  18. +0 −2 bsd/kern/tty_ptmx.c
  19. +2 −0 bsd/kern/ubc_subr.c
  20. +1 −0 bsd/kern/uipc_socket.c
  21. +6 −1 bsd/net/raw_usrreq.c
  22. +1 −0 bsd/net/route.c
  23. +9 −4 bsd/netinet/in_pcb.c
  24. +14 −11 bsd/netinet/ip_input.c
  25. +1 −1 bsd/netinet/ip_mroute.c
  26. +114 −1 bsd/netinet/ip_output.c
  27. +1 −1 bsd/netinet6/in6_pcb.c
  28. +1 −11 bsd/netinet6/in6_proto.c
  29. +11 −5 bsd/netinet6/ip6_input.c
  30. +1 −1 bsd/netinet6/ip6_var.h
  31. +4 −3 bsd/netinet6/nd6.c
  32. +3 −2 bsd/nfs/nfs_socket.c
  33. +1 −0 bsd/sys/disk.h
  34. +1 −0 bsd/sys/kdebug.h
  35. +1 −0 bsd/sys/mount_internal.h
  36. +7 −3 bsd/vfs/vfs_bio.c
  37. +7 −10 bsd/vfs/vfs_cluster.c
  38. +203 −26 bsd/vfs/vfs_subr.c
  39. +3 −3 bsd/vfs/vfs_xattr.c
  40. +27 −6 bsd/vm/dp_backing_file.c
  41. +4 −0 config/IOKit.exports
  42. +1 −1 config/MasterVersion
  43. +1 −0 iokit/IOKit/IOBufferMemoryDescriptor.h
  44. +37 −10 iokit/IOKit/IOHibernatePrivate.h
  45. +4 −0 iokit/IOKit/IOMemoryDescriptor.h
  46. +7 −0 iokit/IOKit/IOMessage.h
  47. +99 −1 iokit/IOKit/pwr_mgt/IOPM.h
  48. +2 −1 iokit/IOKit/pwr_mgt/IOPMLibDefs.h
  49. +27 −1 iokit/IOKit/pwr_mgt/IOPMPrivate.h
  50. +132 −7 iokit/IOKit/pwr_mgt/RootDomain.h
  51. +45 −140 iokit/Kernel/IOBufferMemoryDescriptor.cpp
  52. +142 −111 iokit/Kernel/IODMACommand.cpp
  53. +281 −182 iokit/Kernel/IOHibernateIO.cpp
  54. +3 −1 iokit/Kernel/IOHibernateInternal.h
  55. +4 −33 iokit/Kernel/IOHibernateRestoreKernel.c
  56. +11 −9 iokit/Kernel/IOKitKernelInternal.h
  57. +22 −8 iokit/Kernel/IOLib.cpp
  58. +0 −21 iokit/Kernel/IOMapper.cpp
  59. +44 −16 iokit/Kernel/IOMemoryDescriptor.cpp
  60. +4 −4 iokit/Kernel/IOPMPowerStateQueue.cpp
  61. +4 −3 iokit/Kernel/IOPMPowerStateQueue.h
  62. +997 −28 iokit/Kernel/IOPMrootDomain.cpp
  63. +2 −2 iokit/Kernel/IOServicePM.cpp
  64. +21 −0 iokit/Kernel/RootDomainUserClient.cpp
  65. +3 −0 iokit/Kernel/RootDomainUserClient.h
  66. +0 −1 iokit/conf/files
  67. +109 −17 kgmacros
  68. +1 −1 osfmk/console/video_console.c
  69. +2 −1 osfmk/default_pager/default_pager.c
  70. +65 −32 osfmk/default_pager/dp_backing_store.c
  71. +6 −0 osfmk/device/device.defs
  72. +38 −4 osfmk/i386/acpi.c
  73. +5 −2 osfmk/i386/bsd_i386.c
  74. +0 −1 osfmk/i386/cpu_data.h
  75. +0 −1 osfmk/i386/cpuid.h
  76. +14 −0 osfmk/i386/hibernate_i386.c
  77. +5 −5 osfmk/i386/i386_init.c
  78. +78 −81 osfmk/i386/i386_vm_init.c
  79. +2 −2 osfmk/i386/machine_routines.c
  80. +0 −2 osfmk/i386/machine_routines.h
  81. +26 −1 osfmk/i386/machine_routines_asm.s
  82. +2 −1 osfmk/i386/misc_protos.h
  83. +19 −5 osfmk/i386/pcb.c
  84. +1 −0 osfmk/i386/pmCPU.c
  85. +2 −1 osfmk/i386/pmCPU.h
  86. +32 −17 osfmk/i386/pmap.c
  87. +1 −0 osfmk/i386/pmap_internal.h
  88. +53 −0 osfmk/i386/pmap_x86_common.c
  89. +20 −1 osfmk/i386/rtclock.c
  90. +5 −1 osfmk/i386/rtclock.h
  91. +5 −0 osfmk/ipc/ipc_init.c
  92. +6 −4 osfmk/kern/hibernate.c
  93. +2 −2 osfmk/kern/host.c
  94. +2 −0 osfmk/kern/mk_timer.c
  95. +71 −57 osfmk/kern/sched_prim.c
  96. +1 −0 osfmk/kern/sync_sema.c
  97. +1 −0 osfmk/kern/task.c
  98. +1 −0 osfmk/kern/thread.c
  99. +1 −0 osfmk/kern/thread_call.c
  100. +5 −0 osfmk/kern/wait_queue.c
  101. +22 −8 osfmk/kern/zalloc.c
  102. +3 −1 osfmk/kern/zalloc.h
  103. +2 −1 osfmk/mach/memory_object_types.h
  104. +3 −0 osfmk/ppc/hibernate_ppc.c
  105. +25 −0 osfmk/ppc/pmap.c
  106. +8 −3 osfmk/vm/bsd_vm.c
  107. +7 −3 osfmk/vm/memory_object.c
  108. +5 −3 osfmk/vm/pmap.h
  109. +1 −0 osfmk/vm/vm_apple_protect.c
  110. +12 −4 osfmk/vm/vm_fault.c
  111. +11 −20 osfmk/vm/vm_kern.c
  112. +1 −0 osfmk/vm/vm_kern.h
  113. +7 −0 osfmk/vm/vm_map.c
  114. +17 −11 osfmk/vm/vm_object.c
  115. +1 −0 osfmk/vm/vm_object.h
  116. +17 −7 osfmk/vm/vm_page.h
  117. +109 −69 osfmk/vm/vm_pageout.c
  118. +50 −5 osfmk/vm/vm_pageout.h
  119. +665 −154 osfmk/vm/vm_resident.c
  120. +6 −4 osfmk/vm/vm_user.c
  121. +18 −1 osfmk/x86_64/machine_routines_asm.s
  122. +3 −3 osfmk/x86_64/pmap.c
  123. +5 −3 osfmk/x86_64/start.s
View
@@ -61,7 +61,7 @@ extern uint32_t tcp_recvspace;
void bsd_bufferinit(void) __attribute__((section("__TEXT, initcode")));
extern void md_prepare_for_shutdown(int, int, char *);
-unsigned int bsd_mbuf_cluster_reserve(void);
+unsigned int bsd_mbuf_cluster_reserve(boolean_t *);
void bsd_srv_setup(int);
void bsd_exec_setup(int);
@@ -159,7 +159,7 @@ bsd_startupearly(void)
#endif
int scale;
- nmbclusters = bsd_mbuf_cluster_reserve() / MCLBYTES;
+ nmbclusters = bsd_mbuf_cluster_reserve(NULL) / MCLBYTES;
#if INET || INET6
if ((scale = nmbclusters / NMBCLUSTERS) > 1) {
@@ -237,9 +237,10 @@ bsd_bufferinit(void)
* memory that is present.
*/
unsigned int
-bsd_mbuf_cluster_reserve(void)
+bsd_mbuf_cluster_reserve(boolean_t *overridden)
{
int mbuf_pool = 0;
+ static boolean_t was_overridden = FALSE;
/* If called more than once, return the previously calculated size */
if (mbuf_poolsz != 0)
@@ -263,6 +264,10 @@ bsd_mbuf_cluster_reserve(void)
ncl = (mbuf_pool << MBSHIFT) >> MCLSHIFT;
if (sane_size > (64 * 1024 * 1024) || ncl != 0) {
+
+ if (ncl || srv)
+ was_overridden = TRUE;
+
if ((nmbclusters = ncl) == 0) {
/* Auto-configure the mbuf pool size */
nmbclusters = mbuf_default_ncl(srv, sane_size);
@@ -278,6 +283,9 @@ bsd_mbuf_cluster_reserve(void)
}
mbuf_poolsz = nmbclusters << MCLSHIFT;
done:
+ if (overridden)
+ *overridden = was_overridden;
+
return (mbuf_poolsz);
}
#if defined(__LP64__)
View
@@ -716,6 +716,8 @@ extern u_int32_t hfs_freeblks(struct hfsmount * hfsmp, int wantreserve);
short MacToVFSError(OSErr err);
+void hfs_metadatazone_init(struct hfsmount *hfsmp);
+
/* HFS directory hint functions. */
extern directoryhint_t * hfs_getdirhint(struct cnode *, int, int);
extern void hfs_reldirhint(struct cnode *, directoryhint_t *);
View
@@ -2111,7 +2111,7 @@ cat_createlink(struct hfsmount *hfsmp, struct cat_desc *descp, struct cat_attr *
}
if (alias_allocated && rsrcforkp->extents[0].startBlock != 0) {
(void) BlockDeallocate(hfsmp, rsrcforkp->extents[0].startBlock,
- rsrcforkp->extents[0].blockCount);
+ rsrcforkp->extents[0].blockCount, 0);
rsrcforkp->extents[0].startBlock = 0;
rsrcforkp->extents[0].blockCount = 0;
}
@@ -2210,7 +2210,8 @@ cat_makealias(struct hfsmount *hfsmp, u_int32_t inode_num, struct HFSPlusCatalog
bzero(rsrcforkp, sizeof(HFSPlusForkData));
/* Allocate some disk space for the alias content. */
- result = BlockAllocate(hfsmp, 0, blkcount, blkcount, 1, 1,
+ result = BlockAllocate(hfsmp, 0, blkcount, blkcount,
+ HFS_ALLOC_FORCECONTIG | HFS_ALLOC_METAZONE,
&rsrcforkp->extents[0].startBlock,
&rsrcforkp->extents[0].blockCount);
if (result) {
@@ -2265,7 +2266,7 @@ cat_makealias(struct hfsmount *hfsmp, u_int32_t inode_num, struct HFSPlusCatalog
exit:
if (result && rsrcforkp->extents[0].startBlock != 0) {
- (void) BlockDeallocate(hfsmp, rsrcforkp->extents[0].startBlock, rsrcforkp->extents[0].blockCount);
+ (void) BlockDeallocate(hfsmp, rsrcforkp->extents[0].startBlock, rsrcforkp->extents[0].blockCount, 0);
rsrcforkp->extents[0].startBlock = 0;
rsrcforkp->extents[0].blockCount = 0;
rsrcforkp->logicalSize = 0;
@@ -2329,7 +2330,7 @@ cat_deletelink(struct hfsmount *hfsmp, struct cat_desc *descp)
(void) BlockDeallocate(hfsmp,
file.resourceFork.extents[i].startBlock,
- file.resourceFork.extents[i].blockCount);
+ file.resourceFork.extents[i].blockCount, 0);
totalBlocks -= file.resourceFork.extents[i].blockCount;
file.resourceFork.extents[i].startBlock = 0;
View
@@ -368,7 +368,8 @@ hfs_mount(struct mount *mp, vnode_t devvp, user_addr_t data, vfs_context_t conte
/*
* Allow hot file clustering if conditions allow.
*/
- if (hfsmp->hfs_flags & HFS_METADATA_ZONE) {
+ if ((hfsmp->hfs_flags & HFS_METADATA_ZONE) &&
+ ((hfsmp->hfs_mp->mnt_kern_flag & MNTK_SSD) == 0)) {
(void) hfs_recording_init(hfsmp);
}
/* Force ACLs on HFS+ file systems. */
@@ -3762,9 +3763,10 @@ hfs_extendfs(struct hfsmount *hfsmp, u_int64_t newsize, vfs_context_t context)
}
}
- /*
- * TODO: Adjust the size of the metadata zone based on new volume size?
+ /*
+ * Update the metadata zone size based on current volume size
*/
+ hfs_metadatazone_init(hfsmp);
/*
* Adjust the size of hfsmp->hfs_attrdata_vp
@@ -3900,13 +3902,26 @@ hfs_truncatefs(struct hfsmount *hfsmp, u_int64_t newsize, vfs_context_t context)
hfsmp->allocLimit = newblkcnt - 2;
else
hfsmp->allocLimit = newblkcnt - 1;
- /* Update the volume free block count to reflect the total number of
- * free blocks that will exist after a successful resize.
+ /*
+ * Update the volume free block count to reflect the total number
+ * of free blocks that will exist after a successful resize.
+ * Relocation of extents will result in no net change in the total
+ * free space on the disk. Therefore the code that allocates
+ * space for new extent and deallocates the old extent explicitly
+ * prevents updating the volume free block count. It will also
+ * prevent false disk full error when the number of blocks in
+ * an extent being relocated is more than the free blocks that
+ * will exist after the volume is resized.
*/
hfsmp->freeBlocks -= reclaimblks;
updateFreeBlocks = true;
HFS_MOUNT_UNLOCK(hfsmp, TRUE);
+ /*
+ * Update the metadata zone size, and, if required, disable it
+ */
+ hfs_metadatazone_init(hfsmp);
+
/*
* Look for files that have blocks at or beyond the location of the
* new alternate volume header
@@ -4001,10 +4016,6 @@ hfs_truncatefs(struct hfsmount *hfsmp, u_int64_t newsize, vfs_context_t context)
if (error)
panic("hfs_truncatefs: unexpected error flushing volume header (%d)\n", error);
- /*
- * TODO: Adjust the size of the metadata zone based on new volume size?
- */
-
/*
* Adjust the size of hfsmp->hfs_attrdata_vp
*/
@@ -4034,6 +4045,10 @@ hfs_truncatefs(struct hfsmount *hfsmp, u_int64_t newsize, vfs_context_t context)
hfsmp->nextAllocation = hfsmp->hfs_metazone_end + 1;
hfsmp->hfs_flags &= ~HFS_RESIZE_IN_PROGRESS;
HFS_MOUNT_UNLOCK(hfsmp, TRUE);
+ /* On error, reset the metadata zone for original volume size */
+ if (error && (updateFreeBlocks == true)) {
+ hfs_metadatazone_init(hfsmp);
+ }
if (lockflags) {
hfs_systemfile_unlock(hfsmp, lockflags);
@@ -4250,6 +4265,7 @@ hfs_reclaim_file(struct hfsmount *hfsmp, struct vnode *vp, u_long startblk, int
struct BTreeIterator *iterator = NULL;
u_int8_t forktype;
u_int32_t fileID;
+ u_int32_t alloc_flags;
/* If there is no vnode for this file, then there's nothing to do. */
if (vp == NULL)
@@ -4343,25 +4359,32 @@ hfs_reclaim_file(struct hfsmount *hfsmp, struct vnode *vp, u_long startblk, int
end_block = oldStartBlock + oldBlockCount;
/* Check if the file overlaps the target space */
if (end_block > startblk) {
- /* Allocate a new extent */
- error = BlockAllocate(hfsmp, 1, oldBlockCount, oldBlockCount, true, (is_sysfile ? true : false), &newStartBlock, &newBlockCount);
- if (error) {
- printf("hfs_reclaim_file: BlockAllocate (error=%d) for fileID=%u %u:(%u,%u)\n", error, fileID, i, oldStartBlock, oldBlockCount);
- goto fail;
+ alloc_flags = HFS_ALLOC_FORCECONTIG | HFS_ALLOC_SKIPFREEBLKS;
+ if (is_sysfile) {
+ alloc_flags |= HFS_ALLOC_METAZONE;
}
- if (newBlockCount != oldBlockCount) {
- printf("hfs_reclaim_file: fileID=%u - newBlockCount=%u, oldBlockCount=%u", fileID, newBlockCount, oldBlockCount);
- if (BlockDeallocate(hfsmp, newStartBlock, newBlockCount)) {
- hfs_mark_volume_inconsistent(hfsmp);
+ error = BlockAllocate(hfsmp, 1, oldBlockCount, oldBlockCount, alloc_flags, &newStartBlock, &newBlockCount);
+ if (error) {
+ if (!is_sysfile && ((error == dskFulErr) || (error == ENOSPC))) {
+ /* Try allocating again using the metadata zone */
+ alloc_flags |= HFS_ALLOC_METAZONE;
+ error = BlockAllocate(hfsmp, 1, oldBlockCount, oldBlockCount, alloc_flags, &newStartBlock, &newBlockCount);
+ }
+ if (error) {
+ printf("hfs_reclaim_file: BlockAllocate(metazone) (error=%d) for fileID=%u %u:(%u,%u)\n", error, fileID, i, oldStartBlock, oldBlockCount);
+ goto fail;
+ } else {
+ if (hfs_resize_debug) {
+ printf("hfs_reclaim_file: BlockAllocate(metazone) success for fileID=%u %u:(%u,%u)\n", fileID, i, newStartBlock, newBlockCount);
+ }
}
- goto fail;
}
/* Copy data from old location to new location */
error = hfs_copy_extent(hfsmp, vp, oldStartBlock, newStartBlock, newBlockCount, context);
if (error) {
printf("hfs_reclaim_file: hfs_copy_extent error=%d for fileID=%u %u:(%u,%u) to %u:(%u,%u)\n", error, fileID, i, oldStartBlock, oldBlockCount, i, newStartBlock, newBlockCount);
- if (BlockDeallocate(hfsmp, newStartBlock, newBlockCount)) {
+ if (BlockDeallocate(hfsmp, newStartBlock, newBlockCount, HFS_ALLOC_SKIPFREEBLKS)) {
hfs_mark_volume_inconsistent(hfsmp);
}
goto fail;
@@ -4371,7 +4394,7 @@ hfs_reclaim_file(struct hfsmount *hfsmp, struct vnode *vp, u_long startblk, int
*blks_moved += newBlockCount;
/* Deallocate the old extent */
- error = BlockDeallocate(hfsmp, oldStartBlock, oldBlockCount);
+ error = BlockDeallocate(hfsmp, oldStartBlock, oldBlockCount, HFS_ALLOC_SKIPFREEBLKS);
if (error) {
printf("hfs_reclaim_file: BlockDeallocate returned %d\n", error);
hfs_mark_volume_inconsistent(hfsmp);
@@ -4445,22 +4468,30 @@ hfs_reclaim_file(struct hfsmount *hfsmp, struct vnode *vp, u_long startblk, int
oldBlockCount = record[i].blockCount;
end_block = oldStartBlock + oldBlockCount;
if (end_block > startblk) {
- error = BlockAllocate(hfsmp, 1, oldBlockCount, oldBlockCount, true, (is_sysfile ? true : false), &newStartBlock, &newBlockCount);
- if (error) {
- printf("hfs_reclaim_file: BlockAllocate (error=%d) for fileID=%u %u:(%u,%u)\n", error, fileID, i, oldStartBlock, oldBlockCount);
- goto fail;
+ alloc_flags = HFS_ALLOC_FORCECONTIG | HFS_ALLOC_SKIPFREEBLKS;
+ if (is_sysfile) {
+ alloc_flags |= HFS_ALLOC_METAZONE;
}
- if (newBlockCount != oldBlockCount) {
- printf("hfs_reclaim_file: fileID=%u - newBlockCount=%u, oldBlockCount=%u", fileID, newBlockCount, oldBlockCount);
- if (BlockDeallocate(hfsmp, newStartBlock, newBlockCount)) {
- hfs_mark_volume_inconsistent(hfsmp);
+ error = BlockAllocate(hfsmp, 1, oldBlockCount, oldBlockCount, alloc_flags, &newStartBlock, &newBlockCount);
+ if (error) {
+ if (!is_sysfile && ((error == dskFulErr) || (error == ENOSPC))) {
+ /* Try allocating again using the metadata zone */
+ alloc_flags |= HFS_ALLOC_METAZONE;
+ error = BlockAllocate(hfsmp, 1, oldBlockCount, oldBlockCount, alloc_flags, &newStartBlock, &newBlockCount);
+ }
+ if (error) {
+ printf("hfs_reclaim_file: BlockAllocate(metazone) (error=%d) for fileID=%u %u:(%u,%u)\n", error, fileID, i, oldStartBlock, oldBlockCount);
+ goto fail;
+ } else {
+ if (hfs_resize_debug) {
+ printf("hfs_reclaim_file: BlockAllocate(metazone) success for fileID=%u %u:(%u,%u)\n", fileID, i, newStartBlock, newBlockCount);
+ }
}
- goto fail;
}
error = hfs_copy_extent(hfsmp, vp, oldStartBlock, newStartBlock, newBlockCount, context);
if (error) {
printf("hfs_reclaim_file: hfs_copy_extent error=%d for fileID=%u (%u,%u) to (%u,%u)\n", error, fileID, oldStartBlock, oldBlockCount, newStartBlock, newBlockCount);
- if (BlockDeallocate(hfsmp, newStartBlock, newBlockCount)) {
+ if (BlockDeallocate(hfsmp, newStartBlock, newBlockCount, HFS_ALLOC_SKIPFREEBLKS)) {
hfs_mark_volume_inconsistent(hfsmp);
}
goto fail;
@@ -4483,7 +4514,7 @@ hfs_reclaim_file(struct hfsmount *hfsmp, struct vnode *vp, u_long startblk, int
hfs_mark_volume_inconsistent(hfsmp);
goto fail;
}
- error = BlockDeallocate(hfsmp, oldStartBlock, oldBlockCount);
+ error = BlockDeallocate(hfsmp, oldStartBlock, oldBlockCount, HFS_ALLOC_SKIPFREEBLKS);
if (error) {
printf("hfs_reclaim_file: BlockDeallocate returned %d\n", error);
hfs_mark_volume_inconsistent(hfsmp);
@@ -4608,7 +4639,9 @@ hfs_reclaim_journal_file(struct hfsmount *hfsmp, vfs_context_t context)
oldBlockCount = hfsmp->jnl_size / hfsmp->blockSize;
/* TODO: Allow the journal to change size based on the new volume size. */
- error = BlockAllocate(hfsmp, 1, oldBlockCount, oldBlockCount, true, true, &newStartBlock, &newBlockCount);
+ error = BlockAllocate(hfsmp, 1, oldBlockCount, oldBlockCount,
+ HFS_ALLOC_METAZONE | HFS_ALLOC_FORCECONTIG | HFS_ALLOC_SKIPFREEBLKS,
+ &newStartBlock, &newBlockCount);
if (error) {
printf("hfs_reclaim_journal_file: BlockAllocate returned %d\n", error);
goto fail;
@@ -4618,7 +4651,7 @@ hfs_reclaim_journal_file(struct hfsmount *hfsmp, vfs_context_t context)
goto free_fail;
}
- error = BlockDeallocate(hfsmp, hfsmp->jnl_start, oldBlockCount);
+ error = BlockDeallocate(hfsmp, hfsmp->jnl_start, oldBlockCount, HFS_ALLOC_SKIPFREEBLKS);
if (error) {
printf("hfs_reclaim_journal_file: BlockDeallocate returned %d\n", error);
goto free_fail;
@@ -4668,7 +4701,7 @@ hfs_reclaim_journal_file(struct hfsmount *hfsmp, vfs_context_t context)
return error;
free_fail:
- (void) BlockDeallocate(hfsmp, newStartBlock, newBlockCount);
+ (void) BlockDeallocate(hfsmp, newStartBlock, newBlockCount, HFS_ALLOC_SKIPFREEBLKS);
fail:
hfs_systemfile_unlock(hfsmp, lockflags);
(void) hfs_end_transaction(hfsmp);
@@ -4704,7 +4737,9 @@ hfs_reclaim_journal_info_block(struct hfsmount *hfsmp, vfs_context_t context)
}
lockflags = hfs_systemfile_lock(hfsmp, SFL_CATALOG | SFL_BITMAP, HFS_EXCLUSIVE_LOCK);
- error = BlockAllocate(hfsmp, 1, 1, 1, true, true, &newBlock, &blockCount);
+ error = BlockAllocate(hfsmp, 1, 1, 1,
+ HFS_ALLOC_METAZONE | HFS_ALLOC_FORCECONTIG | HFS_ALLOC_SKIPFREEBLKS,
+ &newBlock, &blockCount);
if (error) {
printf("hfs_reclaim_journal_info_block: BlockAllocate returned %d\n", error);
goto fail;
@@ -4713,7 +4748,7 @@ hfs_reclaim_journal_info_block(struct hfsmount *hfsmp, vfs_context_t context)
printf("hfs_reclaim_journal_info_block: blockCount != 1 (%u)\n", blockCount);
goto free_fail;
}
- error = BlockDeallocate(hfsmp, hfsmp->vcbJinfoBlock, 1);
+ error = BlockDeallocate(hfsmp, hfsmp->vcbJinfoBlock, 1, HFS_ALLOC_SKIPFREEBLKS);
if (error) {
printf("hfs_reclaim_journal_info_block: BlockDeallocate returned %d\n", error);
goto free_fail;
@@ -4788,7 +4823,7 @@ hfs_reclaim_journal_info_block(struct hfsmount *hfsmp, vfs_context_t context)
return error;
free_fail:
- (void) BlockDeallocate(hfsmp, newBlock, blockCount);
+ (void) BlockDeallocate(hfsmp, newBlock, blockCount, HFS_ALLOC_SKIPFREEBLKS);
fail:
hfs_systemfile_unlock(hfsmp, lockflags);
(void) hfs_end_transaction(hfsmp);
Oops, something went wrong.

0 comments on commit 10a2cfc

Please sign in to comment.