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.

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