[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1184573972.4005.21.camel@localhost.localdomain>
Date: Mon, 16 Jul 2007 01:19:32 -0700
From: Mingming Cao <cmm@...ibm.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-ext4@...r.kernel.org
Subject: [PATCH 1/1] ext4: JBD->JBD2 naming cleanups
On Tue, 2007-07-10 at 16:30 -0700, Andrew Morton wrote:
> > Index: linux-2.6.22-rc4/include/linux/jbd2.h
> > ===================================================================
> > --- linux-2.6.22-rc4.orig/include/linux/jbd2.h 2007-06-11 16:16:18.000000000 -0700
> > +++ linux-2.6.22-rc4/include/linux/jbd2.h 2007-06-11 16:35:25.000000000 -0700
> > @@ -57,7 +57,7 @@
> > * CONFIG_JBD2_DEBUG is on.
> > */
> > #define JBD_EXPENSIVE_CHECKING
>
> JBD2?
>
Some cleanups in ext4/JBD2 to follow the naming fules:change micros name
from JBD_XXX to JBD2_XXX.
Signed-off-by: Mingming Cao <cmm@...ibm.com>
---
fs/ext4/extents.c | 2 +-
fs/ext4/super.c | 2 +-
fs/jbd2/commit.c | 2 +-
fs/jbd2/journal.c | 26 +++++++++++++-------------
fs/jbd2/recovery.c | 2 +-
fs/jbd2/revoke.c | 4 ++--
include/linux/ext4_jbd2.h | 6 +++---
include/linux/jbd2.h | 30 +++++++++++++++---------------
8 files changed, 37 insertions(+), 37 deletions(-)
Index: linux-2.6.22/fs/ext4/super.c
===================================================================
--- linux-2.6.22.orig/fs/ext4/super.c 2007-07-13 17:17:29.000000000 -0700
+++ linux-2.6.22/fs/ext4/super.c 2007-07-13 17:17:33.000000000 -0700
@@ -967,7 +967,7 @@ static int parse_options (char *options,
if (option < 0)
return 0;
if (option == 0)
- option = JBD_DEFAULT_MAX_COMMIT_AGE;
+ option = JBD2_DEFAULT_MAX_COMMIT_AGE;
sbi->s_commit_interval = HZ * option;
break;
case Opt_data_journal:
Index: linux-2.6.22/include/linux/ext4_jbd2.h
===================================================================
--- linux-2.6.22.orig/include/linux/ext4_jbd2.h 2007-07-13 17:02:08.000000000 -0700
+++ linux-2.6.22/include/linux/ext4_jbd2.h 2007-07-13 17:39:41.000000000 -0700
@@ -12,8 +12,8 @@
* Ext4-specific journaling extensions.
*/
-#ifndef _LINUX_EXT4_JBD_H
-#define _LINUX_EXT4_JBD_H
+#ifndef _LINUX_EXT4_JBD2_H
+#define _LINUX_EXT4_JBD2_H
#include <linux/fs.h>
#include <linux/jbd2.h>
@@ -228,4 +228,4 @@ static inline int ext4_should_writeback_
return 0;
}
-#endif /* _LINUX_EXT4_JBD_H */
+#endif /* _LINUX_EXT4_JBD2_H */
Index: linux-2.6.22/include/linux/jbd2.h
===================================================================
--- linux-2.6.22.orig/include/linux/jbd2.h 2007-07-13 17:17:28.000000000 -0700
+++ linux-2.6.22/include/linux/jbd2.h 2007-07-13 17:31:33.000000000 -0700
@@ -13,8 +13,8 @@
* filesystem journaling support.
*/
-#ifndef _LINUX_JBD_H
-#define _LINUX_JBD_H
+#ifndef _LINUX_JBD2_H
+#define _LINUX_JBD2_H
/* Allow this file to be included directly into e2fsprogs */
#ifndef __KERNEL__
@@ -37,26 +37,26 @@
#define journal_oom_retry 1
/*
- * Define JBD_PARANIOD_IOFAIL to cause a kernel BUG() if ext3 finds
+ * Define JBD2_PARANIOD_IOFAIL to cause a kernel BUG() if ext4 finds
* certain classes of error which can occur due to failed IOs. Under
- * normal use we want ext3 to continue after such errors, because
+ * normal use we want ext4 to continue after such errors, because
* hardware _can_ fail, but for debugging purposes when running tests on
* known-good hardware we may want to trap these errors.
*/
-#undef JBD_PARANOID_IOFAIL
+#undef JBD2_PARANOID_IOFAIL
/*
* The default maximum commit age, in seconds.
*/
-#define JBD_DEFAULT_MAX_COMMIT_AGE 5
+#define JBD2_DEFAULT_MAX_COMMIT_AGE 5
#ifdef CONFIG_JBD2_DEBUG
/*
- * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal
+ * Define JBD2_EXPENSIVE_CHECKING to enable more expensive internal
* consistency checks. By default we don't do this unless
* CONFIG_JBD2_DEBUG is on.
*/
-#define JBD_EXPENSIVE_CHECKING
+#define JBD2_EXPENSIVE_CHECKING
extern u8 jbd2_journal_enable_debug;
#define jbd_debug(n, f, a...) \
@@ -185,8 +185,8 @@ typedef struct journal_block_tag_s
__be32 t_blocknr_high; /* most-significant high 32bits. */
} journal_block_tag_t;
-#define JBD_TAG_SIZE32 (offsetof(journal_block_tag_t, t_blocknr_high))
-#define JBD_TAG_SIZE64 (sizeof(journal_block_tag_t))
+#define JBD2_TAG_SIZE32 (offsetof(journal_block_tag_t, t_blocknr_high))
+#define JBD2_TAG_SIZE64 (sizeof(journal_block_tag_t))
/*
* The revoke descriptor: used on disk to describe a series of blocks to
@@ -282,8 +282,8 @@ typedef struct journal_superblock_s
#include <linux/fs.h>
#include <linux/sched.h>
-#define JBD_ASSERTIONS
-#ifdef JBD_ASSERTIONS
+#define JBD2_ASSERTIONS
+#ifdef JBD2_ASSERTIONS
#define J_ASSERT(assert) \
do { \
if (!(assert)) { \
@@ -310,9 +310,9 @@ void buffer_assertion_failure(struct buf
#else
#define J_ASSERT(assert) do { } while (0)
-#endif /* JBD_ASSERTIONS */
+#endif /* JBD2_ASSERTIONS */
-#if defined(JBD_PARANOID_IOFAIL)
+#if defined(JBD2_PARANOID_IOFAIL)
#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)
@@ -1224,4 +1224,4 @@ extern int jbd_blocks_per_page(struct in
#endif /* __KERNEL__ */
-#endif /* _LINUX_JBD_H */
+#endif /* _LINUX_JBD2_H */
Index: linux-2.6.22/fs/jbd2/commit.c
===================================================================
--- linux-2.6.22.orig/fs/jbd2/commit.c 2007-07-13 17:20:12.000000000 -0700
+++ linux-2.6.22/fs/jbd2/commit.c 2007-07-13 17:20:39.000000000 -0700
@@ -356,7 +356,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.22/fs/jbd2/journal.c
===================================================================
--- linux-2.6.22.orig/fs/jbd2/journal.c 2007-07-13 17:20:56.000000000 -0700
+++ linux-2.6.22/fs/jbd2/journal.c 2007-07-13 17:21:45.000000000 -0700
@@ -974,7 +974,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;
@@ -1957,9 +1957,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;
}
/*
@@ -1979,11 +1979,11 @@ void * __jbd2_kmalloc (const char *where
* cause bh to cross page boundary.
*/
-#define JBD_MAX_SLABS 5
-#define JBD_SLAB_INDEX(size) (size >> 11)
+#define JBD2_MAX_SLABS 5
+#define JBD2_SLAB_INDEX(size) (size >> 11)
-static struct kmem_cache *jbd_slab[JBD_MAX_SLABS];
-static const char *jbd_slab_names[JBD_MAX_SLABS] = {
+static struct kmem_cache *jbd_slab[JBD2_MAX_SLABS];
+static const char *jbd_slab_names[JBD2_MAX_SLABS] = {
"jbd2_1k", "jbd2_2k", "jbd2_4k", NULL, "jbd2_8k"
};
@@ -1991,7 +1991,7 @@ static void jbd2_journal_destroy_jbd_sla
{
int i;
- for (i = 0; i < JBD_MAX_SLABS; i++) {
+ for (i = 0; i < JBD2_MAX_SLABS; i++) {
if (jbd_slab[i])
kmem_cache_destroy(jbd_slab[i]);
jbd_slab[i] = NULL;
@@ -2000,9 +2000,9 @@ static void jbd2_journal_destroy_jbd_sla
static int jbd2_journal_create_jbd_slab(size_t slab_size)
{
- int i = JBD_SLAB_INDEX(slab_size);
+ int i = JBD2_SLAB_INDEX(slab_size);
- BUG_ON(i >= JBD_MAX_SLABS);
+ BUG_ON(i >= JBD2_MAX_SLABS);
/*
* Check if we already have a slab created for this size
@@ -2028,7 +2028,7 @@ void * jbd2_slab_alloc(size_t size, gfp_
{
int idx;
- idx = JBD_SLAB_INDEX(size);
+ idx = JBD2_SLAB_INDEX(size);
BUG_ON(jbd_slab[idx] == NULL);
return kmem_cache_alloc(jbd_slab[idx], flags | __GFP_NOFAIL);
}
@@ -2037,7 +2037,7 @@ void jbd2_slab_free(void *ptr, size_t s
{
int idx;
- idx = JBD_SLAB_INDEX(size);
+ idx = JBD2_SLAB_INDEX(size);
BUG_ON(jbd_slab[idx] == NULL);
kmem_cache_free(jbd_slab[idx], ptr);
}
@@ -2107,7 +2107,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.22/fs/jbd2/recovery.c
===================================================================
--- linux-2.6.22.orig/fs/jbd2/recovery.c 2007-07-13 17:21:58.000000000 -0700
+++ linux-2.6.22/fs/jbd2/recovery.c 2007-07-13 17:22:08.000000000 -0700
@@ -312,7 +312,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.22/fs/jbd2/revoke.c
===================================================================
--- linux-2.6.22.orig/fs/jbd2/revoke.c 2007-07-13 17:22:26.000000000 -0700
+++ linux-2.6.22/fs/jbd2/revoke.c 2007-07-13 17:22:42.000000000 -0700
@@ -351,7 +351,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;
@@ -452,7 +452,7 @@ int jbd2_journal_cancel_revoke(handle_t
}
}
-#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.22/fs/ext4/extents.c
===================================================================
--- linux-2.6.22.orig/fs/ext4/extents.c 2007-07-13 17:59:00.000000000 -0700
+++ linux-2.6.22/fs/ext4/extents.c 2007-07-13 17:59:44.000000000 -0700
@@ -33,7 +33,7 @@
#include <linux/fs.h>
#include <linux/time.h>
#include <linux/ext4_jbd2.h>
-#include <linux/jbd.h>
+#include <linux/jbd2.h>
#include <linux/highuid.h>
#include <linux/pagemap.h>
#include <linux/quotaops.h>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists