aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/jbd2.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/jbd2.h')
-rw-r--r--include/linux/jbd2.h34
1 files changed, 9 insertions, 25 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 638ce4554c76..adf832dec3f3 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -30,6 +30,7 @@
30#include <linux/bit_spinlock.h> 30#include <linux/bit_spinlock.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/timer.h> 32#include <linux/timer.h>
33#include <linux/slab.h>
33#endif 34#endif
34 35
35#define journal_oom_retry 1 36#define journal_oom_retry 1
@@ -69,15 +70,8 @@ extern u8 jbd2_journal_enable_debug;
69#define jbd_debug(f, a...) /**/ 70#define jbd_debug(f, a...) /**/
70#endif 71#endif
71 72
72static inline void *jbd2_alloc(size_t size, gfp_t flags) 73extern void *jbd2_alloc(size_t size, gfp_t flags);
73{ 74extern void jbd2_free(void *ptr, size_t size);
74 return (void *)__get_free_pages(flags, get_order(size));
75}
76
77static inline void jbd2_free(void *ptr, size_t size)
78{
79 free_pages((unsigned long)ptr, get_order(size));
80};
81 75
82#define JBD2_MIN_JOURNAL_BLOCKS 1024 76#define JBD2_MIN_JOURNAL_BLOCKS 1024
83 77
@@ -284,19 +278,8 @@ typedef struct journal_superblock_s
284 278
285#define J_ASSERT(assert) BUG_ON(!(assert)) 279#define J_ASSERT(assert) BUG_ON(!(assert))
286 280
287#if defined(CONFIG_BUFFER_DEBUG)
288void buffer_assertion_failure(struct buffer_head *bh);
289#define J_ASSERT_BH(bh, expr) \
290 do { \
291 if (!(expr)) \
292 buffer_assertion_failure(bh); \
293 J_ASSERT(expr); \
294 } while (0)
295#define J_ASSERT_JH(jh, expr) J_ASSERT_BH(jh2bh(jh), expr)
296#else
297#define J_ASSERT_BH(bh, expr) J_ASSERT(expr) 281#define J_ASSERT_BH(bh, expr) J_ASSERT(expr)
298#define J_ASSERT_JH(jh, expr) J_ASSERT(expr) 282#define J_ASSERT_JH(jh, expr) J_ASSERT(expr)
299#endif
300 283
301#if defined(JBD2_PARANOID_IOFAIL) 284#if defined(JBD2_PARANOID_IOFAIL)
302#define J_EXPECT(expr, why...) J_ASSERT(expr) 285#define J_EXPECT(expr, why...) J_ASSERT(expr)
@@ -1043,11 +1026,12 @@ void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *);
1043 1026
1044struct jbd2_buffer_trigger_type { 1027struct jbd2_buffer_trigger_type {
1045 /* 1028 /*
1046 * Fired just before a buffer is written to the journal. 1029 * Fired a the moment data to write to the journal are known to be
1047 * mapped_data is a mapped buffer that is the frozen data for 1030 * stable - so either at the moment b_frozen_data is created or just
1048 * commit. 1031 * before a buffer is written to the journal. mapped_data is a mapped
1032 * buffer that is the frozen data for commit.
1049 */ 1033 */
1050 void (*t_commit)(struct jbd2_buffer_trigger_type *type, 1034 void (*t_frozen)(struct jbd2_buffer_trigger_type *type,
1051 struct buffer_head *bh, void *mapped_data, 1035 struct buffer_head *bh, void *mapped_data,
1052 size_t size); 1036 size_t size);
1053 1037
@@ -1059,7 +1043,7 @@ struct jbd2_buffer_trigger_type {
1059 struct buffer_head *bh); 1043 struct buffer_head *bh);
1060}; 1044};
1061 1045
1062extern void jbd2_buffer_commit_trigger(struct journal_head *jh, 1046extern void jbd2_buffer_frozen_trigger(struct journal_head *jh,
1063 void *mapped_data, 1047 void *mapped_data,
1064 struct jbd2_buffer_trigger_type *triggers); 1048 struct jbd2_buffer_trigger_type *triggers);
1065extern void jbd2_buffer_abort_trigger(struct journal_head *jh, 1049extern void jbd2_buffer_abort_trigger(struct journal_head *jh,