The JBD2 naming cleanups patch was missing a definition of JBD2_POISON_FREE
[ext4-patch-queue.git] / jbd_to_jbd2_naming_cleanups.patch
blob6e38ad1aa9ba7cb43681e0662321b5b154d9d64e
1 jbd2: JBD_XXX to JBD2_XXX naming cleanup
3 From: Mingming Cao <cmm@us.ibm.com>
5 change JBD_XXX macros to JBD2_XXX in JBD2/Ext4
7 Signed-off-by: Mingming Cao <cmm@us.ibm.com>
8 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
9 ---
10 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
11 index 78beb09..2be404f 100644
12 --- a/fs/ext4/extents.c
13 +++ b/fs/ext4/extents.c
14 @@ -33,7 +33,7 @@
15 #include <linux/fs.h>
16 #include <linux/time.h>
17 #include <linux/ext4_jbd2.h>
18 -#include <linux/jbd.h>
19 +#include <linux/jbd2.h>
20 #include <linux/highuid.h>
21 #include <linux/pagemap.h>
22 #include <linux/quotaops.h>
23 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
24 index 3c1397f..42cbdb5 100644
25 --- a/fs/ext4/super.c
26 +++ b/fs/ext4/super.c
27 @@ -966,7 +966,7 @@ static int parse_options (char *options, struct super_block *sb,
28 if (option < 0)
29 return 0;
30 if (option == 0)
31 - option = JBD_DEFAULT_MAX_COMMIT_AGE;
32 + option = JBD2_DEFAULT_MAX_COMMIT_AGE;
33 sbi->s_commit_interval = HZ * option;
34 break;
35 case Opt_data_journal:
36 diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
37 index 2cac34a..b898ee4 100644
38 --- a/fs/jbd2/commit.c
39 +++ b/fs/jbd2/commit.c
40 @@ -278,7 +278,7 @@ static inline void write_tag_block(int tag_bytes, journal_block_tag_t *tag,
41 unsigned long long block)
43 tag->t_blocknr = cpu_to_be32(block & (u32)~0);
44 - if (tag_bytes > JBD_TAG_SIZE32)
45 + if (tag_bytes > JBD2_TAG_SIZE32)
46 tag->t_blocknr_high = cpu_to_be32((block >> 31) >> 1);
49 diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
50 index f12c65b..ff07bff 100644
51 --- a/fs/jbd2/journal.c
52 +++ b/fs/jbd2/journal.c
53 @@ -670,7 +670,7 @@ static journal_t * journal_init_common (void)
54 spin_lock_init(&journal->j_list_lock);
55 spin_lock_init(&journal->j_state_lock);
57 - journal->j_commit_interval = (HZ * JBD_DEFAULT_MAX_COMMIT_AGE);
58 + journal->j_commit_interval = (HZ * JBD2_DEFAULT_MAX_COMMIT_AGE);
60 /* The journal is marked for error until we succeed with recovery! */
61 journal->j_flags = JBD2_ABORT;
62 @@ -1612,9 +1612,9 @@ int jbd2_journal_blocks_per_page(struct inode *inode)
63 size_t journal_tag_bytes(journal_t *journal)
65 if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT))
66 - return JBD_TAG_SIZE64;
67 + return JBD2_TAG_SIZE64;
68 else
69 - return JBD_TAG_SIZE32;
70 + return JBD2_TAG_SIZE32;
74 @@ -1681,7 +1681,7 @@ static void journal_free_journal_head(struct journal_head *jh)
76 #ifdef CONFIG_JBD2_DEBUG
77 atomic_dec(&nr_journal_heads);
78 - memset(jh, JBD_POISON_FREE, sizeof(*jh));
79 + memset(jh, JBD2_POISON_FREE, sizeof(*jh));
80 #endif
81 kmem_cache_free(jbd2_journal_head_cache, jh);
83 diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
84 index b50be8a..d0ce627 100644
85 --- a/fs/jbd2/recovery.c
86 +++ b/fs/jbd2/recovery.c
87 @@ -311,7 +311,7 @@ int jbd2_journal_skip_recovery(journal_t *journal)
88 static inline unsigned long long read_tag_block(int tag_bytes, journal_block_tag_t *tag)
90 unsigned long long block = be32_to_cpu(tag->t_blocknr);
91 - if (tag_bytes > JBD_TAG_SIZE32)
92 + if (tag_bytes > JBD2_TAG_SIZE32)
93 block |= (u64)be32_to_cpu(tag->t_blocknr_high) << 32;
94 return block;
96 diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
97 index 01d8897..3595fd4 100644
98 --- a/fs/jbd2/revoke.c
99 +++ b/fs/jbd2/revoke.c
100 @@ -352,7 +352,7 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr,
101 if (bh)
102 BUFFER_TRACE(bh, "found on hash");
104 -#ifdef JBD_EXPENSIVE_CHECKING
105 +#ifdef JBD2_EXPENSIVE_CHECKING
106 else {
107 struct buffer_head *bh2;
109 @@ -453,7 +453,7 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
113 -#ifdef JBD_EXPENSIVE_CHECKING
114 +#ifdef JBD2_EXPENSIVE_CHECKING
115 /* There better not be one left behind by now! */
116 record = find_revoke_record(journal, bh->b_blocknr);
117 J_ASSERT_JH(jh, record == NULL);
118 diff --git a/include/linux/ext4_jbd2.h b/include/linux/ext4_jbd2.h
119 index d716e63..38c71d3 100644
120 --- a/include/linux/ext4_jbd2.h
121 +++ b/include/linux/ext4_jbd2.h
122 @@ -12,8 +12,8 @@
123 * Ext4-specific journaling extensions.
126 -#ifndef _LINUX_EXT4_JBD_H
127 -#define _LINUX_EXT4_JBD_H
128 +#ifndef _LINUX_EXT4_JBD2_H
129 +#define _LINUX_EXT4_JBD2_H
131 #include <linux/fs.h>
132 #include <linux/jbd2.h>
133 @@ -228,4 +228,4 @@ static inline int ext4_should_writeback_data(struct inode *inode)
134 return 0;
137 -#endif /* _LINUX_EXT4_JBD_H */
138 +#endif /* _LINUX_EXT4_JBD2_H */
139 diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
140 index 5f8b876..06ef114 100644
141 --- a/include/linux/jbd2.h
142 +++ b/include/linux/jbd2.h
143 @@ -13,8 +13,8 @@
144 * filesystem journaling support.
147 -#ifndef _LINUX_JBD_H
148 -#define _LINUX_JBD_H
149 +#ifndef _LINUX_JBD2_H
150 +#define _LINUX_JBD2_H
152 /* Allow this file to be included directly into e2fsprogs */
153 #ifndef __KERNEL__
154 @@ -37,26 +37,26 @@
155 #define journal_oom_retry 1
158 - * Define JBD_PARANIOD_IOFAIL to cause a kernel BUG() if ext3 finds
159 + * Define JBD2_PARANIOD_IOFAIL to cause a kernel BUG() if ext4 finds
160 * certain classes of error which can occur due to failed IOs. Under
161 - * normal use we want ext3 to continue after such errors, because
162 + * normal use we want ext4 to continue after such errors, because
163 * hardware _can_ fail, but for debugging purposes when running tests on
164 * known-good hardware we may want to trap these errors.
166 -#undef JBD_PARANOID_IOFAIL
167 +#undef JBD2_PARANOID_IOFAIL
170 * The default maximum commit age, in seconds.
172 -#define JBD_DEFAULT_MAX_COMMIT_AGE 5
173 +#define JBD2_DEFAULT_MAX_COMMIT_AGE 5
175 #ifdef CONFIG_JBD2_DEBUG
177 - * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal
178 + * Define JBD2_EXPENSIVE_CHECKING to enable more expensive internal
179 * consistency checks. By default we don't do this unless
180 * CONFIG_JBD2_DEBUG is on.
182 -#define JBD_EXPENSIVE_CHECKING
183 +#define JBD2_EXPENSIVE_CHECKING
184 extern u8 jbd2_journal_enable_debug;
186 #define jbd_debug(n, f, a...) \
187 @@ -163,8 +163,8 @@ typedef struct journal_block_tag_s
188 __be32 t_blocknr_high; /* most-significant high 32bits. */
189 } journal_block_tag_t;
191 -#define JBD_TAG_SIZE32 (offsetof(journal_block_tag_t, t_blocknr_high))
192 -#define JBD_TAG_SIZE64 (sizeof(journal_block_tag_t))
193 +#define JBD2_TAG_SIZE32 (offsetof(journal_block_tag_t, t_blocknr_high))
194 +#define JBD2_TAG_SIZE64 (sizeof(journal_block_tag_t))
197 * The revoke descriptor: used on disk to describe a series of blocks to
198 @@ -256,8 +256,8 @@ typedef struct journal_superblock_s
199 #include <linux/fs.h>
200 #include <linux/sched.h>
202 -#define JBD_ASSERTIONS
203 -#ifdef JBD_ASSERTIONS
204 +#define JBD2_ASSERTIONS
205 +#ifdef JBD2_ASSERTIONS
206 #define J_ASSERT(assert) \
207 do { \
208 if (!(assert)) { \
209 @@ -284,9 +284,9 @@ void buffer_assertion_failure(struct buffer_head *bh);
211 #else
212 #define J_ASSERT(assert) do { } while (0)
213 -#endif /* JBD_ASSERTIONS */
214 +#endif /* JBD2_ASSERTIONS */
216 -#if defined(JBD_PARANOID_IOFAIL)
217 +#if defined(JBD2_PARANOID_IOFAIL)
218 #define J_EXPECT(expr, why...) J_ASSERT(expr)
219 #define J_EXPECT_BH(bh, expr, why...) J_ASSERT_BH(bh, expr)
220 #define J_EXPECT_JH(jh, expr, why...) J_ASSERT_JH(jh, expr)
221 @@ -1104,4 +1104,4 @@ extern int jbd_blocks_per_page(struct inode *inode);
223 #endif /* __KERNEL__ */
225 -#endif /* _LINUX_JBD_H */
226 +#endif /* _LINUX_JBD2_H */
227 diff --git a/include/linux/poison.h b/include/linux/poison.h
228 index d93c300..a9c31be 100644
229 --- a/include/linux/poison.h
230 +++ b/include/linux/poison.h
231 @@ -36,7 +36,8 @@
234 /********** fs/jbd/journal.c **********/
235 -#define JBD_POISON_FREE 0x5b
236 +#define JBD_POISON_FREE 0x5b
237 +#define JBD2_POISON_FREE 0x5c
239 /********** drivers/base/dmapool.c **********/
240 #define POOL_POISON_FREED 0xa7 /* !inuse */