From 84520bc6228c9155123f77eb3a54f80979bf4485 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 24 Sep 2007 07:54:21 -0400 Subject: [PATCH] The JBD2 naming cleanups patch was missing a definition of JBD2_POISON_FREE --- jbd_to_jbd2_naming_cleanups.patch | 247 +++++++++++++++++++------------------- 1 file changed, 126 insertions(+), 121 deletions(-) diff --git a/jbd_to_jbd2_naming_cleanups.patch b/jbd_to_jbd2_naming_cleanups.patch index c51d6d0c..6e38ad1a 100644 --- a/jbd_to_jbd2_naming_cleanups.patch +++ b/jbd_to_jbd2_naming_cleanups.patch @@ -1,26 +1,30 @@ -JBD2 naming cleanup +jbd2: JBD_XXX to JBD2_XXX naming cleanup From: Mingming Cao -change micros name from JBD_XXX to JBD2_XXX in JBD2/Ext4 +change JBD_XXX macros to JBD2_XXX in JBD2/Ext4 Signed-off-by: Mingming Cao +Signed-off-by: "Theodore Ts'o" --- - fs/ext4/extents.c | 2 +- - fs/ext4/super.c | 2 +- - fs/jbd2/commit.c | 2 +- - fs/jbd2/journal.c | 8 ++++---- - fs/jbd2/recovery.c | 2 +- - fs/jbd2/revoke.c | 4 ++-- - include/linux/ext4_jbd2.h | 6 +++--- - include/linux/jbd2.h | 30 +++++++++++++++--------------- - 8 files changed, 28 insertions(+), 28 deletions(-) - -Index: linux-2.6.23-rc6/fs/ext4/super.c -=================================================================== ---- linux-2.6.23-rc6.orig/fs/ext4/super.c 2007-09-21 16:27:31.000000000 -0700 -+++ linux-2.6.23-rc6/fs/ext4/super.c 2007-09-21 16:27:46.000000000 -0700 -@@ -966,7 +966,7 @@ static int parse_options (char *options, +diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c +index 78beb09..2be404f 100644 +--- a/fs/ext4/extents.c ++++ b/fs/ext4/extents.c +@@ -33,7 +33,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +diff --git a/fs/ext4/super.c b/fs/ext4/super.c +index 3c1397f..42cbdb5 100644 +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -966,7 +966,7 @@ static int parse_options (char *options, struct super_block *sb, if (option < 0) return 0; if (option == 0) @@ -29,10 +33,92 @@ Index: linux-2.6.23-rc6/fs/ext4/super.c sbi->s_commit_interval = HZ * option; break; case Opt_data_journal: -Index: linux-2.6.23-rc6/include/linux/ext4_jbd2.h -=================================================================== ---- linux-2.6.23-rc6.orig/include/linux/ext4_jbd2.h 2007-09-10 19:50:29.000000000 -0700 -+++ linux-2.6.23-rc6/include/linux/ext4_jbd2.h 2007-09-21 16:27:46.000000000 -0700 +diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c +index 2cac34a..b898ee4 100644 +--- a/fs/jbd2/commit.c ++++ b/fs/jbd2/commit.c +@@ -278,7 +278,7 @@ static inline void write_tag_block(int tag_bytes, journal_block_tag_t *tag, + unsigned long long block) + { + tag->t_blocknr = cpu_to_be32(block & (u32)~0); +- if (tag_bytes > JBD_TAG_SIZE32) ++ if (tag_bytes > JBD2_TAG_SIZE32) + tag->t_blocknr_high = cpu_to_be32((block >> 31) >> 1); + } + +diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c +index f12c65b..ff07bff 100644 +--- a/fs/jbd2/journal.c ++++ b/fs/jbd2/journal.c +@@ -670,7 +670,7 @@ static journal_t * journal_init_common (void) + spin_lock_init(&journal->j_list_lock); + spin_lock_init(&journal->j_state_lock); + +- journal->j_commit_interval = (HZ * JBD_DEFAULT_MAX_COMMIT_AGE); ++ journal->j_commit_interval = (HZ * JBD2_DEFAULT_MAX_COMMIT_AGE); + + /* The journal is marked for error until we succeed with recovery! */ + journal->j_flags = JBD2_ABORT; +@@ -1612,9 +1612,9 @@ int jbd2_journal_blocks_per_page(struct inode *inode) + size_t journal_tag_bytes(journal_t *journal) + { + if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT)) +- return JBD_TAG_SIZE64; ++ return JBD2_TAG_SIZE64; + else +- return JBD_TAG_SIZE32; ++ return JBD2_TAG_SIZE32; + } + + /* +@@ -1681,7 +1681,7 @@ static void journal_free_journal_head(struct journal_head *jh) + { + #ifdef CONFIG_JBD2_DEBUG + atomic_dec(&nr_journal_heads); +- memset(jh, JBD_POISON_FREE, sizeof(*jh)); ++ memset(jh, JBD2_POISON_FREE, sizeof(*jh)); + #endif + kmem_cache_free(jbd2_journal_head_cache, jh); + } +diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c +index b50be8a..d0ce627 100644 +--- a/fs/jbd2/recovery.c ++++ b/fs/jbd2/recovery.c +@@ -311,7 +311,7 @@ int jbd2_journal_skip_recovery(journal_t *journal) + static inline unsigned long long read_tag_block(int tag_bytes, journal_block_tag_t *tag) + { + unsigned long long block = be32_to_cpu(tag->t_blocknr); +- if (tag_bytes > JBD_TAG_SIZE32) ++ if (tag_bytes > JBD2_TAG_SIZE32) + block |= (u64)be32_to_cpu(tag->t_blocknr_high) << 32; + return block; + } +diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c +index 01d8897..3595fd4 100644 +--- a/fs/jbd2/revoke.c ++++ b/fs/jbd2/revoke.c +@@ -352,7 +352,7 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr, + if (bh) + BUFFER_TRACE(bh, "found on hash"); + } +-#ifdef JBD_EXPENSIVE_CHECKING ++#ifdef JBD2_EXPENSIVE_CHECKING + else { + struct buffer_head *bh2; + +@@ -453,7 +453,7 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh) + } + } + +-#ifdef JBD_EXPENSIVE_CHECKING ++#ifdef JBD2_EXPENSIVE_CHECKING + /* There better not be one left behind by now! */ + record = find_revoke_record(journal, bh->b_blocknr); + J_ASSERT_JH(jh, record == NULL); +diff --git a/include/linux/ext4_jbd2.h b/include/linux/ext4_jbd2.h +index d716e63..38c71d3 100644 +--- a/include/linux/ext4_jbd2.h ++++ b/include/linux/ext4_jbd2.h @@ -12,8 +12,8 @@ * Ext4-specific journaling extensions. */ @@ -44,16 +130,16 @@ Index: linux-2.6.23-rc6/include/linux/ext4_jbd2.h #include #include -@@ -228,4 +228,4 @@ static inline int ext4_should_writeback_ +@@ -228,4 +228,4 @@ static inline int ext4_should_writeback_data(struct inode *inode) return 0; } -#endif /* _LINUX_EXT4_JBD_H */ +#endif /* _LINUX_EXT4_JBD2_H */ -Index: linux-2.6.23-rc6/include/linux/jbd2.h -=================================================================== ---- linux-2.6.23-rc6.orig/include/linux/jbd2.h 2007-09-21 09:07:09.000000000 -0700 -+++ linux-2.6.23-rc6/include/linux/jbd2.h 2007-09-21 16:27:46.000000000 -0700 +diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h +index 5f8b876..06ef114 100644 +--- a/include/linux/jbd2.h ++++ b/include/linux/jbd2.h @@ -13,8 +13,8 @@ * filesystem journaling support. */ @@ -120,7 +206,7 @@ Index: linux-2.6.23-rc6/include/linux/jbd2.h #define J_ASSERT(assert) \ do { \ if (!(assert)) { \ -@@ -284,9 +284,9 @@ void buffer_assertion_failure(struct buf +@@ -284,9 +284,9 @@ void buffer_assertion_failure(struct buffer_head *bh); #else #define J_ASSERT(assert) do { } while (0) @@ -132,104 +218,23 @@ Index: linux-2.6.23-rc6/include/linux/jbd2.h #define J_EXPECT(expr, why...) J_ASSERT(expr) #define J_EXPECT_BH(bh, expr, why...) J_ASSERT_BH(bh, expr) #define J_EXPECT_JH(jh, expr, why...) J_ASSERT_JH(jh, expr) -@@ -1104,4 +1104,4 @@ extern int jbd_blocks_per_page(struct in +@@ -1104,4 +1104,4 @@ extern int jbd_blocks_per_page(struct inode *inode); #endif /* __KERNEL__ */ -#endif /* _LINUX_JBD_H */ +#endif /* _LINUX_JBD2_H */ -Index: linux-2.6.23-rc6/fs/jbd2/commit.c -=================================================================== ---- linux-2.6.23-rc6.orig/fs/jbd2/commit.c 2007-09-21 09:07:09.000000000 -0700 -+++ linux-2.6.23-rc6/fs/jbd2/commit.c 2007-09-21 16:27:46.000000000 -0700 -@@ -278,7 +278,7 @@ static inline void write_tag_block(int t - unsigned long long block) - { - tag->t_blocknr = cpu_to_be32(block & (u32)~0); -- if (tag_bytes > JBD_TAG_SIZE32) -+ if (tag_bytes > JBD2_TAG_SIZE32) - tag->t_blocknr_high = cpu_to_be32((block >> 31) >> 1); - } - -Index: linux-2.6.23-rc6/fs/jbd2/journal.c -=================================================================== ---- linux-2.6.23-rc6.orig/fs/jbd2/journal.c 2007-09-21 16:25:46.000000000 -0700 -+++ linux-2.6.23-rc6/fs/jbd2/journal.c 2007-09-21 16:27:46.000000000 -0700 -@@ -670,7 +670,7 @@ static journal_t * journal_init_common ( - spin_lock_init(&journal->j_list_lock); - spin_lock_init(&journal->j_state_lock); - -- journal->j_commit_interval = (HZ * JBD_DEFAULT_MAX_COMMIT_AGE); -+ journal->j_commit_interval = (HZ * JBD2_DEFAULT_MAX_COMMIT_AGE); - - /* The journal is marked for error until we succeed with recovery! */ - journal->j_flags = JBD2_ABORT; -@@ -1612,9 +1612,9 @@ int jbd2_journal_blocks_per_page(struct - size_t journal_tag_bytes(journal_t *journal) - { - if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT)) -- return JBD_TAG_SIZE64; -+ return JBD2_TAG_SIZE64; - else -- return JBD_TAG_SIZE32; -+ return JBD2_TAG_SIZE32; - } - - /* -@@ -1681,7 +1681,7 @@ static void journal_free_journal_head(st - { - #ifdef CONFIG_JBD2_DEBUG - atomic_dec(&nr_journal_heads); -- memset(jh, JBD_POISON_FREE, sizeof(*jh)); -+ memset(jh, JBD2_POISON_FREE, sizeof(*jh)); - #endif - kmem_cache_free(jbd2_journal_head_cache, jh); - } -Index: linux-2.6.23-rc6/fs/jbd2/recovery.c -=================================================================== ---- linux-2.6.23-rc6.orig/fs/jbd2/recovery.c 2007-09-21 09:07:05.000000000 -0700 -+++ linux-2.6.23-rc6/fs/jbd2/recovery.c 2007-09-21 16:27:46.000000000 -0700 -@@ -311,7 +311,7 @@ int jbd2_journal_skip_recovery(journal_t - static inline unsigned long long read_tag_block(int tag_bytes, journal_block_tag_t *tag) - { - unsigned long long block = be32_to_cpu(tag->t_blocknr); -- if (tag_bytes > JBD_TAG_SIZE32) -+ if (tag_bytes > JBD2_TAG_SIZE32) - block |= (u64)be32_to_cpu(tag->t_blocknr_high) << 32; - return block; - } -Index: linux-2.6.23-rc6/fs/jbd2/revoke.c -=================================================================== ---- linux-2.6.23-rc6.orig/fs/jbd2/revoke.c 2007-09-19 14:23:45.000000000 -0700 -+++ linux-2.6.23-rc6/fs/jbd2/revoke.c 2007-09-21 16:27:46.000000000 -0700 -@@ -352,7 +352,7 @@ int jbd2_journal_revoke(handle_t *handle - if (bh) - BUFFER_TRACE(bh, "found on hash"); - } --#ifdef JBD_EXPENSIVE_CHECKING -+#ifdef JBD2_EXPENSIVE_CHECKING - else { - struct buffer_head *bh2; +diff --git a/include/linux/poison.h b/include/linux/poison.h +index d93c300..a9c31be 100644 +--- a/include/linux/poison.h ++++ b/include/linux/poison.h +@@ -36,7 +36,8 @@ + */ -@@ -453,7 +453,7 @@ int jbd2_journal_cancel_revoke(handle_t - } - } + /********** fs/jbd/journal.c **********/ +-#define JBD_POISON_FREE 0x5b ++#define JBD_POISON_FREE 0x5b ++#define JBD2_POISON_FREE 0x5c --#ifdef JBD_EXPENSIVE_CHECKING -+#ifdef JBD2_EXPENSIVE_CHECKING - /* There better not be one left behind by now! */ - record = find_revoke_record(journal, bh->b_blocknr); - J_ASSERT_JH(jh, record == NULL); -Index: linux-2.6.23-rc6/fs/ext4/extents.c -=================================================================== ---- linux-2.6.23-rc6.orig/fs/ext4/extents.c 2007-09-21 09:07:04.000000000 -0700 -+++ linux-2.6.23-rc6/fs/ext4/extents.c 2007-09-21 16:27:46.000000000 -0700 -@@ -33,7 +33,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include + /********** drivers/base/dmapool.c **********/ + #define POOL_POISON_FREED 0xa7 /* !inuse */ -- 2.11.4.GIT