hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/fs/ext4/mballoc.h
....@@ -24,19 +24,15 @@
2424 #include "ext4.h"
2525
2626 /*
27
+ * mb_debug() dynamic printk msgs could be used to debug mballoc code.
2728 */
2829 #ifdef CONFIG_EXT4_DEBUG
29
-extern ushort ext4_mballoc_debug;
30
-
31
-#define mb_debug(n, fmt, ...) \
32
-do { \
33
- if ((n) <= ext4_mballoc_debug) { \
34
- printk(KERN_DEBUG "(%s, %d): %s: " fmt, \
35
- __FILE__, __LINE__, __func__, ##__VA_ARGS__); \
36
- } \
37
-} while (0)
30
+#define mb_debug(sb, fmt, ...) \
31
+ pr_debug("[%s/%d] EXT4-fs (%s): (%s, %d): %s: " fmt, \
32
+ current->comm, task_pid_nr(current), sb->s_id, \
33
+ __FILE__, __LINE__, __func__, ##__VA_ARGS__)
3834 #else
39
-#define mb_debug(n, fmt, ...) no_printk(fmt, ##__VA_ARGS__)
35
+#define mb_debug(sb, fmt, ...) no_printk(fmt, ##__VA_ARGS__)
4036 #endif
4137
4238 #define EXT4_MB_HISTORY_ALLOC 1 /* allocation */
....@@ -63,7 +59,7 @@
6359 * by the stream allocator, which purpose is to pack requests
6460 * as close each to other as possible to produce smooth I/O traffic
6561 * We use locality group prealloc space for stream request.
66
- * We can tune the same via /proc/fs/ext4/<parition>/stream_req
62
+ * We can tune the same via /proc/fs/ext4/<partition>/stream_req
6763 */
6864 #define MB_DEFAULT_STREAM_THRESHOLD 16 /* 64K */
6965
....@@ -77,6 +73,10 @@
7773 */
7874 #define MB_DEFAULT_GROUP_PREALLOC 512
7975
76
+/*
77
+ * maximum length of inode prealloc list
78
+ */
79
+#define MB_DEFAULT_MAX_INODE_PREALLOC 512
8080
8181 struct ext4_free_data {
8282 /* this links the free block information from sb_info */