diff options
Diffstat (limited to 'include/linux/jbd2.h')
-rw-r--r-- | include/linux/jbd2.h | 248 |
1 files changed, 124 insertions, 124 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index fe89444b1c6f..3251f7abb57d 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/jbd.h | 2 | * linux/include/linux/jbd2.h |
3 | * | 3 | * |
4 | * Written by Stephen C. Tweedie <sct@redhat.com> | 4 | * Written by Stephen C. Tweedie <sct@redhat.com> |
5 | * | 5 | * |
@@ -19,7 +19,7 @@ | |||
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__ |
21 | #include "jfs_compat.h" | 21 | #include "jfs_compat.h" |
22 | #define JFS_DEBUG | 22 | #define JBD2_DEBUG |
23 | #define jfs_debug jbd_debug | 23 | #define jfs_debug jbd_debug |
24 | #else | 24 | #else |
25 | 25 | ||
@@ -57,11 +57,11 @@ | |||
57 | * CONFIG_JBD_DEBUG is on. | 57 | * CONFIG_JBD_DEBUG is on. |
58 | */ | 58 | */ |
59 | #define JBD_EXPENSIVE_CHECKING | 59 | #define JBD_EXPENSIVE_CHECKING |
60 | extern int journal_enable_debug; | 60 | extern int jbd2_journal_enable_debug; |
61 | 61 | ||
62 | #define jbd_debug(n, f, a...) \ | 62 | #define jbd_debug(n, f, a...) \ |
63 | do { \ | 63 | do { \ |
64 | if ((n) <= journal_enable_debug) { \ | 64 | if ((n) <= jbd2_journal_enable_debug) { \ |
65 | printk (KERN_DEBUG "(%s, %d): %s: ", \ | 65 | printk (KERN_DEBUG "(%s, %d): %s: ", \ |
66 | __FILE__, __LINE__, __FUNCTION__); \ | 66 | __FILE__, __LINE__, __FUNCTION__); \ |
67 | printk (f, ## a); \ | 67 | printk (f, ## a); \ |
@@ -71,16 +71,16 @@ extern int journal_enable_debug; | |||
71 | #define jbd_debug(f, a...) /**/ | 71 | #define jbd_debug(f, a...) /**/ |
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | extern void * __jbd_kmalloc (const char *where, size_t size, gfp_t flags, int retry); | 74 | extern void * __jbd2_kmalloc (const char *where, size_t size, gfp_t flags, int retry); |
75 | extern void * jbd_slab_alloc(size_t size, gfp_t flags); | 75 | extern void * jbd2_slab_alloc(size_t size, gfp_t flags); |
76 | extern void jbd_slab_free(void *ptr, size_t size); | 76 | extern void jbd2_slab_free(void *ptr, size_t size); |
77 | 77 | ||
78 | #define jbd_kmalloc(size, flags) \ | 78 | #define jbd_kmalloc(size, flags) \ |
79 | __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry) | 79 | __jbd2_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry) |
80 | #define jbd_rep_kmalloc(size, flags) \ | 80 | #define jbd_rep_kmalloc(size, flags) \ |
81 | __jbd_kmalloc(__FUNCTION__, (size), (flags), 1) | 81 | __jbd2_kmalloc(__FUNCTION__, (size), (flags), 1) |
82 | 82 | ||
83 | #define JFS_MIN_JOURNAL_BLOCKS 1024 | 83 | #define JBD2_MIN_JOURNAL_BLOCKS 1024 |
84 | 84 | ||
85 | #ifdef __KERNEL__ | 85 | #ifdef __KERNEL__ |
86 | 86 | ||
@@ -122,7 +122,7 @@ typedef struct journal_s journal_t; /* Journal control structure */ | |||
122 | * Internal structures used by the logging mechanism: | 122 | * Internal structures used by the logging mechanism: |
123 | */ | 123 | */ |
124 | 124 | ||
125 | #define JFS_MAGIC_NUMBER 0xc03b3998U /* The first 4 bytes of /dev/random! */ | 125 | #define JBD2_MAGIC_NUMBER 0xc03b3998U /* The first 4 bytes of /dev/random! */ |
126 | 126 | ||
127 | /* | 127 | /* |
128 | * On-disk structures | 128 | * On-disk structures |
@@ -132,11 +132,11 @@ typedef struct journal_s journal_t; /* Journal control structure */ | |||
132 | * Descriptor block types: | 132 | * Descriptor block types: |
133 | */ | 133 | */ |
134 | 134 | ||
135 | #define JFS_DESCRIPTOR_BLOCK 1 | 135 | #define JBD2_DESCRIPTOR_BLOCK 1 |
136 | #define JFS_COMMIT_BLOCK 2 | 136 | #define JBD2_COMMIT_BLOCK 2 |
137 | #define JFS_SUPERBLOCK_V1 3 | 137 | #define JBD2_SUPERBLOCK_V1 3 |
138 | #define JFS_SUPERBLOCK_V2 4 | 138 | #define JBD2_SUPERBLOCK_V2 4 |
139 | #define JFS_REVOKE_BLOCK 5 | 139 | #define JBD2_REVOKE_BLOCK 5 |
140 | 140 | ||
141 | /* | 141 | /* |
142 | * Standard header for all descriptor blocks: | 142 | * Standard header for all descriptor blocks: |
@@ -162,18 +162,18 @@ typedef struct journal_block_tag_s | |||
162 | * The revoke descriptor: used on disk to describe a series of blocks to | 162 | * The revoke descriptor: used on disk to describe a series of blocks to |
163 | * be revoked from the log | 163 | * be revoked from the log |
164 | */ | 164 | */ |
165 | typedef struct journal_revoke_header_s | 165 | typedef struct jbd2_journal_revoke_header_s |
166 | { | 166 | { |
167 | journal_header_t r_header; | 167 | journal_header_t r_header; |
168 | __be32 r_count; /* Count of bytes used in the block */ | 168 | __be32 r_count; /* Count of bytes used in the block */ |
169 | } journal_revoke_header_t; | 169 | } jbd2_journal_revoke_header_t; |
170 | 170 | ||
171 | 171 | ||
172 | /* Definitions for the journal tag flags word: */ | 172 | /* Definitions for the journal tag flags word: */ |
173 | #define JFS_FLAG_ESCAPE 1 /* on-disk block is escaped */ | 173 | #define JBD2_FLAG_ESCAPE 1 /* on-disk block is escaped */ |
174 | #define JFS_FLAG_SAME_UUID 2 /* block has same uuid as previous */ | 174 | #define JBD2_FLAG_SAME_UUID 2 /* block has same uuid as previous */ |
175 | #define JFS_FLAG_DELETED 4 /* block deleted by this transaction */ | 175 | #define JBD2_FLAG_DELETED 4 /* block deleted by this transaction */ |
176 | #define JFS_FLAG_LAST_TAG 8 /* last tag in this descriptor block */ | 176 | #define JBD2_FLAG_LAST_TAG 8 /* last tag in this descriptor block */ |
177 | 177 | ||
178 | 178 | ||
179 | /* | 179 | /* |
@@ -196,7 +196,7 @@ typedef struct journal_superblock_s | |||
196 | __be32 s_start; /* blocknr of start of log */ | 196 | __be32 s_start; /* blocknr of start of log */ |
197 | 197 | ||
198 | /* 0x0020 */ | 198 | /* 0x0020 */ |
199 | /* Error value, as set by journal_abort(). */ | 199 | /* Error value, as set by jbd2_journal_abort(). */ |
200 | __be32 s_errno; | 200 | __be32 s_errno; |
201 | 201 | ||
202 | /* 0x0024 */ | 202 | /* 0x0024 */ |
@@ -224,22 +224,22 @@ typedef struct journal_superblock_s | |||
224 | /* 0x0400 */ | 224 | /* 0x0400 */ |
225 | } journal_superblock_t; | 225 | } journal_superblock_t; |
226 | 226 | ||
227 | #define JFS_HAS_COMPAT_FEATURE(j,mask) \ | 227 | #define JBD2_HAS_COMPAT_FEATURE(j,mask) \ |
228 | ((j)->j_format_version >= 2 && \ | 228 | ((j)->j_format_version >= 2 && \ |
229 | ((j)->j_superblock->s_feature_compat & cpu_to_be32((mask)))) | 229 | ((j)->j_superblock->s_feature_compat & cpu_to_be32((mask)))) |
230 | #define JFS_HAS_RO_COMPAT_FEATURE(j,mask) \ | 230 | #define JBD2_HAS_RO_COMPAT_FEATURE(j,mask) \ |
231 | ((j)->j_format_version >= 2 && \ | 231 | ((j)->j_format_version >= 2 && \ |
232 | ((j)->j_superblock->s_feature_ro_compat & cpu_to_be32((mask)))) | 232 | ((j)->j_superblock->s_feature_ro_compat & cpu_to_be32((mask)))) |
233 | #define JFS_HAS_INCOMPAT_FEATURE(j,mask) \ | 233 | #define JBD2_HAS_INCOMPAT_FEATURE(j,mask) \ |
234 | ((j)->j_format_version >= 2 && \ | 234 | ((j)->j_format_version >= 2 && \ |
235 | ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask)))) | 235 | ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask)))) |
236 | 236 | ||
237 | #define JFS_FEATURE_INCOMPAT_REVOKE 0x00000001 | 237 | #define JBD2_FEATURE_INCOMPAT_REVOKE 0x00000001 |
238 | 238 | ||
239 | /* Features known to this kernel version: */ | 239 | /* Features known to this kernel version: */ |
240 | #define JFS_KNOWN_COMPAT_FEATURES 0 | 240 | #define JBD2_KNOWN_COMPAT_FEATURES 0 |
241 | #define JFS_KNOWN_ROCOMPAT_FEATURES 0 | 241 | #define JBD2_KNOWN_ROCOMPAT_FEATURES 0 |
242 | #define JFS_KNOWN_INCOMPAT_FEATURES JFS_FEATURE_INCOMPAT_REVOKE | 242 | #define JBD2_KNOWN_INCOMPAT_FEATURES JBD2_FEATURE_INCOMPAT_REVOKE |
243 | 243 | ||
244 | #ifdef __KERNEL__ | 244 | #ifdef __KERNEL__ |
245 | 245 | ||
@@ -359,7 +359,7 @@ static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh) | |||
359 | bit_spin_unlock(BH_JournalHead, &bh->b_state); | 359 | bit_spin_unlock(BH_JournalHead, &bh->b_state); |
360 | } | 360 | } |
361 | 361 | ||
362 | struct jbd_revoke_table_s; | 362 | struct jbd2_revoke_table_s; |
363 | 363 | ||
364 | /** | 364 | /** |
365 | * struct handle_s - The handle_s type is the concrete type associated with | 365 | * struct handle_s - The handle_s type is the concrete type associated with |
@@ -445,7 +445,7 @@ struct transaction_s | |||
445 | 445 | ||
446 | /* | 446 | /* |
447 | * Transaction's current state | 447 | * Transaction's current state |
448 | * [no locking - only kjournald alters this] | 448 | * [no locking - only kjournald2 alters this] |
449 | * FIXME: needs barriers | 449 | * FIXME: needs barriers |
450 | * KLUDGE: [use j_state_lock] | 450 | * KLUDGE: [use j_state_lock] |
451 | */ | 451 | */ |
@@ -621,7 +621,7 @@ struct transaction_s | |||
621 | * @j_revoke: The revoke table - maintains the list of revoked blocks in the | 621 | * @j_revoke: The revoke table - maintains the list of revoked blocks in the |
622 | * current transaction. | 622 | * current transaction. |
623 | * @j_revoke_table: alternate revoke tables for j_revoke | 623 | * @j_revoke_table: alternate revoke tables for j_revoke |
624 | * @j_wbuf: array of buffer_heads for journal_commit_transaction | 624 | * @j_wbuf: array of buffer_heads for jbd2_journal_commit_transaction |
625 | * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the | 625 | * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the |
626 | * number that will fit in j_blocksize | 626 | * number that will fit in j_blocksize |
627 | * @j_last_sync_writer: most recent pid which did a synchronous write | 627 | * @j_last_sync_writer: most recent pid which did a synchronous write |
@@ -805,11 +805,11 @@ struct journal_s | |||
805 | * current transaction. [j_revoke_lock] | 805 | * current transaction. [j_revoke_lock] |
806 | */ | 806 | */ |
807 | spinlock_t j_revoke_lock; | 807 | spinlock_t j_revoke_lock; |
808 | struct jbd_revoke_table_s *j_revoke; | 808 | struct jbd2_revoke_table_s *j_revoke; |
809 | struct jbd_revoke_table_s *j_revoke_table[2]; | 809 | struct jbd2_revoke_table_s *j_revoke_table[2]; |
810 | 810 | ||
811 | /* | 811 | /* |
812 | * array of bhs for journal_commit_transaction | 812 | * array of bhs for jbd2_journal_commit_transaction |
813 | */ | 813 | */ |
814 | struct buffer_head **j_wbuf; | 814 | struct buffer_head **j_wbuf; |
815 | int j_wbufsize; | 815 | int j_wbufsize; |
@@ -826,12 +826,12 @@ struct journal_s | |||
826 | /* | 826 | /* |
827 | * Journal flag definitions | 827 | * Journal flag definitions |
828 | */ | 828 | */ |
829 | #define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */ | 829 | #define JBD2_UNMOUNT 0x001 /* Journal thread is being destroyed */ |
830 | #define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */ | 830 | #define JBD2_ABORT 0x002 /* Journaling has been aborted for errors. */ |
831 | #define JFS_ACK_ERR 0x004 /* The errno in the sb has been acked */ | 831 | #define JBD2_ACK_ERR 0x004 /* The errno in the sb has been acked */ |
832 | #define JFS_FLUSHED 0x008 /* The journal superblock has been flushed */ | 832 | #define JBD2_FLUSHED 0x008 /* The journal superblock has been flushed */ |
833 | #define JFS_LOADED 0x010 /* The journal superblock has been loaded */ | 833 | #define JBD2_LOADED 0x010 /* The journal superblock has been loaded */ |
834 | #define JFS_BARRIER 0x020 /* Use IDE barriers */ | 834 | #define JBD2_BARRIER 0x020 /* Use IDE barriers */ |
835 | 835 | ||
836 | /* | 836 | /* |
837 | * Function declarations for the journaling transaction and buffer | 837 | * Function declarations for the journaling transaction and buffer |
@@ -839,31 +839,31 @@ struct journal_s | |||
839 | */ | 839 | */ |
840 | 840 | ||
841 | /* Filing buffers */ | 841 | /* Filing buffers */ |
842 | extern void __journal_temp_unlink_buffer(struct journal_head *jh); | 842 | extern void __jbd2_journal_temp_unlink_buffer(struct journal_head *jh); |
843 | extern void journal_unfile_buffer(journal_t *, struct journal_head *); | 843 | extern void jbd2_journal_unfile_buffer(journal_t *, struct journal_head *); |
844 | extern void __journal_unfile_buffer(struct journal_head *); | 844 | extern void __jbd2_journal_unfile_buffer(struct journal_head *); |
845 | extern void __journal_refile_buffer(struct journal_head *); | 845 | extern void __jbd2_journal_refile_buffer(struct journal_head *); |
846 | extern void journal_refile_buffer(journal_t *, struct journal_head *); | 846 | extern void jbd2_journal_refile_buffer(journal_t *, struct journal_head *); |
847 | extern void __journal_file_buffer(struct journal_head *, transaction_t *, int); | 847 | extern void __jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int); |
848 | extern void __journal_free_buffer(struct journal_head *bh); | 848 | extern void __journal_free_buffer(struct journal_head *bh); |
849 | extern void journal_file_buffer(struct journal_head *, transaction_t *, int); | 849 | extern void jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int); |
850 | extern void __journal_clean_data_list(transaction_t *transaction); | 850 | extern void __journal_clean_data_list(transaction_t *transaction); |
851 | 851 | ||
852 | /* Log buffer allocation */ | 852 | /* Log buffer allocation */ |
853 | extern struct journal_head * journal_get_descriptor_buffer(journal_t *); | 853 | extern struct journal_head * jbd2_journal_get_descriptor_buffer(journal_t *); |
854 | int journal_next_log_block(journal_t *, unsigned long *); | 854 | int jbd2_journal_next_log_block(journal_t *, unsigned long *); |
855 | 855 | ||
856 | /* Commit management */ | 856 | /* Commit management */ |
857 | extern void journal_commit_transaction(journal_t *); | 857 | extern void jbd2_journal_commit_transaction(journal_t *); |
858 | 858 | ||
859 | /* Checkpoint list management */ | 859 | /* Checkpoint list management */ |
860 | int __journal_clean_checkpoint_list(journal_t *journal); | 860 | int __jbd2_journal_clean_checkpoint_list(journal_t *journal); |
861 | int __journal_remove_checkpoint(struct journal_head *); | 861 | int __jbd2_journal_remove_checkpoint(struct journal_head *); |
862 | void __journal_insert_checkpoint(struct journal_head *, transaction_t *); | 862 | void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *); |
863 | 863 | ||
864 | /* Buffer IO */ | 864 | /* Buffer IO */ |
865 | extern int | 865 | extern int |
866 | journal_write_metadata_buffer(transaction_t *transaction, | 866 | jbd2_journal_write_metadata_buffer(transaction_t *transaction, |
867 | struct journal_head *jh_in, | 867 | struct journal_head *jh_in, |
868 | struct journal_head **jh_out, | 868 | struct journal_head **jh_out, |
869 | unsigned long blocknr); | 869 | unsigned long blocknr); |
@@ -893,91 +893,91 @@ static inline handle_t *journal_current_handle(void) | |||
893 | * Register buffer modifications against the current transaction. | 893 | * Register buffer modifications against the current transaction. |
894 | */ | 894 | */ |
895 | 895 | ||
896 | extern handle_t *journal_start(journal_t *, int nblocks); | 896 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); |
897 | extern int journal_restart (handle_t *, int nblocks); | 897 | extern int jbd2_journal_restart (handle_t *, int nblocks); |
898 | extern int journal_extend (handle_t *, int nblocks); | 898 | extern int jbd2_journal_extend (handle_t *, int nblocks); |
899 | extern int journal_get_write_access(handle_t *, struct buffer_head *); | 899 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); |
900 | extern int journal_get_create_access (handle_t *, struct buffer_head *); | 900 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); |
901 | extern int journal_get_undo_access(handle_t *, struct buffer_head *); | 901 | extern int jbd2_journal_get_undo_access(handle_t *, struct buffer_head *); |
902 | extern int journal_dirty_data (handle_t *, struct buffer_head *); | 902 | extern int jbd2_journal_dirty_data (handle_t *, struct buffer_head *); |
903 | extern int journal_dirty_metadata (handle_t *, struct buffer_head *); | 903 | extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *); |
904 | extern void journal_release_buffer (handle_t *, struct buffer_head *); | 904 | extern void jbd2_journal_release_buffer (handle_t *, struct buffer_head *); |
905 | extern int journal_forget (handle_t *, struct buffer_head *); | 905 | extern int jbd2_journal_forget (handle_t *, struct buffer_head *); |
906 | extern void journal_sync_buffer (struct buffer_head *); | 906 | extern void journal_sync_buffer (struct buffer_head *); |
907 | extern void journal_invalidatepage(journal_t *, | 907 | extern void jbd2_journal_invalidatepage(journal_t *, |
908 | struct page *, unsigned long); | 908 | struct page *, unsigned long); |
909 | extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); | 909 | extern int jbd2_journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); |
910 | extern int journal_stop(handle_t *); | 910 | extern int jbd2_journal_stop(handle_t *); |
911 | extern int journal_flush (journal_t *); | 911 | extern int jbd2_journal_flush (journal_t *); |
912 | extern void journal_lock_updates (journal_t *); | 912 | extern void jbd2_journal_lock_updates (journal_t *); |
913 | extern void journal_unlock_updates (journal_t *); | 913 | extern void jbd2_journal_unlock_updates (journal_t *); |
914 | 914 | ||
915 | extern journal_t * journal_init_dev(struct block_device *bdev, | 915 | extern journal_t * jbd2_journal_init_dev(struct block_device *bdev, |
916 | struct block_device *fs_dev, | 916 | struct block_device *fs_dev, |
917 | int start, int len, int bsize); | 917 | int start, int len, int bsize); |
918 | extern journal_t * journal_init_inode (struct inode *); | 918 | extern journal_t * jbd2_journal_init_inode (struct inode *); |
919 | extern int journal_update_format (journal_t *); | 919 | extern int jbd2_journal_update_format (journal_t *); |
920 | extern int journal_check_used_features | 920 | extern int jbd2_journal_check_used_features |
921 | (journal_t *, unsigned long, unsigned long, unsigned long); | 921 | (journal_t *, unsigned long, unsigned long, unsigned long); |
922 | extern int journal_check_available_features | 922 | extern int jbd2_journal_check_available_features |
923 | (journal_t *, unsigned long, unsigned long, unsigned long); | 923 | (journal_t *, unsigned long, unsigned long, unsigned long); |
924 | extern int journal_set_features | 924 | extern int jbd2_journal_set_features |
925 | (journal_t *, unsigned long, unsigned long, unsigned long); | 925 | (journal_t *, unsigned long, unsigned long, unsigned long); |
926 | extern int journal_create (journal_t *); | 926 | extern int jbd2_journal_create (journal_t *); |
927 | extern int journal_load (journal_t *journal); | 927 | extern int jbd2_journal_load (journal_t *journal); |
928 | extern void journal_destroy (journal_t *); | 928 | extern void jbd2_journal_destroy (journal_t *); |
929 | extern int journal_recover (journal_t *journal); | 929 | extern int jbd2_journal_recover (journal_t *journal); |
930 | extern int journal_wipe (journal_t *, int); | 930 | extern int jbd2_journal_wipe (journal_t *, int); |
931 | extern int journal_skip_recovery (journal_t *); | 931 | extern int jbd2_journal_skip_recovery (journal_t *); |
932 | extern void journal_update_superblock (journal_t *, int); | 932 | extern void jbd2_journal_update_superblock (journal_t *, int); |
933 | extern void __journal_abort_hard (journal_t *); | 933 | extern void __jbd2_journal_abort_hard (journal_t *); |
934 | extern void journal_abort (journal_t *, int); | 934 | extern void jbd2_journal_abort (journal_t *, int); |
935 | extern int journal_errno (journal_t *); | 935 | extern int jbd2_journal_errno (journal_t *); |
936 | extern void journal_ack_err (journal_t *); | 936 | extern void jbd2_journal_ack_err (journal_t *); |
937 | extern int journal_clear_err (journal_t *); | 937 | extern int jbd2_journal_clear_err (journal_t *); |
938 | extern int journal_bmap(journal_t *, unsigned long, unsigned long *); | 938 | extern int jbd2_journal_bmap(journal_t *, unsigned long, unsigned long *); |
939 | extern int journal_force_commit(journal_t *); | 939 | extern int jbd2_journal_force_commit(journal_t *); |
940 | 940 | ||
941 | /* | 941 | /* |
942 | * journal_head management | 942 | * journal_head management |
943 | */ | 943 | */ |
944 | struct journal_head *journal_add_journal_head(struct buffer_head *bh); | 944 | struct journal_head *jbd2_journal_add_journal_head(struct buffer_head *bh); |
945 | struct journal_head *journal_grab_journal_head(struct buffer_head *bh); | 945 | struct journal_head *jbd2_journal_grab_journal_head(struct buffer_head *bh); |
946 | void journal_remove_journal_head(struct buffer_head *bh); | 946 | void jbd2_journal_remove_journal_head(struct buffer_head *bh); |
947 | void journal_put_journal_head(struct journal_head *jh); | 947 | void jbd2_journal_put_journal_head(struct journal_head *jh); |
948 | 948 | ||
949 | /* | 949 | /* |
950 | * handle management | 950 | * handle management |
951 | */ | 951 | */ |
952 | extern kmem_cache_t *jbd_handle_cache; | 952 | extern kmem_cache_t *jbd2_handle_cache; |
953 | 953 | ||
954 | static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags) | 954 | static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags) |
955 | { | 955 | { |
956 | return kmem_cache_alloc(jbd_handle_cache, gfp_flags); | 956 | return kmem_cache_alloc(jbd2_handle_cache, gfp_flags); |
957 | } | 957 | } |
958 | 958 | ||
959 | static inline void jbd_free_handle(handle_t *handle) | 959 | static inline void jbd_free_handle(handle_t *handle) |
960 | { | 960 | { |
961 | kmem_cache_free(jbd_handle_cache, handle); | 961 | kmem_cache_free(jbd2_handle_cache, handle); |
962 | } | 962 | } |
963 | 963 | ||
964 | /* Primary revoke support */ | 964 | /* Primary revoke support */ |
965 | #define JOURNAL_REVOKE_DEFAULT_HASH 256 | 965 | #define JOURNAL_REVOKE_DEFAULT_HASH 256 |
966 | extern int journal_init_revoke(journal_t *, int); | 966 | extern int jbd2_journal_init_revoke(journal_t *, int); |
967 | extern void journal_destroy_revoke_caches(void); | 967 | extern void jbd2_journal_destroy_revoke_caches(void); |
968 | extern int journal_init_revoke_caches(void); | 968 | extern int jbd2_journal_init_revoke_caches(void); |
969 | 969 | ||
970 | extern void journal_destroy_revoke(journal_t *); | 970 | extern void jbd2_journal_destroy_revoke(journal_t *); |
971 | extern int journal_revoke (handle_t *, | 971 | extern int jbd2_journal_revoke (handle_t *, |
972 | unsigned long, struct buffer_head *); | 972 | unsigned long, struct buffer_head *); |
973 | extern int journal_cancel_revoke(handle_t *, struct journal_head *); | 973 | extern int jbd2_journal_cancel_revoke(handle_t *, struct journal_head *); |
974 | extern void journal_write_revoke_records(journal_t *, transaction_t *); | 974 | extern void jbd2_journal_write_revoke_records(journal_t *, transaction_t *); |
975 | 975 | ||
976 | /* Recovery revoke support */ | 976 | /* Recovery revoke support */ |
977 | extern int journal_set_revoke(journal_t *, unsigned long, tid_t); | 977 | extern int jbd2_journal_set_revoke(journal_t *, unsigned long, tid_t); |
978 | extern int journal_test_revoke(journal_t *, unsigned long, tid_t); | 978 | extern int jbd2_journal_test_revoke(journal_t *, unsigned long, tid_t); |
979 | extern void journal_clear_revoke(journal_t *); | 979 | extern void jbd2_journal_clear_revoke(journal_t *); |
980 | extern void journal_switch_revoke_table(journal_t *journal); | 980 | extern void jbd2_journal_switch_revoke_table(journal_t *journal); |
981 | 981 | ||
982 | /* | 982 | /* |
983 | * The log thread user interface: | 983 | * The log thread user interface: |
@@ -986,17 +986,17 @@ extern void journal_switch_revoke_table(journal_t *journal); | |||
986 | * transitions on demand. | 986 | * transitions on demand. |
987 | */ | 987 | */ |
988 | 988 | ||
989 | int __log_space_left(journal_t *); /* Called with journal locked */ | 989 | int __jbd2_log_space_left(journal_t *); /* Called with journal locked */ |
990 | int log_start_commit(journal_t *journal, tid_t tid); | 990 | int jbd2_log_start_commit(journal_t *journal, tid_t tid); |
991 | int __log_start_commit(journal_t *journal, tid_t tid); | 991 | int __jbd2_log_start_commit(journal_t *journal, tid_t tid); |
992 | int journal_start_commit(journal_t *journal, tid_t *tid); | 992 | int jbd2_journal_start_commit(journal_t *journal, tid_t *tid); |
993 | int journal_force_commit_nested(journal_t *journal); | 993 | int jbd2_journal_force_commit_nested(journal_t *journal); |
994 | int log_wait_commit(journal_t *journal, tid_t tid); | 994 | int jbd2_log_wait_commit(journal_t *journal, tid_t tid); |
995 | int log_do_checkpoint(journal_t *journal); | 995 | int jbd2_log_do_checkpoint(journal_t *journal); |
996 | 996 | ||
997 | void __log_wait_for_space(journal_t *journal); | 997 | void __jbd2_log_wait_for_space(journal_t *journal); |
998 | extern void __journal_drop_transaction(journal_t *, transaction_t *); | 998 | extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *); |
999 | extern int cleanup_journal_tail(journal_t *); | 999 | extern int jbd2_cleanup_journal_tail(journal_t *); |
1000 | 1000 | ||
1001 | /* Debugging code only: */ | 1001 | /* Debugging code only: */ |
1002 | 1002 | ||
@@ -1010,7 +1010,7 @@ do { \ | |||
1010 | /* | 1010 | /* |
1011 | * is_journal_abort | 1011 | * is_journal_abort |
1012 | * | 1012 | * |
1013 | * Simple test wrapper function to test the JFS_ABORT state flag. This | 1013 | * Simple test wrapper function to test the JBD2_ABORT state flag. This |
1014 | * bit, when set, indicates that we have had a fatal error somewhere, | 1014 | * bit, when set, indicates that we have had a fatal error somewhere, |
1015 | * either inside the journaling layer or indicated to us by the client | 1015 | * either inside the journaling layer or indicated to us by the client |
1016 | * (eg. ext3), and that we and should not commit any further | 1016 | * (eg. ext3), and that we and should not commit any further |
@@ -1019,7 +1019,7 @@ do { \ | |||
1019 | 1019 | ||
1020 | static inline int is_journal_aborted(journal_t *journal) | 1020 | static inline int is_journal_aborted(journal_t *journal) |
1021 | { | 1021 | { |
1022 | return journal->j_flags & JFS_ABORT; | 1022 | return journal->j_flags & JBD2_ABORT; |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | static inline int is_handle_aborted(handle_t *handle) | 1025 | static inline int is_handle_aborted(handle_t *handle) |
@@ -1029,7 +1029,7 @@ static inline int is_handle_aborted(handle_t *handle) | |||
1029 | return is_journal_aborted(handle->h_transaction->t_journal); | 1029 | return is_journal_aborted(handle->h_transaction->t_journal); |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | static inline void journal_abort_handle(handle_t *handle) | 1032 | static inline void jbd2_journal_abort_handle(handle_t *handle) |
1033 | { | 1033 | { |
1034 | handle->h_aborted = 1; | 1034 | handle->h_aborted = 1; |
1035 | } | 1035 | } |
@@ -1051,7 +1051,7 @@ static inline int tid_geq(tid_t x, tid_t y) | |||
1051 | return (difference >= 0); | 1051 | return (difference >= 0); |
1052 | } | 1052 | } |
1053 | 1053 | ||
1054 | extern int journal_blocks_per_page(struct inode *inode); | 1054 | extern int jbd2_journal_blocks_per_page(struct inode *inode); |
1055 | 1055 | ||
1056 | /* | 1056 | /* |
1057 | * Return the minimum number of blocks which must be free in the journal | 1057 | * Return the minimum number of blocks which must be free in the journal |