struct ext2_super_block *sb;
io_channel io = NULL;
void *buf = NULL;
- int blocksize = EXT2_MIN_BLOCK_SIZE;
+ unsigned int blocksize = EXT2_MIN_BLOCK_SIZE;
int blocksize_known = 0;
blk_t bpg = 0;
blk64_t ret_sb = 8193;
blk64_t num_blocks;
if (fs && fs->super) {
- num_blocks = ext2fs_blocks_count(fs->super);
+ limit = ext2fs_blocks_count(fs->super) / this_bpg;
} else if (ctx && ext2fs_get_device_size2(ctx->filesystem_name,
blocksize,
&num_blocks) == 0) {
ext2fs_swap_super(sb);
#endif
if ((sb->s_magic == EXT2_SUPER_MAGIC) &&
- (EXT2_BLOCK_SIZE(sb) == blocksize)) {
+ ((unsigned) EXT2_BLOCK_SIZE(sb) == blocksize)) {
ret_sb = superblock;
if (ctx) {
ctx->superblock = superblock;