diff options
Diffstat (limited to 'include/linux/jbd2.h')
-rw-r--r-- | include/linux/jbd2.h | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 260d6d76c5f3..06ef11457051 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -13,8 +13,8 @@ | |||
13 | * filesystem journaling support. | 13 | * filesystem journaling support. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #ifndef _LINUX_JBD_H | 16 | #ifndef _LINUX_JBD2_H |
17 | #define _LINUX_JBD_H | 17 | #define _LINUX_JBD2_H |
18 | 18 | ||
19 | /* Allow this file to be included directly into e2fsprogs */ | 19 | /* Allow this file to be included directly into e2fsprogs */ |
20 | #ifndef __KERNEL__ | 20 | #ifndef __KERNEL__ |
@@ -37,26 +37,26 @@ | |||
37 | #define journal_oom_retry 1 | 37 | #define journal_oom_retry 1 |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * Define JBD_PARANIOD_IOFAIL to cause a kernel BUG() if ext3 finds | 40 | * Define JBD2_PARANIOD_IOFAIL to cause a kernel BUG() if ext4 finds |
41 | * certain classes of error which can occur due to failed IOs. Under | 41 | * certain classes of error which can occur due to failed IOs. Under |
42 | * normal use we want ext3 to continue after such errors, because | 42 | * normal use we want ext4 to continue after such errors, because |
43 | * hardware _can_ fail, but for debugging purposes when running tests on | 43 | * hardware _can_ fail, but for debugging purposes when running tests on |
44 | * known-good hardware we may want to trap these errors. | 44 | * known-good hardware we may want to trap these errors. |
45 | */ | 45 | */ |
46 | #undef JBD_PARANOID_IOFAIL | 46 | #undef JBD2_PARANOID_IOFAIL |
47 | 47 | ||
48 | /* | 48 | /* |
49 | * The default maximum commit age, in seconds. | 49 | * The default maximum commit age, in seconds. |
50 | */ | 50 | */ |
51 | #define JBD_DEFAULT_MAX_COMMIT_AGE 5 | 51 | #define JBD2_DEFAULT_MAX_COMMIT_AGE 5 |
52 | 52 | ||
53 | #ifdef CONFIG_JBD2_DEBUG | 53 | #ifdef CONFIG_JBD2_DEBUG |
54 | /* | 54 | /* |
55 | * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal | 55 | * Define JBD2_EXPENSIVE_CHECKING to enable more expensive internal |
56 | * consistency checks. By default we don't do this unless | 56 | * consistency checks. By default we don't do this unless |
57 | * CONFIG_JBD2_DEBUG is on. | 57 | * CONFIG_JBD2_DEBUG is on. |
58 | */ | 58 | */ |
59 | #define JBD_EXPENSIVE_CHECKING | 59 | #define JBD2_EXPENSIVE_CHECKING |
60 | extern u8 jbd2_journal_enable_debug; | 60 | extern u8 jbd2_journal_enable_debug; |
61 | 61 | ||
62 | #define jbd_debug(n, f, a...) \ | 62 | #define jbd_debug(n, f, a...) \ |
@@ -71,14 +71,15 @@ extern u8 jbd2_journal_enable_debug; | |||
71 | #define jbd_debug(f, a...) /**/ | 71 | #define jbd_debug(f, a...) /**/ |
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | extern void * __jbd2_kmalloc (const char *where, size_t size, gfp_t flags, int retry); | 74 | static inline void *jbd2_alloc(size_t size, gfp_t flags) |
75 | extern void * jbd2_slab_alloc(size_t size, gfp_t flags); | 75 | { |
76 | extern void jbd2_slab_free(void *ptr, size_t size); | 76 | return (void *)__get_free_pages(flags, get_order(size)); |
77 | } | ||
77 | 78 | ||
78 | #define jbd_kmalloc(size, flags) \ | 79 | static inline void jbd2_free(void *ptr, size_t size) |
79 | __jbd2_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry) | 80 | { |
80 | #define jbd_rep_kmalloc(size, flags) \ | 81 | free_pages((unsigned long)ptr, get_order(size)); |
81 | __jbd2_kmalloc(__FUNCTION__, (size), (flags), 1) | 82 | }; |
82 | 83 | ||
83 | #define JBD2_MIN_JOURNAL_BLOCKS 1024 | 84 | #define JBD2_MIN_JOURNAL_BLOCKS 1024 |
84 | 85 | ||
@@ -162,8 +163,8 @@ typedef struct journal_block_tag_s | |||
162 | __be32 t_blocknr_high; /* most-significant high 32bits. */ | 163 | __be32 t_blocknr_high; /* most-significant high 32bits. */ |
163 | } journal_block_tag_t; | 164 | } journal_block_tag_t; |
164 | 165 | ||
165 | #define JBD_TAG_SIZE32 (offsetof(journal_block_tag_t, t_blocknr_high)) | 166 | #define JBD2_TAG_SIZE32 (offsetof(journal_block_tag_t, t_blocknr_high)) |
166 | #define JBD_TAG_SIZE64 (sizeof(journal_block_tag_t)) | 167 | #define JBD2_TAG_SIZE64 (sizeof(journal_block_tag_t)) |
167 | 168 | ||
168 | /* | 169 | /* |
169 | * The revoke descriptor: used on disk to describe a series of blocks to | 170 | * The revoke descriptor: used on disk to describe a series of blocks to |
@@ -255,8 +256,8 @@ typedef struct journal_superblock_s | |||
255 | #include <linux/fs.h> | 256 | #include <linux/fs.h> |
256 | #include <linux/sched.h> | 257 | #include <linux/sched.h> |
257 | 258 | ||
258 | #define JBD_ASSERTIONS | 259 | #define JBD2_ASSERTIONS |
259 | #ifdef JBD_ASSERTIONS | 260 | #ifdef JBD2_ASSERTIONS |
260 | #define J_ASSERT(assert) \ | 261 | #define J_ASSERT(assert) \ |
261 | do { \ | 262 | do { \ |
262 | if (!(assert)) { \ | 263 | if (!(assert)) { \ |
@@ -283,9 +284,9 @@ void buffer_assertion_failure(struct buffer_head *bh); | |||
283 | 284 | ||
284 | #else | 285 | #else |
285 | #define J_ASSERT(assert) do { } while (0) | 286 | #define J_ASSERT(assert) do { } while (0) |
286 | #endif /* JBD_ASSERTIONS */ | 287 | #endif /* JBD2_ASSERTIONS */ |
287 | 288 | ||
288 | #if defined(JBD_PARANOID_IOFAIL) | 289 | #if defined(JBD2_PARANOID_IOFAIL) |
289 | #define J_EXPECT(expr, why...) J_ASSERT(expr) | 290 | #define J_EXPECT(expr, why...) J_ASSERT(expr) |
290 | #define J_EXPECT_BH(bh, expr, why...) J_ASSERT_BH(bh, expr) | 291 | #define J_EXPECT_BH(bh, expr, why...) J_ASSERT_BH(bh, expr) |
291 | #define J_EXPECT_JH(jh, expr, why...) J_ASSERT_JH(jh, expr) | 292 | #define J_EXPECT_JH(jh, expr, why...) J_ASSERT_JH(jh, expr) |
@@ -959,12 +960,12 @@ void jbd2_journal_put_journal_head(struct journal_head *jh); | |||
959 | */ | 960 | */ |
960 | extern struct kmem_cache *jbd2_handle_cache; | 961 | extern struct kmem_cache *jbd2_handle_cache; |
961 | 962 | ||
962 | static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags) | 963 | static inline handle_t *jbd2_alloc_handle(gfp_t gfp_flags) |
963 | { | 964 | { |
964 | return kmem_cache_alloc(jbd2_handle_cache, gfp_flags); | 965 | return kmem_cache_alloc(jbd2_handle_cache, gfp_flags); |
965 | } | 966 | } |
966 | 967 | ||
967 | static inline void jbd_free_handle(handle_t *handle) | 968 | static inline void jbd2_free_handle(handle_t *handle) |
968 | { | 969 | { |
969 | kmem_cache_free(jbd2_handle_cache, handle); | 970 | kmem_cache_free(jbd2_handle_cache, handle); |
970 | } | 971 | } |
@@ -1103,4 +1104,4 @@ extern int jbd_blocks_per_page(struct inode *inode); | |||
1103 | 1104 | ||
1104 | #endif /* __KERNEL__ */ | 1105 | #endif /* __KERNEL__ */ |
1105 | 1106 | ||
1106 | #endif /* _LINUX_JBD_H */ | 1107 | #endif /* _LINUX_JBD2_H */ |