diff options
Diffstat (limited to 'include/linux/jbd.h')
| -rw-r--r-- | include/linux/jbd.h | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index a04c154c5207..a6d9daa38c6d 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/include/linux/jbd.h | 2 | * linux/include/linux/jbd.h |
| 3 | * | 3 | * |
| 4 | * Written by Stephen C. Tweedie <sct@redhat.com> | 4 | * Written by Stephen C. Tweedie <sct@redhat.com> |
| 5 | * | 5 | * |
| 6 | * Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved | 6 | * Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved |
| @@ -64,7 +64,7 @@ extern int journal_enable_debug; | |||
| 64 | if ((n) <= journal_enable_debug) { \ | 64 | if ((n) <= 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); \ |
| 68 | } \ | 68 | } \ |
| 69 | } while (0) | 69 | } while (0) |
| 70 | #else | 70 | #else |
| @@ -97,8 +97,8 @@ extern void jbd_slab_free(void *ptr, size_t size); | |||
| 97 | * number of outstanding buffers possible at any time. When the | 97 | * number of outstanding buffers possible at any time. When the |
| 98 | * operation completes, any buffer credits not used are credited back to | 98 | * operation completes, any buffer credits not used are credited back to |
| 99 | * the transaction, so that at all times we know how many buffers the | 99 | * the transaction, so that at all times we know how many buffers the |
| 100 | * outstanding updates on a transaction might possibly touch. | 100 | * outstanding updates on a transaction might possibly touch. |
| 101 | * | 101 | * |
| 102 | * This is an opaque datatype. | 102 | * This is an opaque datatype. |
| 103 | **/ | 103 | **/ |
| 104 | typedef struct handle_s handle_t; /* Atomic operation type */ | 104 | typedef struct handle_s handle_t; /* Atomic operation type */ |
| @@ -108,7 +108,7 @@ typedef struct handle_s handle_t; /* Atomic operation type */ | |||
| 108 | * typedef journal_t - The journal_t maintains all of the journaling state information for a single filesystem. | 108 | * typedef journal_t - The journal_t maintains all of the journaling state information for a single filesystem. |
| 109 | * | 109 | * |
| 110 | * journal_t is linked to from the fs superblock structure. | 110 | * journal_t is linked to from the fs superblock structure. |
| 111 | * | 111 | * |
| 112 | * We use the journal_t to keep track of all outstanding transaction | 112 | * We use the journal_t to keep track of all outstanding transaction |
| 113 | * activity on the filesystem, and to manage the state of the log | 113 | * activity on the filesystem, and to manage the state of the log |
| 114 | * writing process. | 114 | * writing process. |
| @@ -128,7 +128,7 @@ typedef struct journal_s journal_t; /* Journal control structure */ | |||
| 128 | * On-disk structures | 128 | * On-disk structures |
| 129 | */ | 129 | */ |
| 130 | 130 | ||
| 131 | /* | 131 | /* |
| 132 | * Descriptor block types: | 132 | * Descriptor block types: |
| 133 | */ | 133 | */ |
| 134 | 134 | ||
| @@ -149,8 +149,8 @@ typedef struct journal_header_s | |||
| 149 | } journal_header_t; | 149 | } journal_header_t; |
| 150 | 150 | ||
| 151 | 151 | ||
| 152 | /* | 152 | /* |
| 153 | * The block tag: used to describe a single buffer in the journal | 153 | * The block tag: used to describe a single buffer in the journal |
| 154 | */ | 154 | */ |
| 155 | typedef struct journal_block_tag_s | 155 | typedef struct journal_block_tag_s |
| 156 | { | 156 | { |
| @@ -158,9 +158,9 @@ typedef struct journal_block_tag_s | |||
| 158 | __be32 t_flags; /* See below */ | 158 | __be32 t_flags; /* See below */ |
| 159 | } journal_block_tag_t; | 159 | } journal_block_tag_t; |
| 160 | 160 | ||
| 161 | /* | 161 | /* |
| 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 journal_revoke_header_s |
| 166 | { | 166 | { |
| @@ -201,9 +201,9 @@ typedef struct journal_superblock_s | |||
| 201 | 201 | ||
| 202 | /* 0x0024 */ | 202 | /* 0x0024 */ |
| 203 | /* Remaining fields are only valid in a version-2 superblock */ | 203 | /* Remaining fields are only valid in a version-2 superblock */ |
| 204 | __be32 s_feature_compat; /* compatible feature set */ | 204 | __be32 s_feature_compat; /* compatible feature set */ |
| 205 | __be32 s_feature_incompat; /* incompatible feature set */ | 205 | __be32 s_feature_incompat; /* incompatible feature set */ |
| 206 | __be32 s_feature_ro_compat; /* readonly-compatible feature set */ | 206 | __be32 s_feature_ro_compat; /* readonly-compatible feature set */ |
| 207 | /* 0x0030 */ | 207 | /* 0x0030 */ |
| 208 | __u8 s_uuid[16]; /* 128-bit uuid for journal */ | 208 | __u8 s_uuid[16]; /* 128-bit uuid for journal */ |
| 209 | 209 | ||
| @@ -374,10 +374,10 @@ struct jbd_revoke_table_s; | |||
| 374 | **/ | 374 | **/ |
| 375 | 375 | ||
| 376 | /* Docbook can't yet cope with the bit fields, but will leave the documentation | 376 | /* Docbook can't yet cope with the bit fields, but will leave the documentation |
| 377 | * in so it can be fixed later. | 377 | * in so it can be fixed later. |
| 378 | */ | 378 | */ |
| 379 | 379 | ||
| 380 | struct handle_s | 380 | struct handle_s |
| 381 | { | 381 | { |
| 382 | /* Which compound transaction is this update a part of? */ | 382 | /* Which compound transaction is this update a part of? */ |
| 383 | transaction_t *h_transaction; | 383 | transaction_t *h_transaction; |
| @@ -435,7 +435,7 @@ struct handle_s | |||
| 435 | * | 435 | * |
| 436 | */ | 436 | */ |
| 437 | 437 | ||
| 438 | struct transaction_s | 438 | struct transaction_s |
| 439 | { | 439 | { |
| 440 | /* Pointer to the journal for this transaction. [no locking] */ | 440 | /* Pointer to the journal for this transaction. [no locking] */ |
| 441 | journal_t *t_journal; | 441 | journal_t *t_journal; |
| @@ -455,7 +455,7 @@ struct transaction_s | |||
| 455 | T_RUNDOWN, | 455 | T_RUNDOWN, |
| 456 | T_FLUSH, | 456 | T_FLUSH, |
| 457 | T_COMMIT, | 457 | T_COMMIT, |
| 458 | T_FINISHED | 458 | T_FINISHED |
| 459 | } t_state; | 459 | } t_state; |
| 460 | 460 | ||
| 461 | /* | 461 | /* |
| @@ -569,7 +569,7 @@ struct transaction_s | |||
| 569 | * journal_t. | 569 | * journal_t. |
| 570 | * @j_flags: General journaling state flags | 570 | * @j_flags: General journaling state flags |
| 571 | * @j_errno: Is there an outstanding uncleared error on the journal (from a | 571 | * @j_errno: Is there an outstanding uncleared error on the journal (from a |
| 572 | * prior abort)? | 572 | * prior abort)? |
| 573 | * @j_sb_buffer: First part of superblock buffer | 573 | * @j_sb_buffer: First part of superblock buffer |
| 574 | * @j_superblock: Second part of superblock buffer | 574 | * @j_superblock: Second part of superblock buffer |
| 575 | * @j_format_version: Version of the superblock format | 575 | * @j_format_version: Version of the superblock format |
| @@ -583,7 +583,7 @@ struct transaction_s | |||
| 583 | * @j_wait_transaction_locked: Wait queue for waiting for a locked transaction | 583 | * @j_wait_transaction_locked: Wait queue for waiting for a locked transaction |
| 584 | * to start committing, or for a barrier lock to be released | 584 | * to start committing, or for a barrier lock to be released |
| 585 | * @j_wait_logspace: Wait queue for waiting for checkpointing to complete | 585 | * @j_wait_logspace: Wait queue for waiting for checkpointing to complete |
| 586 | * @j_wait_done_commit: Wait queue for waiting for commit to complete | 586 | * @j_wait_done_commit: Wait queue for waiting for commit to complete |
| 587 | * @j_wait_checkpoint: Wait queue to trigger checkpointing | 587 | * @j_wait_checkpoint: Wait queue to trigger checkpointing |
| 588 | * @j_wait_commit: Wait queue to trigger commit | 588 | * @j_wait_commit: Wait queue to trigger commit |
| 589 | * @j_wait_updates: Wait queue to wait for updates to complete | 589 | * @j_wait_updates: Wait queue to wait for updates to complete |
| @@ -592,7 +592,7 @@ struct transaction_s | |||
| 592 | * @j_tail: Journal tail - identifies the oldest still-used block in the | 592 | * @j_tail: Journal tail - identifies the oldest still-used block in the |
| 593 | * journal. | 593 | * journal. |
| 594 | * @j_free: Journal free - how many free blocks are there in the journal? | 594 | * @j_free: Journal free - how many free blocks are there in the journal? |
| 595 | * @j_first: The block number of the first usable block | 595 | * @j_first: The block number of the first usable block |
| 596 | * @j_last: The block number one beyond the last usable block | 596 | * @j_last: The block number one beyond the last usable block |
| 597 | * @j_dev: Device where we store the journal | 597 | * @j_dev: Device where we store the journal |
| 598 | * @j_blocksize: blocksize for the location where we store the journal. | 598 | * @j_blocksize: blocksize for the location where we store the journal. |
| @@ -604,12 +604,12 @@ struct transaction_s | |||
| 604 | * @j_list_lock: Protects the buffer lists and internal buffer state. | 604 | * @j_list_lock: Protects the buffer lists and internal buffer state. |
| 605 | * @j_inode: Optional inode where we store the journal. If present, all journal | 605 | * @j_inode: Optional inode where we store the journal. If present, all journal |
| 606 | * block numbers are mapped into this inode via bmap(). | 606 | * block numbers are mapped into this inode via bmap(). |
| 607 | * @j_tail_sequence: Sequence number of the oldest transaction in the log | 607 | * @j_tail_sequence: Sequence number of the oldest transaction in the log |
| 608 | * @j_transaction_sequence: Sequence number of the next transaction to grant | 608 | * @j_transaction_sequence: Sequence number of the next transaction to grant |
| 609 | * @j_commit_sequence: Sequence number of the most recently committed | 609 | * @j_commit_sequence: Sequence number of the most recently committed |
| 610 | * transaction | 610 | * transaction |
| 611 | * @j_commit_request: Sequence number of the most recent transaction wanting | 611 | * @j_commit_request: Sequence number of the most recent transaction wanting |
| 612 | * commit | 612 | * commit |
| 613 | * @j_uuid: Uuid of client object. | 613 | * @j_uuid: Uuid of client object. |
| 614 | * @j_task: Pointer to the current commit thread for this journal | 614 | * @j_task: Pointer to the current commit thread for this journal |
| 615 | * @j_max_transaction_buffers: Maximum number of metadata buffers to allow in a | 615 | * @j_max_transaction_buffers: Maximum number of metadata buffers to allow in a |
| @@ -699,7 +699,7 @@ struct journal_s | |||
| 699 | wait_queue_head_t j_wait_updates; | 699 | wait_queue_head_t j_wait_updates; |
| 700 | 700 | ||
| 701 | /* Semaphore for locking against concurrent checkpoints */ | 701 | /* Semaphore for locking against concurrent checkpoints */ |
| 702 | struct mutex j_checkpoint_mutex; | 702 | struct mutex j_checkpoint_mutex; |
| 703 | 703 | ||
| 704 | /* | 704 | /* |
| 705 | * Journal head: identifies the first unused block in the journal. | 705 | * Journal head: identifies the first unused block in the journal. |
| @@ -732,7 +732,7 @@ struct journal_s | |||
| 732 | */ | 732 | */ |
| 733 | struct block_device *j_dev; | 733 | struct block_device *j_dev; |
| 734 | int j_blocksize; | 734 | int j_blocksize; |
| 735 | unsigned int j_blk_offset; | 735 | unsigned long j_blk_offset; |
| 736 | 736 | ||
| 737 | /* | 737 | /* |
| 738 | * Device which holds the client fs. For internal journal this will be | 738 | * Device which holds the client fs. For internal journal this will be |
| @@ -823,8 +823,8 @@ struct journal_s | |||
| 823 | void *j_private; | 823 | void *j_private; |
| 824 | }; | 824 | }; |
| 825 | 825 | ||
| 826 | /* | 826 | /* |
| 827 | * Journal flag definitions | 827 | * Journal flag definitions |
| 828 | */ | 828 | */ |
| 829 | #define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */ | 829 | #define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */ |
| 830 | #define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */ | 830 | #define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */ |
| @@ -833,7 +833,7 @@ struct journal_s | |||
| 833 | #define JFS_LOADED 0x010 /* The journal superblock has been loaded */ | 833 | #define JFS_LOADED 0x010 /* The journal superblock has been loaded */ |
| 834 | #define JFS_BARRIER 0x020 /* Use IDE barriers */ | 834 | #define JFS_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 |
| 838 | * management | 838 | * management |
| 839 | */ | 839 | */ |
| @@ -862,11 +862,11 @@ int __journal_remove_checkpoint(struct journal_head *); | |||
| 862 | void __journal_insert_checkpoint(struct journal_head *, transaction_t *); | 862 | void __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 | 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 | int blocknr); | 869 | unsigned long blocknr); |
| 870 | 870 | ||
| 871 | /* Transaction locking */ | 871 | /* Transaction locking */ |
| 872 | extern void __wait_on_journal (journal_t *); | 872 | extern void __wait_on_journal (journal_t *); |
| @@ -890,7 +890,7 @@ static inline handle_t *journal_current_handle(void) | |||
| 890 | /* The journaling code user interface: | 890 | /* The journaling code user interface: |
| 891 | * | 891 | * |
| 892 | * Create and destroy handles | 892 | * Create and destroy handles |
| 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 *journal_start(journal_t *, int nblocks); |
| @@ -917,11 +917,11 @@ extern journal_t * journal_init_dev(struct block_device *bdev, | |||
| 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 * journal_init_inode (struct inode *); |
| 919 | extern int journal_update_format (journal_t *); | 919 | extern int journal_update_format (journal_t *); |
| 920 | extern int journal_check_used_features | 920 | extern int 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 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 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 journal_create (journal_t *); |
| 927 | extern int journal_load (journal_t *journal); | 927 | extern int journal_load (journal_t *journal); |
| @@ -1015,7 +1015,7 @@ do { \ | |||
| 1015 | * bit, when set, indicates that we have had a fatal error somewhere, | 1015 | * bit, when set, indicates that we have had a fatal error somewhere, |
| 1016 | * either inside the journaling layer or indicated to us by the client | 1016 | * either inside the journaling layer or indicated to us by the client |
| 1017 | * (eg. ext3), and that we and should not commit any further | 1017 | * (eg. ext3), and that we and should not commit any further |
| 1018 | * transactions. | 1018 | * transactions. |
| 1019 | */ | 1019 | */ |
| 1020 | 1020 | ||
| 1021 | static inline int is_journal_aborted(journal_t *journal) | 1021 | static inline int is_journal_aborted(journal_t *journal) |
| @@ -1082,7 +1082,7 @@ static inline int jbd_space_needed(journal_t *journal) | |||
| 1082 | #define BJ_Reserved 7 /* Buffer is reserved for access by journal */ | 1082 | #define BJ_Reserved 7 /* Buffer is reserved for access by journal */ |
| 1083 | #define BJ_Locked 8 /* Locked for I/O during commit */ | 1083 | #define BJ_Locked 8 /* Locked for I/O during commit */ |
| 1084 | #define BJ_Types 9 | 1084 | #define BJ_Types 9 |
| 1085 | 1085 | ||
| 1086 | extern int jbd_blocks_per_page(struct inode *inode); | 1086 | extern int jbd_blocks_per_page(struct inode *inode); |
| 1087 | 1087 | ||
| 1088 | #ifdef __KERNEL__ | 1088 | #ifdef __KERNEL__ |
