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