diff options
author | Eric Sandeen <esandeen@redhat.com> | 2006-09-12 14:56:16 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2006-09-12 14:56:16 -0400 |
commit | abf23439d51a3ddbca475b931abebd381ff7ceea (patch) | |
tree | 7fa1fa914efa618539bce96134ad66c5616cf6c4 /misc | |
parent | d0ff90d5202428583c78a60c3042e7b60d88bc45 (diff) | |
download | e2fsprogs-abf23439d51a3ddbca475b931abebd381ff7ceea.tar.gz |
Create new ext2fs library inlines: ext2fs_group_{first,last}_block()
Create new ext2fs library inline functions in order to calculate
the starting and ending blocks in a block group.
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
Diffstat (limited to 'misc')
-rw-r--r-- | misc/ChangeLog | 5 | ||||
-rw-r--r-- | misc/dumpe2fs.c | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/misc/ChangeLog b/misc/ChangeLog index da273533..b53fce69 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,5 +1,10 @@ 2006-08-30 Eric Sandeen <esandeen@redhat.com> + * dumpe2fs.c (list_desc): Use new inlines to calculate group + first & last blocks. + +2006-08-30 Eric Sandeen <esandeen@redhat.com> + * dumpe2fs.c (list_bad_blocks): * e2image.c (output_meta_data_blocks, write_raw_image_file): * mke2fs.c (test_disk, handle_bad_blocks): Fix printf formats. diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c index 44883399..68e88508 100644 --- a/misc/dumpe2fs.c +++ b/misc/dumpe2fs.c @@ -153,13 +153,11 @@ static void list_desc (ext2_filsys fs) else old_desc_blocks = fs->desc_blocks; for (i = 0; i < fs->group_desc_count; i++) { + first_block = ext2fs_group_first_block(fs, i); + last_block = ext2fs_group_last_block(fs, i); + ext2fs_super_and_bgd_loc(fs, i, &super_blk, &old_desc_blk, &new_desc_blk, 0); - if (i == fs->group_desc_count - 1) - last_block = fs->super->s_blocks_count - 1; - else - last_block = first_block + - fs->super->s_blocks_per_group - 1; printf (_("Group %lu: (Blocks "), i); print_range(first_block, last_block); @@ -226,7 +224,6 @@ static void list_desc (ext2_filsys fs) fputc('\n', stdout); inode_bitmap += fs->super->s_inodes_per_group / 8; } - first_block += fs->super->s_blocks_per_group; } } |