diff options
Diffstat (limited to 'fs/jbd2')
-rw-r--r-- | fs/jbd2/commit.c | 2 | ||||
-rw-r--r-- | fs/jbd2/journal.c | 18 | ||||
-rw-r--r-- | fs/jbd2/recovery.c | 8 | ||||
-rw-r--r-- | fs/jbd2/revoke.c | 23 |
4 files changed, 26 insertions, 25 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 44d68a113c73..1a9ce8885220 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
@@ -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 | unsigned long blocknr; | 296 | sector_t 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 926ebcbf8a7a..259e8365ea15 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 | unsigned long blocknr) | 274 | sector_t 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, unsigned long *retp) | 558 | int jbd2_journal_next_log_block(journal_t *journal, sector_t *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, unsigned long *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 | unsigned long *retp) | 582 | sector_t *retp) |
583 | { | 583 | { |
584 | int err = 0; | 584 | int err = 0; |
585 | unsigned long ret; | 585 | sector_t 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 | unsigned long blocknr; | 621 | sector_t 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 | int start, int len, int blocksize) | 709 | sector_t 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 | unsigned long blocknr; | 756 | sector_t 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 | unsigned long first, last; | 822 | sector_t 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 | unsigned long blocknr; | 856 | sector_t 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 2486843adda0..52054a83e717 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 | unsigned long blocknr; | 73 | sector_t 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 | unsigned long blocknr; | 135 | sector_t blocknr; |
136 | struct buffer_head *bh; | 136 | struct buffer_head *bh; |
137 | 137 | ||
138 | *bhp = NULL; | 138 | *bhp = NULL; |
@@ -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 | unsigned long blocknr; | 455 | sector_t 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 | unsigned long blocknr; | 595 | sector_t 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 8aac875bd301..3310a1d7ace9 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 | unsigned long blocknr; | 84 | sector_t blocknr; |
85 | }; | 85 | }; |
86 | 86 | ||
87 | 87 | ||
@@ -106,17 +106,18 @@ 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, unsigned long block) | 109 | static inline int hash(journal_t *journal, sector_t 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; |
113 | int hash = (int)block ^ (int)((block >> 31) >> 1); | ||
113 | 114 | ||
114 | return ((block << (hash_shift - 6)) ^ | 115 | return ((hash << (hash_shift - 6)) ^ |
115 | (block >> 13) ^ | 116 | (hash >> 13) ^ |
116 | (block << (hash_shift - 12))) & (table->hash_size - 1); | 117 | (hash << (hash_shift - 12))) & (table->hash_size - 1); |
117 | } | 118 | } |
118 | 119 | ||
119 | static int insert_revoke_hash(journal_t *journal, unsigned long blocknr, | 120 | static int insert_revoke_hash(journal_t *journal, sector_t blocknr, |
120 | tid_t seq) | 121 | tid_t seq) |
121 | { | 122 | { |
122 | struct list_head *hash_list; | 123 | struct list_head *hash_list; |
@@ -146,7 +147,7 @@ oom: | |||
146 | /* Find a revoke record in the journal's hash table. */ | 147 | /* Find a revoke record in the journal's hash table. */ |
147 | 148 | ||
148 | 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, |
149 | unsigned long blocknr) | 150 | sector_t blocknr) |
150 | { | 151 | { |
151 | struct list_head *hash_list; | 152 | struct list_head *hash_list; |
152 | struct jbd2_revoke_record_s *record; | 153 | struct jbd2_revoke_record_s *record; |
@@ -325,7 +326,7 @@ void jbd2_journal_destroy_revoke(journal_t *journal) | |||
325 | * by one. | 326 | * by one. |
326 | */ | 327 | */ |
327 | 328 | ||
328 | int jbd2_journal_revoke(handle_t *handle, unsigned long blocknr, | 329 | int jbd2_journal_revoke(handle_t *handle, sector_t blocknr, |
329 | struct buffer_head *bh_in) | 330 | struct buffer_head *bh_in) |
330 | { | 331 | { |
331 | struct buffer_head *bh = NULL; | 332 | struct buffer_head *bh = NULL; |
@@ -394,7 +395,7 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long blocknr, | |||
394 | } | 395 | } |
395 | } | 396 | } |
396 | 397 | ||
397 | jbd_debug(2, "insert revoke for block %lu, bh_in=%p\n", blocknr, bh_in); | 398 | jbd_debug(2, "insert revoke for block %llu, bh_in=%p\n",blocknr, bh_in); |
398 | err = insert_revoke_hash(journal, blocknr, | 399 | err = insert_revoke_hash(journal, blocknr, |
399 | handle->h_transaction->t_tid); | 400 | handle->h_transaction->t_tid); |
400 | BUFFER_TRACE(bh_in, "exit"); | 401 | BUFFER_TRACE(bh_in, "exit"); |
@@ -649,7 +650,7 @@ static void flush_descriptor(journal_t *journal, | |||
649 | */ | 650 | */ |
650 | 651 | ||
651 | int jbd2_journal_set_revoke(journal_t *journal, | 652 | int jbd2_journal_set_revoke(journal_t *journal, |
652 | unsigned long blocknr, | 653 | sector_t blocknr, |
653 | tid_t sequence) | 654 | tid_t sequence) |
654 | { | 655 | { |
655 | struct jbd2_revoke_record_s *record; | 656 | struct jbd2_revoke_record_s *record; |
@@ -673,7 +674,7 @@ int jbd2_journal_set_revoke(journal_t *journal, | |||
673 | */ | 674 | */ |
674 | 675 | ||
675 | int jbd2_journal_test_revoke(journal_t *journal, | 676 | int jbd2_journal_test_revoke(journal_t *journal, |
676 | unsigned long blocknr, | 677 | sector_t blocknr, |
677 | tid_t sequence) | 678 | tid_t sequence) |
678 | { | 679 | { |
679 | struct jbd2_revoke_record_s *record; | 680 | struct jbd2_revoke_record_s *record; |