You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
8.5 KiB

  1. From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
  2. Date: Thu, 24 Oct 2013 01:11:21 -0200
  3. Subject: Rename dprintf to dbg_printf
  4. ---
  5. fsck_hfs.tproj/dfalib/SRepair.c | 18 +++++++++---------
  6. fsck_hfs.tproj/dfalib/SVerify1.c | 6 +++---
  7. fsck_hfs.tproj/fsck_debug.c | 10 +++++-----
  8. fsck_hfs.tproj/fsck_debug.h | 10 +++++-----
  9. 4 files changed, 22 insertions(+), 22 deletions(-)
  10. --- a/fsck_hfs.tproj/dfalib/SRepair.c
  11. +++ b/fsck_hfs.tproj/dfalib/SRepair.c
  12. @@ -1825,13 +1825,13 @@ static OSErr FixAttrSize(SGlobPtr GPtr,
  13. result = BTSearchRecord(GPtr->calculatedAttributesFCB, &iterator,
  14. kInvalidMRUCacheKey, &btRecord, &recSize, &iterator);
  15. if (result) {
  16. - dprintf (d_error|d_xattr, "%s: Cannot find attribute record (err = %d)\n", __FUNCTION__, result);
  17. + dbg_printf (d_error|d_xattr, "%s: Cannot find attribute record (err = %d)\n", __FUNCTION__, result);
  18. goto out;
  19. }
  20. /* We should only get record of type kHFSPlusAttrForkData */
  21. if (record.recordType != kHFSPlusAttrForkData) {
  22. - dprintf (d_error|d_xattr, "%s: Record found is not attribute fork data\n", __FUNCTION__);
  23. + dbg_printf (d_error|d_xattr, "%s: Record found is not attribute fork data\n", __FUNCTION__);
  24. result = btNotFound;
  25. goto out;
  26. }
  27. @@ -1862,7 +1862,7 @@ static OSErr FixAttrSize(SGlobPtr GPtr,
  28. result = BTReplaceRecord(GPtr->calculatedAttributesFCB, &iterator,
  29. &btRecord, recSize);
  30. if (result) {
  31. - dprintf (d_error|d_xattr, "%s: Cannot replace attribute record (err=%d)\n", __FUNCTION__, result);
  32. + dbg_printf (d_error|d_xattr, "%s: Cannot replace attribute record (err=%d)\n", __FUNCTION__, result);
  33. goto out;
  34. }
  35. }
  36. @@ -2058,7 +2058,7 @@ del_overflow_extents:
  37. /* Delete the extent record */
  38. err = DeleteBTreeRecord(GPtr->calculatedExtentsFCB, &extentKey);
  39. - dprintf (d_info, "%s: Deleting extent overflow for fileID=%u, forkType=%u, startBlock=%u\n", __FUNCTION__, fileID, forkType, foundStartBlock);
  40. + dbg_printf (d_info, "%s: Deleting extent overflow for fileID=%u, forkType=%u, startBlock=%u\n", __FUNCTION__, fileID, forkType, foundStartBlock);
  41. if (err) {
  42. goto create_symlink;
  43. }
  44. @@ -3227,12 +3227,12 @@ static OSErr MoveExtent(SGlobPtr GPtr, E
  45. &extentData, &recordSize, &foundExtentIndex);
  46. foundLocation = extentsBTree;
  47. if (err != noErr) {
  48. - dprintf (d_error|d_overlap, "%s: No matching extent record found in extents btree for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
  49. + dbg_printf (d_error|d_overlap, "%s: No matching extent record found in extents btree for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
  50. goto out;
  51. }
  52. } else {
  53. /* No more extents exist for this file */
  54. - dprintf (d_error|d_overlap, "%s: No matching extent record found for fileID = %d\n", __FUNCTION__, extentInfo->fileID);
  55. + dbg_printf (d_error|d_overlap, "%s: No matching extent record found for fileID = %d\n", __FUNCTION__, extentInfo->fileID);
  56. goto out;
  57. }
  58. }
  59. @@ -3241,7 +3241,7 @@ static OSErr MoveExtent(SGlobPtr GPtr, E
  60. err = CopyDiskBlocks(GPtr, extentInfo->startBlock, extentInfo->blockCount,
  61. extentInfo->newStartBlock);
  62. if (err != noErr) {
  63. - dprintf (d_error|d_overlap, "%s: Error in copying disk blocks for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
  64. + dbg_printf (d_error|d_overlap, "%s: Error in copying disk blocks for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
  65. goto out;
  66. }
  67. @@ -3260,7 +3260,7 @@ static OSErr MoveExtent(SGlobPtr GPtr, E
  68. }
  69. if (err != noErr) {
  70. - dprintf (d_error|d_overlap, "%s: Error in updating extent record for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
  71. + dbg_printf (d_error|d_overlap, "%s: Error in updating extent record for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
  72. goto out;
  73. }
  74. @@ -3491,7 +3491,7 @@ static OSErr SearchExtentInAttributeBT(S
  75. result = BTSearchRecord(GPtr->calculatedAttributesFCB, &iterator,
  76. kInvalidMRUCacheKey, &btRecord, recordSize, &iterator);
  77. if (result) {
  78. - dprintf (d_error|d_overlap, "%s: Error finding attribute record (err=%d) for fileID = %d, attrname = %d\n", __FUNCTION__, result, extentInfo->fileID, extentInfo->attrname);
  79. + dbg_printf (d_error|d_overlap, "%s: Error finding attribute record (err=%d) for fileID = %d, attrname = %d\n", __FUNCTION__, result, extentInfo->fileID, extentInfo->attrname);
  80. goto out;
  81. }
  82. --- a/fsck_hfs.tproj/dfalib/SVerify1.c
  83. +++ b/fsck_hfs.tproj/dfalib/SVerify1.c
  84. @@ -2157,9 +2157,9 @@ CheckAttributeRecord(SGlobPtr GPtr, cons
  85. if (doDelete == true) {
  86. result = DeleteBTreeRecord(GPtr->calculatedAttributesFCB, key);
  87. - dprintf (d_info|d_xattr, "%s: Deleting attribute %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
  88. + dbg_printf (d_info|d_xattr, "%s: Deleting attribute %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
  89. if (result) {
  90. - dprintf (d_error|d_xattr, "%s: Error in deleting record for %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
  91. + dbg_printf (d_error|d_xattr, "%s: Error in deleting record for %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
  92. }
  93. /* Set flags to mark header and map dirty */
  94. @@ -3034,7 +3034,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, U
  95. // checkout the extent record first
  96. err = ChkExtRec( GPtr, extents, &lastExtentIndex );
  97. if (err != noErr) {
  98. - dprintf (d_info, "%s: Bad extent for fileID %u in extent %u for startblock %u\n", __FUNCTION__, fileNumber, lastExtentIndex, blockCount);
  99. + dbg_printf (d_info, "%s: Bad extent for fileID %u in extent %u for startblock %u\n", __FUNCTION__, fileNumber, lastExtentIndex, blockCount);
  100. /* Stop verification if bad extent is found for system file or EA */
  101. if ((fileNumber < kHFSFirstUserCatalogNodeID) ||
  102. --- a/fsck_hfs.tproj/fsck_debug.c
  103. +++ b/fsck_hfs.tproj/fsck_debug.c
  104. @@ -25,18 +25,18 @@
  105. #include <stdio.h>
  106. #include <stdarg.h>
  107. -/* Current debug level of fsck_hfs for printing messages via dprintf */
  108. +/* Current debug level of fsck_hfs for printing messages via dbg_printf */
  109. unsigned long cur_debug_level;
  110. -/* Function: dprintf
  111. +/* Function: dbg_printf
  112. *
  113. * Description: Debug function similar to printf except the first parameter
  114. - * which indicates the type of message to be printed by dprintf. Based on
  115. + * which indicates the type of message to be printed by dbg_printf. Based on
  116. * current debug level and the type of message, the function decides
  117. * whether to print the message or not.
  118. *
  119. * Each unique message type has a bit assigned to it. The message type
  120. - * passed to dprintf can be one or combination (OR-ed value) of pre-defined
  121. + * passed to dbg_printf can be one or combination (OR-ed value) of pre-defined
  122. * debug message types. Only the messages whose type have one or more similar
  123. * bits set in comparison with current global debug level are printed.
  124. *
  125. @@ -56,7 +56,7 @@ unsigned long cur_debug_level;
  126. * Output:
  127. * Nothing
  128. */
  129. -void dprintf (unsigned long type, char *fmt, ...)
  130. +void dbg_printf (unsigned long type, char *fmt, ...)
  131. {
  132. if (cur_debug_level & type) {
  133. va_list ap;
  134. --- a/fsck_hfs.tproj/fsck_debug.h
  135. +++ b/fsck_hfs.tproj/fsck_debug.h
  136. @@ -36,18 +36,18 @@ enum debug_message_type {
  137. d_overlap = 0x0020 /* Overlap extents related messages */
  138. };
  139. -/* Current debug level of fsck_hfs for printing messages via dprintf */
  140. +/* Current debug level of fsck_hfs for printing messages via dbg_printf */
  141. extern unsigned long cur_debug_level;
  142. -/* Function: dprintf
  143. +/* Function: dbg_printf
  144. *
  145. * Description: Debug function similar to printf except the first parameter
  146. - * which indicates the type of message to be printed by dprintf. Based on
  147. + * which indicates the type of message to be printed by dbg_printf. Based on
  148. * current debug level and the type of message, the function decides
  149. * whether to print the message or not.
  150. *
  151. * Each unique message type has a bit assigned to it. The message type
  152. - * passed to dprintf can be one or combination (OR-ed value) of pre-defined
  153. + * passed to dbg_printf can be one or combination (OR-ed value) of pre-defined
  154. * debug message types. Only the messages whose type have one or more similar
  155. * bits set in comparison with current global debug level are printed.
  156. *
  157. @@ -67,6 +67,6 @@ extern unsigned long cur_debug_level;
  158. * Output:
  159. * Nothing
  160. */
  161. -extern void dprintf (unsigned long message_type, char *format, ...);
  162. +extern void dbg_printf (unsigned long message_type, char *format, ...);
  163. #endif /* __FSCK_DEBUG__ */