diff options
author | Jeff Mahoney <jeffm@suse.com> | 2007-10-19 02:39:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:35 -0400 |
commit | 3ee1667042c350003b9d3f35e5666cc8c43ce8aa (patch) | |
tree | 331217461b684c298397d7347431c500c5969148 /fs/reiserfs/journal.c | |
parent | 6c57c2c8d3862c8d5b908669654f6565da74ec19 (diff) |
reiserfs: fix usage of signed ints for block numbers
Do a quick signedness check for block numbers. There are a number of places
where signed integers are used for block numbers, which limits the usable file
system size to 8 TiB. The disk format, excepting a problem which will be
fixed in the following patch, supports file systems up to 16 TiB in size.
This patch cleans up those sites so that we can enable the full usable size.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs/journal.c')
-rw-r--r-- | fs/reiserfs/journal.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 4cad9e75ef56..0e30ba0ac489 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c | |||
@@ -219,11 +219,12 @@ static void allocate_bitmap_nodes(struct super_block *p_s_sb) | |||
219 | } | 219 | } |
220 | } | 220 | } |
221 | 221 | ||
222 | static int set_bit_in_list_bitmap(struct super_block *p_s_sb, int block, | 222 | static int set_bit_in_list_bitmap(struct super_block *p_s_sb, |
223 | b_blocknr_t block, | ||
223 | struct reiserfs_list_bitmap *jb) | 224 | struct reiserfs_list_bitmap *jb) |
224 | { | 225 | { |
225 | int bmap_nr = block / (p_s_sb->s_blocksize << 3); | 226 | unsigned int bmap_nr = block / (p_s_sb->s_blocksize << 3); |
226 | int bit_nr = block % (p_s_sb->s_blocksize << 3); | 227 | unsigned int bit_nr = block % (p_s_sb->s_blocksize << 3); |
227 | 228 | ||
228 | if (!jb->bitmaps[bmap_nr]) { | 229 | if (!jb->bitmaps[bmap_nr]) { |
229 | jb->bitmaps[bmap_nr] = get_bitmap_node(p_s_sb); | 230 | jb->bitmaps[bmap_nr] = get_bitmap_node(p_s_sb); |
@@ -289,7 +290,7 @@ static int free_bitmap_nodes(struct super_block *p_s_sb) | |||
289 | */ | 290 | */ |
290 | int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, | 291 | int reiserfs_allocate_list_bitmaps(struct super_block *p_s_sb, |
291 | struct reiserfs_list_bitmap *jb_array, | 292 | struct reiserfs_list_bitmap *jb_array, |
292 | int bmap_nr) | 293 | unsigned int bmap_nr) |
293 | { | 294 | { |
294 | int i; | 295 | int i; |
295 | int failed = 0; | 296 | int failed = 0; |
@@ -483,7 +484,7 @@ static inline struct reiserfs_journal_cnode *get_journal_hash_dev(struct | |||
483 | ** | 484 | ** |
484 | */ | 485 | */ |
485 | int reiserfs_in_journal(struct super_block *p_s_sb, | 486 | int reiserfs_in_journal(struct super_block *p_s_sb, |
486 | int bmap_nr, int bit_nr, int search_all, | 487 | unsigned int bmap_nr, int bit_nr, int search_all, |
487 | b_blocknr_t * next_zero_bit) | 488 | b_blocknr_t * next_zero_bit) |
488 | { | 489 | { |
489 | struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); | 490 | struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb); |
@@ -1013,7 +1014,7 @@ static int flush_commit_list(struct super_block *s, | |||
1013 | struct reiserfs_journal_list *jl, int flushall) | 1014 | struct reiserfs_journal_list *jl, int flushall) |
1014 | { | 1015 | { |
1015 | int i; | 1016 | int i; |
1016 | int bn; | 1017 | b_blocknr_t bn; |
1017 | struct buffer_head *tbh = NULL; | 1018 | struct buffer_head *tbh = NULL; |
1018 | unsigned long trans_id = jl->j_trans_id; | 1019 | unsigned long trans_id = jl->j_trans_id; |
1019 | struct reiserfs_journal *journal = SB_JOURNAL(s); | 1020 | struct reiserfs_journal *journal = SB_JOURNAL(s); |
@@ -2307,8 +2308,9 @@ static int journal_read_transaction(struct super_block *p_s_sb, | |||
2307 | Right now it is only used from journal code. But later we might use it | 2308 | Right now it is only used from journal code. But later we might use it |
2308 | from other places. | 2309 | from other places. |
2309 | Note: Do not use journal_getblk/sb_getblk functions here! */ | 2310 | Note: Do not use journal_getblk/sb_getblk functions here! */ |
2310 | static struct buffer_head *reiserfs_breada(struct block_device *dev, int block, | 2311 | static struct buffer_head *reiserfs_breada(struct block_device *dev, |
2311 | int bufsize, unsigned int max_block) | 2312 | b_blocknr_t block, int bufsize, |
2313 | b_blocknr_t max_block) | ||
2312 | { | 2314 | { |
2313 | struct buffer_head *bhlist[BUFNR]; | 2315 | struct buffer_head *bhlist[BUFNR]; |
2314 | unsigned int blocks = BUFNR; | 2316 | unsigned int blocks = BUFNR; |