diff options
| author | Mingming Cao <cmm@us.ibm.com> | 2006-10-11 04:21:13 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-11 14:14:18 -0400 |
| commit | 18eba7aae080d4a5c0d850ea810e83d11f0a8d77 (patch) | |
| tree | 58277e871787fad73c588b3ba81899f9c8b98553 | |
| parent | 9b8f1f0106ab39ad58765d4e7c57189835f51127 (diff) | |
[PATCH] jbd2: switch blks_type from sector_t to ull
Similar to ext4, change blocks in JBD2 from sector_t to unsigned long long.
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | fs/jbd2/commit.c | 4 | ||||
| -rw-r--r-- | fs/jbd2/journal.c | 18 | ||||
| -rw-r--r-- | fs/jbd2/recovery.c | 12 | ||||
| -rw-r--r-- | fs/jbd2/revoke.c | 14 | ||||
| -rw-r--r-- | include/linux/jbd2.h | 16 |
5 files changed, 32 insertions, 32 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 1a9ce88852..70b2ae1ef2 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
| @@ -272,7 +272,7 @@ write_out_data: | |||
| 272 | } | 272 | } |
| 273 | 273 | ||
| 274 | static inline void write_tag_block(int tag_bytes, journal_block_tag_t *tag, | 274 | static inline void write_tag_block(int tag_bytes, journal_block_tag_t *tag, |
| 275 | sector_t block) | 275 | unsigned long long block) |
| 276 | { | 276 | { |
| 277 | tag->t_blocknr = cpu_to_be32(block & (u32)~0); | 277 | tag->t_blocknr = cpu_to_be32(block & (u32)~0); |
| 278 | if (tag_bytes > JBD_TAG_SIZE32) | 278 | if (tag_bytes > JBD_TAG_SIZE32) |
| @@ -293,7 +293,7 @@ void jbd2_journal_commit_transaction(journal_t *journal) | |||
| 293 | int bufs; | 293 | int bufs; |
| 294 | int flags; | 294 | int flags; |
| 295 | int err; | 295 | int err; |
| 296 | sector_t blocknr; | 296 | unsigned long long blocknr; |
| 297 | char *tagp = NULL; | 297 | char *tagp = NULL; |
| 298 | journal_header_t *header; | 298 | journal_header_t *header; |
| 299 | journal_block_tag_t *tag = NULL; | 299 | journal_block_tag_t *tag = NULL; |
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 259e8365ea..10db92ced0 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
| @@ -271,7 +271,7 @@ static void journal_kill_thread(journal_t *journal) | |||
| 271 | int jbd2_journal_write_metadata_buffer(transaction_t *transaction, | 271 | int jbd2_journal_write_metadata_buffer(transaction_t *transaction, |
| 272 | struct journal_head *jh_in, | 272 | struct journal_head *jh_in, |
| 273 | struct journal_head **jh_out, | 273 | struct journal_head **jh_out, |
| 274 | sector_t blocknr) | 274 | unsigned long long blocknr) |
| 275 | { | 275 | { |
| 276 | int need_copy_out = 0; | 276 | int need_copy_out = 0; |
| 277 | int done_copy_out = 0; | 277 | int done_copy_out = 0; |
| @@ -555,7 +555,7 @@ int jbd2_log_wait_commit(journal_t *journal, tid_t tid) | |||
| 555 | * Log buffer allocation routines: | 555 | * Log buffer allocation routines: |
| 556 | */ | 556 | */ |
| 557 | 557 | ||
| 558 | int jbd2_journal_next_log_block(journal_t *journal, sector_t *retp) | 558 | int jbd2_journal_next_log_block(journal_t *journal, unsigned long long *retp) |
| 559 | { | 559 | { |
| 560 | unsigned long blocknr; | 560 | unsigned long blocknr; |
| 561 | 561 | ||
| @@ -579,10 +579,10 @@ int jbd2_journal_next_log_block(journal_t *journal, sector_t *retp) | |||
| 579 | * ready. | 579 | * ready. |
| 580 | */ | 580 | */ |
| 581 | int jbd2_journal_bmap(journal_t *journal, unsigned long blocknr, | 581 | int jbd2_journal_bmap(journal_t *journal, unsigned long blocknr, |
| 582 | sector_t *retp) | 582 | unsigned long long *retp) |
| 583 | { | 583 | { |
| 584 | int err = 0; | 584 | int err = 0; |
| 585 | sector_t ret; | 585 | unsigned long long ret; |
| 586 | 586 | ||
| 587 | if (journal->j_inode) { | 587 | if (journal->j_inode) { |
| 588 | ret = bmap(journal->j_inode, blocknr); | 588 | ret = bmap(journal->j_inode, blocknr); |
| @@ -618,7 +618,7 @@ int jbd2_journal_bmap(journal_t *journal, unsigned long blocknr, | |||
| 618 | struct journal_head *jbd2_journal_get_descriptor_buffer(journal_t *journal) | 618 | struct journal_head *jbd2_journal_get_descriptor_buffer(journal_t *journal) |
| 619 | { | 619 | { |
| 620 | struct buffer_head *bh; | 620 | struct buffer_head *bh; |
| 621 | sector_t blocknr; | 621 | unsigned long long blocknr; |
| 622 | int err; | 622 | int err; |
| 623 | 623 | ||
| 624 | err = jbd2_journal_next_log_block(journal, &blocknr); | 624 | err = jbd2_journal_next_log_block(journal, &blocknr); |
| @@ -706,7 +706,7 @@ fail: | |||
| 706 | */ | 706 | */ |
| 707 | journal_t * jbd2_journal_init_dev(struct block_device *bdev, | 707 | journal_t * jbd2_journal_init_dev(struct block_device *bdev, |
| 708 | struct block_device *fs_dev, | 708 | struct block_device *fs_dev, |
| 709 | sector_t start, int len, int blocksize) | 709 | unsigned long long start, int len, int blocksize) |
| 710 | { | 710 | { |
| 711 | journal_t *journal = journal_init_common(); | 711 | journal_t *journal = journal_init_common(); |
| 712 | struct buffer_head *bh; | 712 | struct buffer_head *bh; |
| @@ -753,7 +753,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode) | |||
| 753 | journal_t *journal = journal_init_common(); | 753 | journal_t *journal = journal_init_common(); |
| 754 | int err; | 754 | int err; |
| 755 | int n; | 755 | int n; |
| 756 | sector_t blocknr; | 756 | unsigned long long blocknr; |
| 757 | 757 | ||
| 758 | if (!journal) | 758 | if (!journal) |
| 759 | return NULL; | 759 | return NULL; |
| @@ -819,7 +819,7 @@ static void journal_fail_superblock (journal_t *journal) | |||
| 819 | static int journal_reset(journal_t *journal) | 819 | static int journal_reset(journal_t *journal) |
| 820 | { | 820 | { |
| 821 | journal_superblock_t *sb = journal->j_superblock; | 821 | journal_superblock_t *sb = journal->j_superblock; |
| 822 | sector_t first, last; | 822 | unsigned long long first, last; |
| 823 | 823 | ||
| 824 | first = be32_to_cpu(sb->s_first); | 824 | first = be32_to_cpu(sb->s_first); |
| 825 | last = be32_to_cpu(sb->s_maxlen); | 825 | last = be32_to_cpu(sb->s_maxlen); |
| @@ -853,7 +853,7 @@ static int journal_reset(journal_t *journal) | |||
| 853 | **/ | 853 | **/ |
| 854 | int jbd2_journal_create(journal_t *journal) | 854 | int jbd2_journal_create(journal_t *journal) |
| 855 | { | 855 | { |
| 856 | sector_t blocknr; | 856 | unsigned long long blocknr; |
| 857 | struct buffer_head *bh; | 857 | struct buffer_head *bh; |
| 858 | journal_superblock_t *sb; | 858 | journal_superblock_t *sb; |
| 859 | int i, err; | 859 | int i, err; |
diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c index 52054a83e7..9f10acafaf 100644 --- a/fs/jbd2/recovery.c +++ b/fs/jbd2/recovery.c | |||
| @@ -70,7 +70,7 @@ static int do_readahead(journal_t *journal, unsigned int start) | |||
| 70 | { | 70 | { |
| 71 | int err; | 71 | int err; |
| 72 | unsigned int max, nbufs, next; | 72 | unsigned int max, nbufs, next; |
| 73 | sector_t blocknr; | 73 | unsigned long long blocknr; |
| 74 | struct buffer_head *bh; | 74 | struct buffer_head *bh; |
| 75 | 75 | ||
| 76 | struct buffer_head * bufs[MAXBUF]; | 76 | struct buffer_head * bufs[MAXBUF]; |
| @@ -132,7 +132,7 @@ static int jread(struct buffer_head **bhp, journal_t *journal, | |||
| 132 | unsigned int offset) | 132 | unsigned int offset) |
| 133 | { | 133 | { |
| 134 | int err; | 134 | int err; |
| 135 | sector_t blocknr; | 135 | unsigned long long blocknr; |
| 136 | struct buffer_head *bh; | 136 | struct buffer_head *bh; |
| 137 | 137 | ||
| 138 | *bhp = NULL; | 138 | *bhp = NULL; |
| @@ -308,9 +308,9 @@ int jbd2_journal_skip_recovery(journal_t *journal) | |||
| 308 | return err; | 308 | return err; |
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | static inline sector_t read_tag_block(int tag_bytes, journal_block_tag_t *tag) | 311 | static inline unsigned long long read_tag_block(int tag_bytes, journal_block_tag_t *tag) |
| 312 | { | 312 | { |
| 313 | sector_t block = be32_to_cpu(tag->t_blocknr); | 313 | unsigned long long block = be32_to_cpu(tag->t_blocknr); |
| 314 | if (tag_bytes > JBD_TAG_SIZE32) | 314 | if (tag_bytes > JBD_TAG_SIZE32) |
| 315 | block |= (u64)be32_to_cpu(tag->t_blocknr_high) << 32; | 315 | block |= (u64)be32_to_cpu(tag->t_blocknr_high) << 32; |
| 316 | return block; | 316 | return block; |
| @@ -452,7 +452,7 @@ static int do_one_pass(journal_t *journal, | |||
| 452 | "block %ld in log\n", | 452 | "block %ld in log\n", |
| 453 | err, io_block); | 453 | err, io_block); |
| 454 | } else { | 454 | } else { |
| 455 | sector_t blocknr; | 455 | unsigned long long blocknr; |
| 456 | 456 | ||
| 457 | J_ASSERT(obh != NULL); | 457 | J_ASSERT(obh != NULL); |
| 458 | blocknr = read_tag_block(tag_bytes, | 458 | blocknr = read_tag_block(tag_bytes, |
| @@ -592,7 +592,7 @@ static int scan_revoke_records(journal_t *journal, struct buffer_head *bh, | |||
| 592 | record_len = 8; | 592 | record_len = 8; |
| 593 | 593 | ||
| 594 | while (offset + record_len <= max) { | 594 | while (offset + record_len <= max) { |
| 595 | sector_t blocknr; | 595 | unsigned long long blocknr; |
| 596 | int err; | 596 | int err; |
| 597 | 597 | ||
| 598 | if (record_len == 4) | 598 | if (record_len == 4) |
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c index 3310a1d7ac..380d19917f 100644 --- a/fs/jbd2/revoke.c +++ b/fs/jbd2/revoke.c | |||
| @@ -81,7 +81,7 @@ struct jbd2_revoke_record_s | |||
| 81 | { | 81 | { |
| 82 | struct list_head hash; | 82 | struct list_head hash; |
| 83 | tid_t sequence; /* Used for recovery only */ | 83 | tid_t sequence; /* Used for recovery only */ |
| 84 | sector_t blocknr; | 84 | unsigned long long blocknr; |
| 85 | }; | 85 | }; |
| 86 | 86 | ||
| 87 | 87 | ||
| @@ -106,7 +106,7 @@ static void flush_descriptor(journal_t *, struct journal_head *, int); | |||
| 106 | /* Utility functions to maintain the revoke table */ | 106 | /* Utility functions to maintain the revoke table */ |
| 107 | 107 | ||
| 108 | /* Borrowed from buffer.c: this is a tried and tested block hash function */ | 108 | /* Borrowed from buffer.c: this is a tried and tested block hash function */ |
| 109 | static inline int hash(journal_t *journal, sector_t block) | 109 | static inline int hash(journal_t *journal, unsigned long long block) |
| 110 | { | 110 | { |
| 111 | struct jbd2_revoke_table_s *table = journal->j_revoke; | 111 | struct jbd2_revoke_table_s *table = journal->j_revoke; |
| 112 | int hash_shift = table->hash_shift; | 112 | int hash_shift = table->hash_shift; |
| @@ -117,7 +117,7 @@ static inline int hash(journal_t *journal, sector_t block) | |||
| 117 | (hash << (hash_shift - 12))) & (table->hash_size - 1); | 117 | (hash << (hash_shift - 12))) & (table->hash_size - 1); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | static int insert_revoke_hash(journal_t *journal, sector_t blocknr, | 120 | static int insert_revoke_hash(journal_t *journal, unsigned long long blocknr, |
| 121 | tid_t seq) | 121 | tid_t seq) |
| 122 | { | 122 | { |
| 123 | struct list_head *hash_list; | 123 | struct list_head *hash_list; |
| @@ -147,7 +147,7 @@ oom: | |||
| 147 | /* Find a revoke record in the journal's hash table. */ | 147 | /* Find a revoke record in the journal's hash table. */ |
| 148 | 148 | ||
| 149 | static struct jbd2_revoke_record_s *find_revoke_record(journal_t *journal, | 149 | static struct jbd2_revoke_record_s *find_revoke_record(journal_t *journal, |
| 150 | sector_t blocknr) | 150 | unsigned long long blocknr) |
| 151 | { | 151 | { |
| 152 | struct list_head *hash_list; | 152 | struct list_head *hash_list; |
| 153 | struct jbd2_revoke_record_s *record; | 153 | struct jbd2_revoke_record_s *record; |
| @@ -326,7 +326,7 @@ void jbd2_journal_destroy_revoke(journal_t *journal) | |||
| 326 | * by one. | 326 | * by one. |
| 327 | */ | 327 | */ |
| 328 | 328 | ||
| 329 | int jbd2_journal_revoke(handle_t *handle, sector_t blocknr, | 329 | int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr, |
| 330 | struct buffer_head *bh_in) | 330 | struct buffer_head *bh_in) |
| 331 | { | 331 | { |
| 332 | struct buffer_head *bh = NULL; | 332 | struct buffer_head *bh = NULL; |
| @@ -650,7 +650,7 @@ static void flush_descriptor(journal_t *journal, | |||
| 650 | */ | 650 | */ |
| 651 | 651 | ||
| 652 | int jbd2_journal_set_revoke(journal_t *journal, | 652 | int jbd2_journal_set_revoke(journal_t *journal, |
| 653 | sector_t blocknr, | 653 | unsigned long long blocknr, |
| 654 | tid_t sequence) | 654 | tid_t sequence) |
| 655 | { | 655 | { |
| 656 | struct jbd2_revoke_record_s *record; | 656 | struct jbd2_revoke_record_s *record; |
| @@ -674,7 +674,7 @@ int jbd2_journal_set_revoke(journal_t *journal, | |||
| 674 | */ | 674 | */ |
| 675 | 675 | ||
| 676 | int jbd2_journal_test_revoke(journal_t *journal, | 676 | int jbd2_journal_test_revoke(journal_t *journal, |
| 677 | sector_t blocknr, | 677 | unsigned long long blocknr, |
| 678 | tid_t sequence) | 678 | tid_t sequence) |
| 679 | { | 679 | { |
| 680 | struct jbd2_revoke_record_s *record; | 680 | struct jbd2_revoke_record_s *record; |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 3c939c844a..ddb1287957 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
| @@ -741,7 +741,7 @@ struct journal_s | |||
| 741 | */ | 741 | */ |
| 742 | struct block_device *j_dev; | 742 | struct block_device *j_dev; |
| 743 | int j_blocksize; | 743 | int j_blocksize; |
| 744 | sector_t j_blk_offset; | 744 | unsigned long long j_blk_offset; |
| 745 | 745 | ||
| 746 | /* | 746 | /* |
| 747 | * Device which holds the client fs. For internal journal this will be | 747 | * Device which holds the client fs. For internal journal this will be |
| @@ -860,7 +860,7 @@ extern void __journal_clean_data_list(transaction_t *transaction); | |||
| 860 | 860 | ||
| 861 | /* Log buffer allocation */ | 861 | /* Log buffer allocation */ |
| 862 | extern struct journal_head * jbd2_journal_get_descriptor_buffer(journal_t *); | 862 | extern struct journal_head * jbd2_journal_get_descriptor_buffer(journal_t *); |
| 863 | int jbd2_journal_next_log_block(journal_t *, sector_t *); | 863 | int jbd2_journal_next_log_block(journal_t *, unsigned long long *); |
| 864 | 864 | ||
| 865 | /* Commit management */ | 865 | /* Commit management */ |
| 866 | extern void jbd2_journal_commit_transaction(journal_t *); | 866 | extern void jbd2_journal_commit_transaction(journal_t *); |
| @@ -875,7 +875,7 @@ extern int | |||
| 875 | jbd2_journal_write_metadata_buffer(transaction_t *transaction, | 875 | jbd2_journal_write_metadata_buffer(transaction_t *transaction, |
| 876 | struct journal_head *jh_in, | 876 | struct journal_head *jh_in, |
| 877 | struct journal_head **jh_out, | 877 | struct journal_head **jh_out, |
| 878 | sector_t blocknr); | 878 | unsigned long long blocknr); |
| 879 | 879 | ||
| 880 | /* Transaction locking */ | 880 | /* Transaction locking */ |
| 881 | extern void __wait_on_journal (journal_t *); | 881 | extern void __wait_on_journal (journal_t *); |
| @@ -923,7 +923,7 @@ extern void jbd2_journal_unlock_updates (journal_t *); | |||
| 923 | 923 | ||
| 924 | extern journal_t * jbd2_journal_init_dev(struct block_device *bdev, | 924 | extern journal_t * jbd2_journal_init_dev(struct block_device *bdev, |
| 925 | struct block_device *fs_dev, | 925 | struct block_device *fs_dev, |
| 926 | sector_t start, int len, int bsize); | 926 | unsigned long long start, int len, int bsize); |
| 927 | extern journal_t * jbd2_journal_init_inode (struct inode *); | 927 | extern journal_t * jbd2_journal_init_inode (struct inode *); |
| 928 | extern int jbd2_journal_update_format (journal_t *); | 928 | extern int jbd2_journal_update_format (journal_t *); |
| 929 | extern int jbd2_journal_check_used_features | 929 | extern int jbd2_journal_check_used_features |
| @@ -944,7 +944,7 @@ extern void jbd2_journal_abort (journal_t *, int); | |||
| 944 | extern int jbd2_journal_errno (journal_t *); | 944 | extern int jbd2_journal_errno (journal_t *); |
| 945 | extern void jbd2_journal_ack_err (journal_t *); | 945 | extern void jbd2_journal_ack_err (journal_t *); |
| 946 | extern int jbd2_journal_clear_err (journal_t *); | 946 | extern int jbd2_journal_clear_err (journal_t *); |
| 947 | extern int jbd2_journal_bmap(journal_t *, unsigned long, sector_t *); | 947 | extern int jbd2_journal_bmap(journal_t *, unsigned long, unsigned long long *); |
| 948 | extern int jbd2_journal_force_commit(journal_t *); | 948 | extern int jbd2_journal_force_commit(journal_t *); |
| 949 | 949 | ||
| 950 | /* | 950 | /* |
| @@ -977,13 +977,13 @@ extern void jbd2_journal_destroy_revoke_caches(void); | |||
| 977 | extern int jbd2_journal_init_revoke_caches(void); | 977 | extern int jbd2_journal_init_revoke_caches(void); |
| 978 | 978 | ||
| 979 | extern void jbd2_journal_destroy_revoke(journal_t *); | 979 | extern void jbd2_journal_destroy_revoke(journal_t *); |
| 980 | extern int jbd2_journal_revoke (handle_t *, sector_t, struct buffer_head *); | 980 | extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *); |
| 981 | extern int jbd2_journal_cancel_revoke(handle_t *, struct journal_head *); | 981 | extern int jbd2_journal_cancel_revoke(handle_t *, struct journal_head *); |
| 982 | extern void jbd2_journal_write_revoke_records(journal_t *, transaction_t *); | 982 | extern void jbd2_journal_write_revoke_records(journal_t *, transaction_t *); |
| 983 | 983 | ||
| 984 | /* Recovery revoke support */ | 984 | /* Recovery revoke support */ |
| 985 | extern int jbd2_journal_set_revoke(journal_t *, sector_t, tid_t); | 985 | extern int jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t); |
| 986 | extern int jbd2_journal_test_revoke(journal_t *, sector_t, tid_t); | 986 | extern int jbd2_journal_test_revoke(journal_t *, unsigned long long, tid_t); |
| 987 | extern void jbd2_journal_clear_revoke(journal_t *); | 987 | extern void jbd2_journal_clear_revoke(journal_t *); |
| 988 | extern void jbd2_journal_switch_revoke_table(journal_t *journal); | 988 | extern void jbd2_journal_switch_revoke_table(journal_t *journal); |
| 989 | 989 | ||
