Package: hfsprogs / 332.25-8

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