JBD layer in-kernel block varibles type fixes to support >32 bit block number and convert to sector_t type. --- linux-2.6.16-ming/fs/jbd/checkpoint.c | 2 - linux-2.6.16-ming/fs/jbd/commit.c | 2 - linux-2.6.16-ming/fs/jbd/journal.c | 32 ++++++++++++------------- linux-2.6.16-ming/fs/jbd/recovery.c | 36 ++++++++++++++--------------- linux-2.6.16-ming/fs/jbd/revoke.c | 14 +++++------ linux-2.6.16-ming/fs/jbd/transaction.c | 6 ++-- linux-2.6.16-ming/include/linux/ext3_jbd.h | 2 - linux-2.6.16-ming/include/linux/jbd.h | 32 ++++++++++++------------- 8 files changed, 63 insertions(+), 63 deletions(-) diff -puN include/linux/ext3_jbd.h~sector_t-jbd include/linux/ext3_jbd.h --- linux-2.6.16/include/linux/ext3_jbd.h~sector_t-jbd 2006-05-08 11:53:51.911400834 -0700 +++ linux-2.6.16-ming/include/linux/ext3_jbd.h 2006-05-08 11:53:51.937397822 -0700 @@ -149,7 +149,7 @@ __ext3_journal_forget(const char *where, static inline int __ext3_journal_revoke(const char *where, handle_t *handle, - unsigned long blocknr, struct buffer_head *bh) + sector_t blocknr, struct buffer_head *bh) { int err = journal_revoke(handle, blocknr, bh); if (err) diff -puN include/linux/jbd.h~sector_t-jbd include/linux/jbd.h --- linux-2.6.16/include/linux/jbd.h~sector_t-jbd 2006-05-08 11:53:51.915400370 -0700 +++ linux-2.6.16-ming/include/linux/jbd.h 2006-05-08 11:53:51.941397358 -0700 @@ -455,7 +455,7 @@ struct transaction_s /* * Where in the log does this transaction's commit start? [no locking] */ - unsigned long t_log_start; + sector_t t_log_start; /* Number of buffers on the t_buffers list [j_list_lock] */ int t_nr_buffers; @@ -693,26 +693,26 @@ struct journal_s * Journal head: identifies the first unused block in the journal. * [j_state_lock] */ - unsigned long j_head; + sector_t j_head; /* * Journal tail: identifies the oldest still-used block in the journal. * [j_state_lock] */ - unsigned long j_tail; + sector_t j_tail; /* * Journal free: how many free blocks are there in the journal? * [j_state_lock] */ - unsigned long j_free; + sector_t j_free; /* * Journal start and end: the block numbers of the first usable block * and one beyond the last usable block in the journal. [j_state_lock] */ - unsigned long j_first; - unsigned long j_last; + sector_t j_first; + sector_t j_last; /* * Device, blocksize and starting block offset for the location where we @@ -720,7 +720,7 @@ struct journal_s */ struct block_device *j_dev; int j_blocksize; - unsigned int j_blk_offset; + sector_t j_blk_offset; /* * Device which holds the client fs. For internal journal this will be @@ -729,7 +729,7 @@ struct journal_s struct block_device *j_fs_dev; /* Total maximum capacity of the journal region on disk. */ - unsigned int j_maxlen; + sector_t j_maxlen; /* * Protects the buffer lists and internal buffer state. @@ -839,7 +839,7 @@ extern void __journal_clean_data_list(tr /* Log buffer allocation */ extern struct journal_head * journal_get_descriptor_buffer(journal_t *); -int journal_next_log_block(journal_t *, unsigned long *); +int journal_next_log_block(journal_t *, sector_t *); /* Commit management */ extern void journal_commit_transaction(journal_t *); @@ -854,7 +854,7 @@ extern int journal_write_metadata_buffer(transaction_t *transaction, struct journal_head *jh_in, struct journal_head **jh_out, - int blocknr); + sector_t blocknr); /* Transaction locking */ extern void __wait_on_journal (journal_t *); @@ -893,7 +893,7 @@ extern void journal_release_buffer (han extern int journal_forget (handle_t *, struct buffer_head *); extern void journal_sync_buffer (struct buffer_head *); extern int journal_invalidatepage(journal_t *, - struct page *, unsigned long); + struct page *, sector_t); extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); extern int journal_stop(handle_t *); extern int journal_flush (journal_t *); @@ -902,7 +902,7 @@ extern void journal_unlock_updates (jou extern journal_t * journal_init_dev(struct block_device *bdev, struct block_device *fs_dev, - int start, int len, int bsize); + sector_t start, sector_t len, int bsize); extern journal_t * journal_init_inode (struct inode *); extern int journal_update_format (journal_t *); extern int journal_check_used_features @@ -923,7 +923,7 @@ extern void journal_abort (journ extern int journal_errno (journal_t *); extern void journal_ack_err (journal_t *); extern int journal_clear_err (journal_t *); -extern int journal_bmap(journal_t *, unsigned long, unsigned long *); +extern int journal_bmap(journal_t *, sector_t, sector_t *); extern int journal_force_commit(journal_t *); /* @@ -957,13 +957,13 @@ extern int journal_init_revoke_caches extern void journal_destroy_revoke(journal_t *); extern int journal_revoke (handle_t *, - unsigned long, struct buffer_head *); + sector_t, struct buffer_head *); extern int journal_cancel_revoke(handle_t *, struct journal_head *); extern void journal_write_revoke_records(journal_t *, transaction_t *); /* Recovery revoke support */ -extern int journal_set_revoke(journal_t *, unsigned long, tid_t); -extern int journal_test_revoke(journal_t *, unsigned long, tid_t); +extern int journal_set_revoke(journal_t *, sector_t, tid_t); +extern int journal_test_revoke(journal_t *, sector_t, tid_t); extern void journal_clear_revoke(journal_t *); extern void journal_brelse_array(struct buffer_head *b[], int n); extern void journal_switch_revoke_table(journal_t *journal); diff -puN fs/jbd/checkpoint.c~sector_t-jbd fs/jbd/checkpoint.c --- linux-2.6.16/fs/jbd/checkpoint.c~sector_t-jbd 2006-05-08 11:53:51.918400023 -0700 +++ linux-2.6.16-ming/fs/jbd/checkpoint.c 2006-05-08 11:53:51.942397243 -0700 @@ -396,7 +396,7 @@ int cleanup_journal_tail(journal_t *jour { transaction_t * transaction; tid_t first_tid; - unsigned long blocknr, freed; + sector_t blocknr, freed; /* OK, work out the oldest transaction remaining in the log, and * the log block it starts at. diff -puN fs/jbd/commit.c~sector_t-jbd fs/jbd/commit.c --- linux-2.6.16/fs/jbd/commit.c~sector_t-jbd 2006-05-08 11:53:51.921399675 -0700 +++ linux-2.6.16-ming/fs/jbd/commit.c 2006-05-08 11:53:51.944397011 -0700 @@ -174,7 +174,7 @@ void journal_commit_transaction(journal_ int bufs; int flags; int err; - unsigned long blocknr; + sector_t blocknr; char *tagp = NULL; journal_header_t *header; journal_block_tag_t *tag = NULL; diff -puN fs/jbd/journal.c~sector_t-jbd fs/jbd/journal.c --- linux-2.6.16/fs/jbd/journal.c~sector_t-jbd 2006-05-08 11:53:51.924399328 -0700 +++ linux-2.6.16-ming/fs/jbd/journal.c 2006-05-08 11:53:51.947396663 -0700 @@ -270,7 +270,7 @@ static void journal_kill_thread(journal_ int journal_write_metadata_buffer(transaction_t *transaction, struct journal_head *jh_in, struct journal_head **jh_out, - int blocknr) + sector_t blocknr) { int need_copy_out = 0; int done_copy_out = 0; @@ -554,9 +554,9 @@ int log_wait_commit(journal_t *journal, * Log buffer allocation routines: */ -int journal_next_log_block(journal_t *journal, unsigned long *retp) +int journal_next_log_block(journal_t *journal, sector_t *retp) { - unsigned long blocknr; + sector_t blocknr; spin_lock(&journal->j_state_lock); J_ASSERT(journal->j_free > 1); @@ -577,11 +577,11 @@ int journal_next_log_block(journal_t *jo * this is a no-op. If needed, we can use j_blk_offset - everything is * ready. */ -int journal_bmap(journal_t *journal, unsigned long blocknr, - unsigned long *retp) +int journal_bmap(journal_t *journal, sector_t blocknr, + sector_t *retp) { int err = 0; - unsigned long ret; + sector_t ret; if (journal->j_inode) { ret = bmap(journal->j_inode, blocknr); @@ -591,9 +591,9 @@ int journal_bmap(journal_t *journal, uns char b[BDEVNAME_SIZE]; printk(KERN_ALERT "%s: journal block not found " - "at offset %lu on %s\n", + "at offset %llu on %s\n", __FUNCTION__, - blocknr, + (unsigned long long)blocknr, bdevname(journal->j_dev, b)); err = -EIO; __journal_abort_soft(journal, err); @@ -617,7 +617,7 @@ int journal_bmap(journal_t *journal, uns struct journal_head *journal_get_descriptor_buffer(journal_t *journal) { struct buffer_head *bh; - unsigned long blocknr; + sector_t blocknr; int err; err = journal_next_log_block(journal, &blocknr); @@ -705,7 +705,7 @@ fail: */ journal_t * journal_init_dev(struct block_device *bdev, struct block_device *fs_dev, - int start, int len, int blocksize) + sector_t start, sector_t len, int blocksize) { journal_t *journal = journal_init_common(); struct buffer_head *bh; @@ -753,7 +753,7 @@ journal_t * journal_init_inode (struct i journal_t *journal = journal_init_common(); int err; int n; - unsigned long blocknr; + sector_t blocknr; if (!journal) return NULL; @@ -819,7 +819,7 @@ static void journal_fail_superblock (jou static int journal_reset(journal_t *journal) { journal_superblock_t *sb = journal->j_superblock; - unsigned int first, last; + sector_t first, last; first = be32_to_cpu(sb->s_first); last = be32_to_cpu(sb->s_maxlen); @@ -853,14 +853,14 @@ static int journal_reset(journal_t *jour **/ int journal_create(journal_t *journal) { - unsigned long blocknr; + sector_t blocknr; struct buffer_head *bh; journal_superblock_t *sb; int i, err; if (journal->j_maxlen < JFS_MIN_JOURNAL_BLOCKS) { - printk (KERN_ERR "Journal length (%d blocks) too short.\n", - journal->j_maxlen); + printk (KERN_ERR "Journal length (%lld blocks) too short.\n", + (unsigned long long)journal->j_maxlen); journal_fail_superblock(journal); return -EINVAL; } @@ -1329,7 +1329,7 @@ int journal_flush(journal_t *journal) { int err = 0; transaction_t *transaction = NULL; - unsigned long old_tail; + sector_t old_tail; spin_lock(&journal->j_state_lock); diff -puN fs/jbd/recovery.c~sector_t-jbd fs/jbd/recovery.c --- linux-2.6.16/fs/jbd/recovery.c~sector_t-jbd 2006-05-08 11:53:51.928398864 -0700 +++ linux-2.6.16-ming/fs/jbd/recovery.c 2006-05-08 11:53:51.949396432 -0700 @@ -66,11 +66,11 @@ void journal_brelse_array(struct buffer_ */ #define MAXBUF 8 -static int do_readahead(journal_t *journal, unsigned int start) +static int do_readahead(journal_t *journal, sector_t start) { int err; - unsigned int max, nbufs, next; - unsigned long blocknr; + sector_t max, nbufs, next; + sector_t blocknr; struct buffer_head *bh; struct buffer_head * bufs[MAXBUF]; @@ -89,8 +89,8 @@ static int do_readahead(journal_t *journ err = journal_bmap(journal, next, &blocknr); if (err) { - printk (KERN_ERR "JBD: bad block at offset %u\n", - next); + printk (KERN_ERR "JBD: bad block at offset %llu\n", + (unsigned long long)next); goto failed; } @@ -129,10 +129,10 @@ failed: */ static int jread(struct buffer_head **bhp, journal_t *journal, - unsigned int offset) + sector_t offset) { int err; - unsigned long blocknr; + sector_t blocknr; struct buffer_head *bh; *bhp = NULL; @@ -145,8 +145,8 @@ static int jread(struct buffer_head **bh err = journal_bmap(journal, offset, &blocknr); if (err) { - printk (KERN_ERR "JBD: bad block at offset %u\n", - offset); + printk (KERN_ERR "JBD: bad block at offset %llu\n", + (unsigned long long)offset); return err; } @@ -163,8 +163,8 @@ static int jread(struct buffer_head **bh } if (!buffer_uptodate(bh)) { - printk (KERN_ERR "JBD: Failed to read block at offset %u\n", - offset); + printk (KERN_ERR "JBD: Failed to read block at offset %llu\n", + (unsigned long long)offset); brelse(bh); return -EIO; } @@ -311,7 +311,7 @@ static int do_one_pass(journal_t *journa struct recovery_info *info, enum passtype pass) { unsigned int first_commit_ID, next_commit_ID; - unsigned long next_log_block; + sector_t next_log_block; int err, success = 0; journal_superblock_t * sb; journal_header_t * tmp; @@ -426,7 +426,7 @@ static int do_one_pass(journal_t *journa tagp = &bh->b_data[sizeof(journal_header_t)]; while ((tagp - bh->b_data +sizeof(journal_block_tag_t)) <= journal->j_blocksize) { - unsigned long io_block; + sector_t io_block; tag = (journal_block_tag_t *) tagp; flags = be32_to_cpu(tag->t_flags); @@ -440,10 +440,10 @@ static int do_one_pass(journal_t *journa success = err; printk (KERN_ERR "JBD: IO error %d recovering " - "block %ld in log\n", - err, io_block); + "block %llu in log\n", + err, (unsigned long long)io_block); } else { - unsigned long blocknr; + sector_t blocknr; J_ASSERT(obh != NULL); blocknr = be32_to_cpu(tag->t_blocknr); @@ -570,14 +570,14 @@ static int scan_revoke_records(journal_t tid_t sequence, struct recovery_info *info) { journal_revoke_header_t *header; - int offset, max; + sector_t offset, max; header = (journal_revoke_header_t *) bh->b_data; offset = sizeof(journal_revoke_header_t); max = be32_to_cpu(header->r_count); while (offset < max) { - unsigned long blocknr; + sector_t blocknr; int err; blocknr = be32_to_cpu(* ((__be32 *) (bh->b_data+offset))); diff -puN fs/jbd/revoke.c~sector_t-jbd fs/jbd/revoke.c --- linux-2.6.16/fs/jbd/revoke.c~sector_t-jbd 2006-05-08 11:53:51.931398517 -0700 +++ linux-2.6.16-ming/fs/jbd/revoke.c 2006-05-08 11:53:51.950396316 -0700 @@ -81,7 +81,7 @@ struct jbd_revoke_record_s { struct list_head hash; tid_t sequence; /* Used for recovery only */ - unsigned long blocknr; + sector_t blocknr; }; @@ -106,7 +106,7 @@ static void flush_descriptor(journal_t * /* Utility functions to maintain the revoke table */ /* Borrowed from buffer.c: this is a tried and tested block hash function */ -static inline int hash(journal_t *journal, unsigned long block) +static inline int hash(journal_t *journal, sector_t block) { struct jbd_revoke_table_s *table = journal->j_revoke; int hash_shift = table->hash_shift; @@ -116,7 +116,7 @@ static inline int hash(journal_t *journa (block << (hash_shift - 12))) & (table->hash_size - 1); } -static int insert_revoke_hash(journal_t *journal, unsigned long blocknr, +static int insert_revoke_hash(journal_t *journal, sector_t blocknr, tid_t seq) { struct list_head *hash_list; @@ -146,7 +146,7 @@ oom: /* Find a revoke record in the journal's hash table. */ static struct jbd_revoke_record_s *find_revoke_record(journal_t *journal, - unsigned long blocknr) + sector_t blocknr) { struct list_head *hash_list; struct jbd_revoke_record_s *record; @@ -325,7 +325,7 @@ void journal_destroy_revoke(journal_t *j * by one. */ -int journal_revoke(handle_t *handle, unsigned long blocknr, +int journal_revoke(handle_t *handle, sector_t blocknr, struct buffer_head *bh_in) { struct buffer_head *bh = NULL; @@ -641,7 +641,7 @@ static void flush_descriptor(journal_t * */ int journal_set_revoke(journal_t *journal, - unsigned long blocknr, + sector_t blocknr, tid_t sequence) { struct jbd_revoke_record_s *record; @@ -665,7 +665,7 @@ int journal_set_revoke(journal_t *journa */ int journal_test_revoke(journal_t *journal, - unsigned long blocknr, + sector_t blocknr, tid_t sequence) { struct jbd_revoke_record_s *record; diff -puN fs/jbd/transaction.c~sector_t-jbd fs/jbd/transaction.c --- linux-2.6.16/fs/jbd/transaction.c~sector_t-jbd 2006-05-08 11:53:51.934398169 -0700 +++ linux-2.6.16-ming/fs/jbd/transaction.c 2006-05-08 11:53:51.955395737 -0700 @@ -1884,10 +1884,10 @@ zap_buffer_unlocked: */ int journal_invalidatepage(journal_t *journal, struct page *page, - unsigned long offset) + sector_t offset) { struct buffer_head *head, *bh, *next; - unsigned int curr_off = 0; + sector_t curr_off = 0; int may_free = 1; if (!PageLocked(page)) @@ -1901,7 +1901,7 @@ int journal_invalidatepage(journal_t *jo head = bh = page_buffers(page); do { - unsigned int next_off = curr_off + bh->b_size; + sector_t next_off = curr_off + bh->b_size; next = bh->b_this_page; if (offset <= curr_off) { _