mirror of https://github.com/vitalif/e2fsprogs
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
parent
084307590c
commit
03673dbb04
|
@ -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>
|
1998-05-01 Theodore Ts'o <tytso@rsts-11.mit.edu>
|
||||||
|
|
||||||
* initialize.c (ext2fs_initialize): Initialize s_inodes_count in a
|
* initialize.c (ext2fs_initialize): Initialize s_inodes_count in a
|
||||||
|
|
|
@ -85,6 +85,9 @@ errcode_t ext2fs_allocate_group_table(ext2_filsys fs, int group,
|
||||||
if (!fs->group_desc[group].bg_block_bitmap) {
|
if (!fs->group_desc[group].bg_block_bitmap) {
|
||||||
retval = ext2fs_get_free_blocks(fs, start_blk, last_blk,
|
retval = ext2fs_get_free_blocks(fs, start_blk, last_blk,
|
||||||
1, bmap, &new_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)
|
if (retval)
|
||||||
return retval;
|
return retval;
|
||||||
ext2fs_mark_block_bitmap(bmap, new_blk);
|
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) {
|
if (!fs->group_desc[group].bg_inode_bitmap) {
|
||||||
retval = ext2fs_get_free_blocks(fs, start_blk, last_blk,
|
retval = ext2fs_get_free_blocks(fs, start_blk, last_blk,
|
||||||
1, bmap, &new_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)
|
if (retval)
|
||||||
return retval;
|
return retval;
|
||||||
ext2fs_mark_block_bitmap(bmap, new_blk);
|
ext2fs_mark_block_bitmap(bmap, new_blk);
|
||||||
|
|
|
@ -47,11 +47,11 @@ struct set_badblock_record {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int set_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
|
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,
|
blk_t ref_block, int ref_offset,
|
||||||
void *priv_data);
|
void *priv_data);
|
||||||
static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
|
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,
|
blk_t ref_block, int ref_offset,
|
||||||
void *priv_data);
|
void *priv_data);
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ cleanup:
|
||||||
#pragma argsused
|
#pragma argsused
|
||||||
#endif
|
#endif
|
||||||
static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
|
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,
|
blk_t ref_block, int ref_offset,
|
||||||
void *priv_data)
|
void *priv_data)
|
||||||
{
|
{
|
||||||
|
@ -228,7 +228,7 @@ static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
|
||||||
#pragma argsused
|
#pragma argsused
|
||||||
#endif
|
#endif
|
||||||
static int set_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
|
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)
|
int ref_offset, void *priv_data)
|
||||||
{
|
{
|
||||||
struct set_badblock_record *rec = (struct set_badblock_record *)
|
struct set_badblock_record *rec = (struct set_badblock_record *)
|
||||||
|
|
|
@ -27,11 +27,11 @@ struct block_context {
|
||||||
ext2_filsys fs;
|
ext2_filsys fs;
|
||||||
int (*func)(ext2_filsys fs,
|
int (*func)(ext2_filsys fs,
|
||||||
blk_t *blocknr,
|
blk_t *blocknr,
|
||||||
blkcnt_t bcount,
|
e2_blkcnt_t bcount,
|
||||||
blk_t ref_blk,
|
blk_t ref_blk,
|
||||||
int ref_offset,
|
int ref_offset,
|
||||||
void *priv_data);
|
void *priv_data);
|
||||||
blkcnt_t bcount;
|
e2_blkcnt_t bcount;
|
||||||
int bsize;
|
int bsize;
|
||||||
int flags;
|
int flags;
|
||||||
errcode_t errcode;
|
errcode_t errcode;
|
||||||
|
@ -307,7 +307,7 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs,
|
||||||
char *block_buf,
|
char *block_buf,
|
||||||
int (*func)(ext2_filsys fs,
|
int (*func)(ext2_filsys fs,
|
||||||
blk_t *blocknr,
|
blk_t *blocknr,
|
||||||
blkcnt_t blockcnt,
|
e2_blkcnt_t blockcnt,
|
||||||
blk_t ref_blk,
|
blk_t ref_blk,
|
||||||
int ref_offset,
|
int ref_offset,
|
||||||
void *priv_data),
|
void *priv_data),
|
||||||
|
@ -445,7 +445,7 @@ struct xlate {
|
||||||
#ifdef __TURBOC__
|
#ifdef __TURBOC__
|
||||||
#pragma argsused
|
#pragma argsused
|
||||||
#endif
|
#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)
|
blk_t ref_block, int ref_offset, void *priv_data)
|
||||||
{
|
{
|
||||||
struct xlate *xl = (struct xlate *) priv_data;
|
struct xlate *xl = (struct xlate *) priv_data;
|
||||||
|
|
|
@ -38,7 +38,7 @@ struct process_block_struct {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int process_block(ext2_filsys fs, blk_t *block_nr,
|
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)
|
int ref_offset, void *priv_data)
|
||||||
{
|
{
|
||||||
struct process_block_struct *pb;
|
struct process_block_struct *pb;
|
||||||
|
|
|
@ -74,7 +74,7 @@ errcode_t ext2fs_dir_iterate(ext2_filsys fs,
|
||||||
*/
|
*/
|
||||||
extern int ext2fs_process_dir_block(ext2_filsys fs,
|
extern int ext2fs_process_dir_block(ext2_filsys fs,
|
||||||
blk_t *blocknr,
|
blk_t *blocknr,
|
||||||
blkcnt_t blockcnt,
|
e2_blkcnt_t blockcnt,
|
||||||
blk_t ref_block,
|
blk_t ref_block,
|
||||||
int ref_offset,
|
int ref_offset,
|
||||||
void *priv_data)
|
void *priv_data)
|
||||||
|
|
|
@ -30,7 +30,7 @@ struct expand_dir_struct {
|
||||||
|
|
||||||
static int expand_dir_proc(ext2_filsys fs,
|
static int expand_dir_proc(ext2_filsys fs,
|
||||||
blk_t *blocknr,
|
blk_t *blocknr,
|
||||||
blkcnt_t blockcnt,
|
e2_blkcnt_t blockcnt,
|
||||||
blk_t ref_block,
|
blk_t ref_block,
|
||||||
int ref_offset,
|
int ref_offset,
|
||||||
void *priv_data)
|
void *priv_data)
|
||||||
|
|
|
@ -54,7 +54,7 @@ typedef unsigned long long __u64;
|
||||||
typedef __u32 blk_t;
|
typedef __u32 blk_t;
|
||||||
typedef unsigned int dgrp_t;
|
typedef unsigned int dgrp_t;
|
||||||
typedef __u32 ext2_off_t;
|
typedef __u32 ext2_off_t;
|
||||||
typedef __s64 blkcnt_t;
|
typedef __s64 e2_blkcnt_t;
|
||||||
|
|
||||||
#if EXT2_FLAT_INCLUDES
|
#if EXT2_FLAT_INCLUDES
|
||||||
#include "com_err.h"
|
#include "com_err.h"
|
||||||
|
@ -554,7 +554,7 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs,
|
||||||
char *block_buf,
|
char *block_buf,
|
||||||
int (*func)(ext2_filsys fs,
|
int (*func)(ext2_filsys fs,
|
||||||
blk_t *blocknr,
|
blk_t *blocknr,
|
||||||
blkcnt_t blockcnt,
|
e2_blkcnt_t blockcnt,
|
||||||
blk_t ref_blk,
|
blk_t ref_blk,
|
||||||
int ref_offset,
|
int ref_offset,
|
||||||
void *priv_data),
|
void *priv_data),
|
||||||
|
|
|
@ -85,7 +85,7 @@ struct ext2_inode_cache_ent {
|
||||||
|
|
||||||
extern int ext2fs_process_dir_block(ext2_filsys fs,
|
extern int ext2fs_process_dir_block(ext2_filsys fs,
|
||||||
blk_t *blocknr,
|
blk_t *blocknr,
|
||||||
blkcnt_t blockcnt,
|
e2_blkcnt_t blockcnt,
|
||||||
blk_t ref_block,
|
blk_t ref_block,
|
||||||
int ref_offset,
|
int ref_offset,
|
||||||
void *priv_data);
|
void *priv_data);
|
||||||
|
|
|
@ -43,7 +43,7 @@ struct read_bb_record {
|
||||||
#pragma argsused
|
#pragma argsused
|
||||||
#endif
|
#endif
|
||||||
static int mark_bad_block(ext2_filsys fs, blk_t *block_nr,
|
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)
|
int ref_offset, void *priv_data)
|
||||||
{
|
{
|
||||||
struct read_bb_record *rb = (struct read_bb_record *) priv_data;
|
struct read_bb_record *rb = (struct read_bb_record *) priv_data;
|
||||||
|
|
Loading…
Reference in New Issue