Many files:

alloc_tables.c (ext2fs_allocate_group_table): Fix bug so that if the
  	stride length hits a bad value, we retry the block allocation starting
  	at the beginning of the block group.
  ext2fs.h, bb_inode.c, block.c, bmove.c, dir_iterate.c, expanddir.c,
  	ext2fsP.h, read_bb.c: Change blkcnt_t to be e2_blkcnt_t to avoid
  	collision with LFS API.
bitmap-optimize
Theodore Ts'o 1998-06-10 20:39:43 +00:00
parent 084307590c
commit 03673dbb04
10 changed files with 31 additions and 15 deletions

View File

@ -1,3 +1,13 @@
1998-06-10 Theodore Ts'o <tytso@rsts-11.mit.edu>
* alloc_tables.c (ext2fs_allocate_group_table): Fix bug so that if
the stride length hits a bad value, we retry the block
allocation starting at the beginning of the block group.
* ext2fs.h, bb_inode.c, block.c, bmove.c, dir_iterate.c,
expanddir.c, ext2fsP.h, read_bb.c: Change blkcnt_t to be
e2_blkcnt_t to avoid collision with LFS API.
1998-05-01 Theodore Ts'o <tytso@rsts-11.mit.edu>
* initialize.c (ext2fs_initialize): Initialize s_inodes_count in a

View File

@ -85,6 +85,9 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, int group,
if (!fs->group_desc[group].bg_block_bitmap) {
retval = ext2fs_get_free_blocks(fs, start_blk, last_blk,
1, bmap, &new_blk);
if (retval == EXT2_ET_BLOCK_ALLOC_FAIL)
retval = ext2fs_get_free_blocks(fs, group_blk,
last_blk, 1, bmap, &new_blk);
if (retval)
return retval;
ext2fs_mark_block_bitmap(bmap, new_blk);
@ -94,6 +97,9 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, int group,
if (!fs->group_desc[group].bg_inode_bitmap) {
retval = ext2fs_get_free_blocks(fs, start_blk, last_blk,
1, bmap, &new_blk);
if (retval == EXT2_ET_BLOCK_ALLOC_FAIL)
retval = ext2fs_get_free_blocks(fs, group_blk,
last_blk, 1, bmap, &new_blk);
if (retval)
return retval;
ext2fs_mark_block_bitmap(bmap, new_blk);

View File

@ -47,11 +47,11 @@ struct set_badblock_record {
};
static int set_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
blkcnt_t blockcnt,
e2_blkcnt_t blockcnt,
blk_t ref_block, int ref_offset,
void *priv_data);
static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
blkcnt_t blockcnt,
e2_blkcnt_t blockcnt,
blk_t ref_block, int ref_offset,
void *priv_data);
@ -166,7 +166,7 @@ cleanup:
#pragma argsused
#endif
static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
blkcnt_t blockcnt,
e2_blkcnt_t blockcnt,
blk_t ref_block, int ref_offset,
void *priv_data)
{
@ -228,7 +228,7 @@ static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
#pragma argsused
#endif
static int set_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
blkcnt_t blockcnt, blk_t ref_block,
e2_blkcnt_t blockcnt, blk_t ref_block,
int ref_offset, void *priv_data)
{
struct set_badblock_record *rec = (struct set_badblock_record *)

View File

@ -27,11 +27,11 @@ struct block_context {
ext2_filsys fs;
int (*func)(ext2_filsys fs,
blk_t *blocknr,
blkcnt_t bcount,
e2_blkcnt_t bcount,
blk_t ref_blk,
int ref_offset,
void *priv_data);
blkcnt_t bcount;
e2_blkcnt_t bcount;
int bsize;
int flags;
errcode_t errcode;
@ -307,7 +307,7 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs,
char *block_buf,
int (*func)(ext2_filsys fs,
blk_t *blocknr,
blkcnt_t blockcnt,
e2_blkcnt_t blockcnt,
blk_t ref_blk,
int ref_offset,
void *priv_data),
@ -445,7 +445,7 @@ struct xlate {
#ifdef __TURBOC__
#pragma argsused
#endif
static int xlate_func(ext2_filsys fs, blk_t *blocknr, blkcnt_t blockcnt,
static int xlate_func(ext2_filsys fs, blk_t *blocknr, e2_blkcnt_t blockcnt,
blk_t ref_block, int ref_offset, void *priv_data)
{
struct xlate *xl = (struct xlate *) priv_data;

View File

@ -38,7 +38,7 @@ struct process_block_struct {
};
static int process_block(ext2_filsys fs, blk_t *block_nr,
blkcnt_t blockcnt, blk_t ref_block,
e2_blkcnt_t blockcnt, blk_t ref_block,
int ref_offset, void *priv_data)
{
struct process_block_struct *pb;

View File

@ -74,7 +74,7 @@ errcode_t ext2fs_dir_iterate(ext2_filsys fs,
*/
extern int ext2fs_process_dir_block(ext2_filsys fs,
blk_t *blocknr,
blkcnt_t blockcnt,
e2_blkcnt_t blockcnt,
blk_t ref_block,
int ref_offset,
void *priv_data)

View File

@ -30,7 +30,7 @@ struct expand_dir_struct {
static int expand_dir_proc(ext2_filsys fs,
blk_t *blocknr,
blkcnt_t blockcnt,
e2_blkcnt_t blockcnt,
blk_t ref_block,
int ref_offset,
void *priv_data)

View File

@ -54,7 +54,7 @@ typedef unsigned long long __u64;
typedef __u32 blk_t;
typedef unsigned int dgrp_t;
typedef __u32 ext2_off_t;
typedef __s64 blkcnt_t;
typedef __s64 e2_blkcnt_t;
#if EXT2_FLAT_INCLUDES
#include "com_err.h"
@ -554,7 +554,7 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs,
char *block_buf,
int (*func)(ext2_filsys fs,
blk_t *blocknr,
blkcnt_t blockcnt,
e2_blkcnt_t blockcnt,
blk_t ref_blk,
int ref_offset,
void *priv_data),

View File

@ -85,7 +85,7 @@ struct ext2_inode_cache_ent {
extern int ext2fs_process_dir_block(ext2_filsys fs,
blk_t *blocknr,
blkcnt_t blockcnt,
e2_blkcnt_t blockcnt,
blk_t ref_block,
int ref_offset,
void *priv_data);

View File

@ -43,7 +43,7 @@ struct read_bb_record {
#pragma argsused
#endif
static int mark_bad_block(ext2_filsys fs, blk_t *block_nr,
blkcnt_t blockcnt, blk_t ref_block,
e2_blkcnt_t blockcnt, blk_t ref_block,
int ref_offset, void *priv_data)
{
struct read_bb_record *rb = (struct read_bb_record *) priv_data;