diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index bbe24785..b59f18ce 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,51 @@ +Sat Jan 17 13:13:31 1998 Theodore Ts'o + + * inode.c (ext2fs_open_inode_scan): Initialize the group variables + so that we don't need to call get_next_blockgroup() the + first time around. Saves a bit of time, and prevents us + from needing to assign -1 to current_group (which is an + unsigned value). + + * icount.c (insert_icount_el): Cast the estimated number of inodes + from a float to an ino_t. + + * alloc.c, alloc_tables.c, badlbocks.c, bb_compat.c, bb_inode.c, + bitmaps.c, bitops.c, block.c, bmap.c, bmove.c, brel_ma.c, + check_desc.c, closefs.c, cmp_bitmaps.c, dblist.c, + dblist_dir.c, dir_iterate.c, dirblock.c, dupfs.c, + expanddir.c, ext2fs.h, fileio.c, freefs.c, + get_pathname.c, getsize.c, icount.c, initialize.c, + inline.c, inode.c, irel_ma.c, ismounted.c, link.c, + lookup.c, mkdir.c, namei.c, native.c, newdir.c, + openfs.c, read_bb.c, read_bb_file.c, rs_bitmap.c, + rw_bitmaps.c, swapfs.c, test_io.c, tst_badblocks.c, + tst_getsize.c, tst_iscan.c, unix_io.c, unlink.c, + valid_blk.c, version.c: If EXT2_FLAT_INCLUDES is + defined, then assume all of the + ext2-specific header files are in a flat directory. + + * block.c, bmove.c, dirblock.c, fileio.c: Explicitly cast + all assignments from void * to be compatible with C++. + +Tue Jan 6 11:28:15 1998 Theodore Ts'o + + * closefs.c (ext2fs_flush): Add a call to io_channel_flush() to + make sure the contents of the disk are flushed to disk. + +Mon Dec 29 14:39:13 1997 Theodore Ts'o + + * dblist.c (ext2fs_add_dir_block): Change new to be new_entry to + avoid C++ namespace clash. + + * bitmaps.c (ext2fs_copy_bitmap): Change new to be new_map to + avoid C++ namespace clash. + + * ext2fs.h, bb_inode.c, block.c, bmove.c, brel.h, brel_ma.c, + irel.h, irel_ma.c, dblist.c, dblist_dir.c, dir_iterate.c, + ext2fsP.h, expanddir.c, get_pathname.c, inode.c, link.c, + unlink.c: Change private to be priv_data (to avoid C++ + namespace clash) + Fri Nov 28 09:26:31 1997 Theodore Ts'o * dblist.c (ext2fs_get_num_dirs): Make ext2fs_get_num_dirs more diff --git a/lib/ext2fs/alloc.c b/lib/ext2fs/alloc.c index 6e7b5537..fa71406c 100644 --- a/lib/ext2fs/alloc.c +++ b/lib/ext2fs/alloc.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/alloc_tables.c b/lib/ext2fs/alloc_tables.c index 8c42cd7b..3a057596 100644 --- a/lib/ext2fs/alloc_tables.c +++ b/lib/ext2fs/alloc_tables.c @@ -24,7 +24,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/badblocks.c b/lib/ext2fs/badblocks.c index fba2d997..9d43444a 100644 --- a/lib/ext2fs/badblocks.c +++ b/lib/ext2fs/badblocks.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fsP.h" diff --git a/lib/ext2fs/bb_compat.c b/lib/ext2fs/bb_compat.c index ec4911e4..63b0aadd 100644 --- a/lib/ext2fs/bb_compat.c +++ b/lib/ext2fs/bb_compat.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fsP.h" diff --git a/lib/ext2fs/bb_inode.c b/lib/ext2fs/bb_inode.c index eab5a78f..cc867cd5 100644 --- a/lib/ext2fs/bb_inode.c +++ b/lib/ext2fs/bb_inode.c @@ -27,7 +27,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" @@ -43,10 +47,11 @@ struct set_badblock_record { }; static int set_bad_block_proc(ext2_filsys fs, blk_t *block_nr, int blockcnt, - blk_t ref_block, int ref_offset, void *private); + blk_t ref_block, int ref_offset, + void *priv_data); static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr, int blockcnt, blk_t ref_block, int ref_offset, - void *private); + void *priv_data); /* * Given a bad blocks bitmap, update the bad blocks inode to reflect @@ -159,10 +164,11 @@ cleanup: #pragma argsused #endif static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr, int blockcnt, - blk_t ref_block, int ref_offset, void *private) + blk_t ref_block, int ref_offset, + void *priv_data) { struct set_badblock_record *rec = (struct set_badblock_record *) - private; + priv_data; errcode_t retval; int group; @@ -217,10 +223,10 @@ static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr, int blockcnt, #endif static int set_bad_block_proc(ext2_filsys fs, blk_t *block_nr, int blockcnt, blk_t ref_block, - int ref_offset, void *private) + int ref_offset, void *priv_data) { struct set_badblock_record *rec = (struct set_badblock_record *) - private; + priv_data; errcode_t retval; blk_t blk; int group; diff --git a/lib/ext2fs/bitmaps.c b/lib/ext2fs/bitmaps.c index e50560c5..cbfd43d5 100644 --- a/lib/ext2fs/bitmaps.c +++ b/lib/ext2fs/bitmaps.c @@ -24,7 +24,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" @@ -87,16 +91,16 @@ errcode_t ext2fs_copy_bitmap(ext2fs_generic_bitmap src, ext2fs_generic_bitmap *dest) { errcode_t retval; - ext2fs_generic_bitmap new; + ext2fs_generic_bitmap new_map; retval = make_bitmap(src->start, src->end, src->real_end, - src->description, src->bitmap, &new); + src->description, src->bitmap, &new_map); if (retval) return retval; - new->magic = src->magic; - new->fs = src->fs; - new->base_error_code = src->base_error_code; - *dest = new; + new_map->magic = src->magic; + new_map->fs = src->fs; + new_map->base_error_code = src->base_error_code; + *dest = new_map; return 0; } diff --git a/lib/ext2fs/bitops.c b/lib/ext2fs/bitops.c index 7286e7df..3a74c020 100644 --- a/lib/ext2fs/bitops.c +++ b/lib/ext2fs/bitops.c @@ -15,7 +15,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c index c594d8d3..1293403b 100644 --- a/lib/ext2fs/block.c +++ b/lib/ext2fs/block.c @@ -15,7 +15,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" @@ -26,7 +30,7 @@ struct block_context { int bcount, blk_t ref_blk, int ref_offset, - void *private); + void *priv_data); int bcount; int bsize; int flags; @@ -34,7 +38,7 @@ struct block_context { char *ind_buf; char *dind_buf; char *tind_buf; - void *private; + void *priv_data; }; static int block_iterate_ind(blk_t *ind_block, blk_t ref_block, @@ -49,7 +53,7 @@ static int block_iterate_ind(blk_t *ind_block, blk_t ref_block, !(ctx->flags & BLOCK_FLAG_DATA_ONLY)) ret = (*ctx->func)(ctx->fs, ind_block, BLOCK_COUNT_IND, ref_block, - ref_offset, ctx->private); + ref_offset, ctx->priv_data); if (!*ind_block || (ret & BLOCK_ABORT)) { ctx->bcount += limit; return ret; @@ -78,7 +82,7 @@ static int block_iterate_ind(blk_t *ind_block, blk_t ref_block, for (i = 0; i < limit; i++, ctx->bcount++, block_nr++) { flags = (*ctx->func)(ctx->fs, block_nr, ctx->bcount, *ind_block, offset, - ctx->private); + ctx->priv_data); changed |= flags; if (flags & BLOCK_ABORT) { ret |= BLOCK_ABORT; @@ -92,7 +96,7 @@ static int block_iterate_ind(blk_t *ind_block, blk_t ref_block, continue; flags = (*ctx->func)(ctx->fs, block_nr, ctx->bcount, *ind_block, offset, - ctx->private); + ctx->priv_data); changed |= flags; if (flags & BLOCK_ABORT) { ret |= BLOCK_ABORT; @@ -118,7 +122,7 @@ static int block_iterate_ind(blk_t *ind_block, blk_t ref_block, !(ret & BLOCK_ABORT)) ret |= (*ctx->func)(ctx->fs, ind_block, BLOCK_COUNT_IND, ref_block, - ref_offset, ctx->private); + ref_offset, ctx->priv_data); return ret; } @@ -134,7 +138,7 @@ static int block_iterate_dind(blk_t *dind_block, blk_t ref_block, !(ctx->flags & BLOCK_FLAG_DATA_ONLY)) ret = (*ctx->func)(ctx->fs, dind_block, BLOCK_COUNT_DIND, ref_block, - ref_offset, ctx->private); + ref_offset, ctx->priv_data); if (!*dind_block || (ret & BLOCK_ABORT)) { ctx->bcount += limit*limit; return ret; @@ -205,7 +209,7 @@ static int block_iterate_dind(blk_t *dind_block, blk_t ref_block, !(ret & BLOCK_ABORT)) ret |= (*ctx->func)(ctx->fs, dind_block, BLOCK_COUNT_DIND, ref_block, - ref_offset, ctx->private); + ref_offset, ctx->priv_data); return ret; } @@ -221,7 +225,7 @@ static int block_iterate_tind(blk_t *tind_block, blk_t ref_block, !(ctx->flags & BLOCK_FLAG_DATA_ONLY)) ret = (*ctx->func)(ctx->fs, tind_block, BLOCK_COUNT_TIND, ref_block, - ref_offset, ctx->private); + ref_offset, ctx->priv_data); if (!*tind_block || (ret & BLOCK_ABORT)) { ctx->bcount += limit*limit*limit; return ret; @@ -292,7 +296,7 @@ static int block_iterate_tind(blk_t *tind_block, blk_t ref_block, !(ret & BLOCK_ABORT)) ret |= (*ctx->func)(ctx->fs, tind_block, BLOCK_COUNT_TIND, ref_block, - ref_offset, ctx->private); + ref_offset, ctx->priv_data); return ret; } @@ -306,8 +310,8 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs, int blockcnt, blk_t ref_blk, int ref_offset, - void *private), - void *private) + void *priv_data), + void *priv_data) { int i; int got_inode = 0; @@ -325,7 +329,7 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs, ctx.fs = fs; ctx.func = func; - ctx.private = private; + ctx.priv_data = priv_data; ctx.flags = flags; ctx.bcount = 0; if (block_buf) { @@ -352,7 +356,7 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs, ret |= (*ctx.func)(fs, &inode.osd1.hurd1.h_i_translator, BLOCK_COUNT_TRANSLATOR, - 0, 0, private); + 0, 0, priv_data); if (ret & BLOCK_ABORT) goto abort; } @@ -364,7 +368,7 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs, for (i = 0; i < EXT2_NDIR_BLOCKS ; i++, ctx.bcount++) { if (blocks[i] || (flags & BLOCK_FLAG_APPEND)) { ret |= (*ctx.func)(fs, &blocks[i], - ctx.bcount, 0, 0, private); + ctx.bcount, 0, 0, priv_data); if (ret & BLOCK_ABORT) goto abort; } @@ -412,7 +416,7 @@ struct xlate { int (*func)(ext2_filsys fs, blk_t *blocknr, int bcount, - void *private); + void *priv_data); void *real_private; }; @@ -420,9 +424,9 @@ struct xlate { #pragma argsused #endif static int xlate_func(ext2_filsys fs, blk_t *blocknr, int blockcnt, - blk_t ref_block, int ref_offset, void *private) + blk_t ref_block, int ref_offset, void *priv_data) { - struct xlate *xl = private; + struct xlate *xl = (struct xlate *) priv_data; return (*xl->func)(fs, blocknr, blockcnt, xl->real_private); } @@ -434,12 +438,12 @@ errcode_t ext2fs_block_iterate(ext2_filsys fs, int (*func)(ext2_filsys fs, blk_t *blocknr, int blockcnt, - void *private), - void *private) + void *priv_data), + void *priv_data) { struct xlate xl; - xl.real_private = private; + xl.real_private = priv_data; xl.func = func; return ext2fs_block_iterate2(fs, ino, flags, block_buf, diff --git a/lib/ext2fs/bmap.c b/lib/ext2fs/bmap.c index ec421cee..e4846e81 100644 --- a/lib/ext2fs/bmap.c +++ b/lib/ext2fs/bmap.c @@ -15,7 +15,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/bmove.c b/lib/ext2fs/bmove.c index 0a5a80c0..1d408603 100644 --- a/lib/ext2fs/bmove.c +++ b/lib/ext2fs/bmove.c @@ -18,7 +18,12 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif + #include "ext2fs/ext2fs.h" struct process_block_struct { @@ -34,13 +39,14 @@ struct process_block_struct { static int process_block(ext2_filsys fs, blk_t *block_nr, int blockcnt, blk_t ref_block, - int ref_offset, void *private) + int ref_offset, void *priv_data) { - struct process_block_struct *pb = private; + struct process_block_struct *pb; errcode_t retval; int ret; blk_t block, orig; + pb = (struct process_block_struct *) priv_data; block = orig = *block_nr; ret = 0; diff --git a/lib/ext2fs/brel.h b/lib/ext2fs/brel.h index 22089c3e..a8d83b7b 100644 --- a/lib/ext2fs/brel.h +++ b/lib/ext2fs/brel.h @@ -29,7 +29,7 @@ struct ext2_block_relocation_table { __u32 magic; char *name; blk_t current; - void *private; + void *priv_data; /* * Add a block relocation entry. diff --git a/lib/ext2fs/brel_ma.c b/lib/ext2fs/brel_ma.c index c515e4a4..3dbdc840 100644 --- a/lib/ext2fs/brel_ma.c +++ b/lib/ext2fs/brel_ma.c @@ -22,7 +22,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" #include "brel.h" @@ -72,7 +76,7 @@ errcode_t ext2fs_brel_memarray_create(char *name, blk_t max_block, if (retval) goto errout; memset(ma, 0, sizeof(struct brel_ma)); - brel->private = ma; + brel->priv_data = ma; size = (size_t) (sizeof(struct ext2_block_relocate_entry) * (max_block+1)); @@ -106,7 +110,7 @@ static errcode_t bma_put(ext2_brel brel, blk_t old, { struct brel_ma *ma; - ma = brel->private; + ma = brel->priv_data; if (old > ma->max_block) return EXT2_ET_INVALID_ARGUMENT; ma->entries[(unsigned)old] = *ent; @@ -118,7 +122,7 @@ static errcode_t bma_get(ext2_brel brel, blk_t old, { struct brel_ma *ma; - ma = brel->private; + ma = brel->priv_data; if (old > ma->max_block) return EXT2_ET_INVALID_ARGUMENT; if (ma->entries[(unsigned)old].new == 0) @@ -138,7 +142,7 @@ static errcode_t bma_next(ext2_brel brel, blk_t *old, { struct brel_ma *ma; - ma = brel->private; + ma = brel->priv_data; while (++brel->current < ma->max_block) { if (ma->entries[(unsigned)brel->current].new == 0) continue; @@ -154,7 +158,7 @@ static errcode_t bma_move(ext2_brel brel, blk_t old, blk_t new) { struct brel_ma *ma; - ma = brel->private; + ma = brel->priv_data; if ((old > ma->max_block) || (new > ma->max_block)) return EXT2_ET_INVALID_ARGUMENT; if (ma->entries[(unsigned)old].new == 0) @@ -168,7 +172,7 @@ static errcode_t bma_delete(ext2_brel brel, blk_t old) { struct brel_ma *ma; - ma = brel->private; + ma = brel->priv_data; if (old > ma->max_block) return EXT2_ET_INVALID_ARGUMENT; if (ma->entries[(unsigned)old].new == 0) @@ -184,7 +188,7 @@ static errcode_t bma_free(ext2_brel brel) if (!brel) return 0; - ma = brel->private; + ma = brel->priv_data; if (ma) { if (ma->entries) diff --git a/lib/ext2fs/check_desc.c b/lib/ext2fs/check_desc.c index 0764ae4d..d9465702 100644 --- a/lib/ext2fs/check_desc.c +++ b/lib/ext2fs/check_desc.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c index b39b15d2..dca4a1ab 100644 --- a/lib/ext2fs/closefs.c +++ b/lib/ext2fs/closefs.c @@ -16,7 +16,11 @@ #include #include +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fsP.h" @@ -162,7 +166,11 @@ errcode_t ext2fs_flush(ext2_filsys fs) if (retval) goto errout; } - retval = 0; + + /* + * Flush the blocks out to disk + */ + retval = io_channel_flush(fs->io); errout: fs->super->s_state = fs_state; if (fs->flags & EXT2_FLAG_SWAP_BYTES) { diff --git a/lib/ext2fs/cmp_bitmaps.c b/lib/ext2fs/cmp_bitmaps.c index 422606b4..5086d125 100644 --- a/lib/ext2fs/cmp_bitmaps.c +++ b/lib/ext2fs/cmp_bitmaps.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/dblist.c b/lib/ext2fs/dblist.c index 4c15922c..e7567917 100644 --- a/lib/ext2fs/dblist.c +++ b/lib/ext2fs/dblist.c @@ -17,7 +17,11 @@ #include #include +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fsP.h" @@ -154,7 +158,7 @@ errcode_t ext2fs_copy_dblist(ext2_dblist src, ext2_dblist *dest) errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ino_t ino, blk_t blk, int blockcnt) { - struct ext2_db_entry *new; + struct ext2_db_entry *new_entry; errcode_t retval; EXT2_CHECK_MAGIC(dblist, EXT2_ET_MAGIC_DBLIST); @@ -169,10 +173,10 @@ errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ino_t ino, blk_t blk, return retval; } } - new = dblist->list + ( (int) dblist->count++); - new->blk = blk; - new->ino = ino; - new->blockcnt = blockcnt; + new_entry = dblist->list + ( (int) dblist->count++); + new_entry->blk = blk; + new_entry->ino = ino; + new_entry->blockcnt = blockcnt; dblist->sorted = 0; @@ -206,8 +210,8 @@ errcode_t ext2fs_set_dir_block(ext2_dblist dblist, ino_t ino, blk_t blk, errcode_t ext2fs_dblist_iterate(ext2_dblist dblist, int (*func)(ext2_filsys fs, struct ext2_db_entry *db_info, - void *private), - void *private) + void *priv_data), + void *priv_data) { ino_t i; int ret; @@ -220,7 +224,7 @@ errcode_t ext2fs_dblist_iterate(ext2_dblist dblist, dblist->sorted = 1; } for (i=0; i < dblist->count; i++) { - ret = (*func)(dblist->fs, &dblist->list[(int)i], private); + ret = (*func)(dblist->fs, &dblist->list[(int)i], priv_data); if (ret & DBLIST_ABORT) return 0; } diff --git a/lib/ext2fs/dblist_dir.c b/lib/ext2fs/dblist_dir.c index 1594cdc5..7ad159e6 100644 --- a/lib/ext2fs/dblist_dir.c +++ b/lib/ext2fs/dblist_dir.c @@ -17,12 +17,16 @@ #include #include +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fsP.h" static int db_dir_proc(ext2_filsys fs, struct ext2_db_entry *db_info, - void *private); + void *priv_data); extern errcode_t ext2fs_dblist_dir_iterate(ext2_dblist dblist, @@ -34,8 +38,8 @@ extern errcode_t int offset, int blocksize, char *buf, - void *private), - void *private) + void *priv_data), + void *priv_data) { errcode_t retval; struct dir_context ctx; @@ -54,7 +58,7 @@ extern errcode_t } ctx.func = 0; ctx.func2 = func; - ctx.private = private; + ctx.priv_data = priv_data; ctx.errcode = 0; retval = ext2fs_dblist_iterate(dblist, db_dir_proc, &ctx); @@ -67,12 +71,13 @@ extern errcode_t } static int db_dir_proc(ext2_filsys fs, struct ext2_db_entry *db_info, - void *private) + void *priv_data) { - struct dir_context *ctx = private; + struct dir_context *ctx; + ctx = (struct dir_context *) priv_data; ctx->dir = db_info->ino; return ext2fs_process_dir_block(fs, &db_info->blk, - db_info->blockcnt, private); + db_info->blockcnt, priv_data); } diff --git a/lib/ext2fs/dir_iterate.c b/lib/ext2fs/dir_iterate.c index 725cd473..9d185701 100644 --- a/lib/ext2fs/dir_iterate.c +++ b/lib/ext2fs/dir_iterate.c @@ -18,7 +18,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fsP.h" @@ -30,8 +34,8 @@ errcode_t ext2fs_dir_iterate(ext2_filsys fs, int offset, int blocksize, char *buf, - void *private), - void *private) + void *priv_data), + void *priv_data) { struct dir_context ctx; errcode_t retval; @@ -53,7 +57,7 @@ errcode_t ext2fs_dir_iterate(ext2_filsys fs, } ctx.func = func; ctx.func2 = 0; - ctx.private = private; + ctx.priv_data = priv_data; ctx.errcode = 0; retval = ext2fs_block_iterate(fs, dir, 0, 0, ext2fs_process_dir_block, &ctx); @@ -71,9 +75,9 @@ errcode_t ext2fs_dir_iterate(ext2_filsys fs, extern int ext2fs_process_dir_block(ext2_filsys fs, blk_t *blocknr, int blockcnt, - void *private) + void *priv_data) { - struct dir_context *ctx = (struct dir_context *) private; + struct dir_context *ctx = (struct dir_context *) priv_data; int offset = 0; int ret = 0; int changed = 0; @@ -98,11 +102,11 @@ extern int ext2fs_process_dir_block(ext2_filsys fs, if (ctx->func) ret = (ctx->func)(dirent, offset, fs->blocksize, - ctx->buf, ctx->private); + ctx->buf, ctx->priv_data); else if (ctx->func2) { ret = (ctx->func2)(ctx->dir, entry, dirent, offset, fs->blocksize, ctx->buf, - ctx->private); + ctx->priv_data); if (entry < DIRENT_OTHER_FILE) entry++; } diff --git a/lib/ext2fs/dirblock.c b/lib/ext2fs/dirblock.c index 85a38de3..14c2f369 100644 --- a/lib/ext2fs/dirblock.c +++ b/lib/ext2fs/dirblock.c @@ -16,7 +16,11 @@ #include #include +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" @@ -33,7 +37,7 @@ errcode_t ext2fs_read_dir_block(ext2_filsys fs, blk_t block, if ((fs->flags & (EXT2_FLAG_SWAP_BYTES| EXT2_FLAG_SWAP_BYTES_READ)) == 0) return 0; - p = buf; + p = (char *) buf; end = (char *) buf + fs->blocksize; while (p < end) { dirent = (struct ext2_dir_entry *) p; @@ -70,7 +74,7 @@ errcode_t ext2fs_write_dir_block(ext2_filsys fs, blk_t block, dirent->name_len = ext2fs_swab16(dirent->name_len); } } else - write_buf = inbuf; + write_buf = (char *) inbuf; retval = io_channel_write_blk(fs->io, block, 1, write_buf); if (buf) ext2fs_free_mem((void **) &buf); diff --git a/lib/ext2fs/dupfs.c b/lib/ext2fs/dupfs.c index 667726dc..4fb1c3f5 100644 --- a/lib/ext2fs/dupfs.c +++ b/lib/ext2fs/dupfs.c @@ -16,7 +16,11 @@ #include #include +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fsP.h" diff --git a/lib/ext2fs/expanddir.c b/lib/ext2fs/expanddir.c index 07973a46..043e9c04 100644 --- a/lib/ext2fs/expanddir.c +++ b/lib/ext2fs/expanddir.c @@ -15,7 +15,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" @@ -27,9 +31,9 @@ struct expand_dir_struct { static int expand_dir_proc(ext2_filsys fs, blk_t *blocknr, int blockcnt, - void *private) + void *priv_data) { - struct expand_dir_struct *es = (struct expand_dir_struct *) private; + struct expand_dir_struct *es = (struct expand_dir_struct *) priv_data; blk_t new_blk; static blk_t last_blk = 0; char *block; diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h index f19fdbe5..e4e3c3b3 100644 --- a/lib/ext2fs/ext2fs.h +++ b/lib/ext2fs/ext2fs.h @@ -43,9 +43,15 @@ typedef __u32 blk_t; typedef unsigned int dgrp_t; typedef __u32 ext2_off_t; +#if EXT2_FLAT_INCLUDES +#include "com_err.h" +#include "ext2_io.h" +#include "ext2_err.h" +#else #include "et/com_err.h" #include "ext2fs/ext2_io.h" #include "ext2fs/ext2_err.h" +#endif typedef struct struct_ext2_filsys *ext2_filsys; @@ -173,7 +179,7 @@ struct struct_ext2_filsys { /* * Reserved for the use of the calling application. */ - void * private; + void * priv_data; /* * Inode cache @@ -477,8 +483,8 @@ extern errcode_t ext2fs_block_iterate(ext2_filsys fs, int (*func)(ext2_filsys fs, blk_t *blocknr, int blockcnt, - void *private), - void *private); + void *priv_data), + void *priv_data); errcode_t ext2fs_block_iterate2(ext2_filsys fs, ino_t ino, @@ -489,8 +495,8 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs, int blockcnt, blk_t ref_blk, int ref_offset, - void *private), - void *private); + void *priv_data), + void *priv_data); /* bmap.c */ extern errcode_t ext2fs_bmap(ext2_filsys fs, ino_t ino, @@ -527,8 +533,8 @@ extern errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ino_t ino, blk_t blk, int blockcnt); extern errcode_t ext2fs_dblist_iterate(ext2_dblist dblist, int (*func)(ext2_filsys fs, struct ext2_db_entry *db_info, - void *private), - void *private); + void *priv_data), + void *priv_data); extern errcode_t ext2fs_set_dir_block(ext2_dblist dblist, ino_t ino, blk_t blk, int blockcnt); extern errcode_t ext2fs_copy_dblist(ext2_dblist src, @@ -546,8 +552,8 @@ extern errcode_t int offset, int blocksize, char *buf, - void *private), - void *private); + void *priv_data), + void *priv_data); /* dirblock.c */ extern errcode_t ext2fs_read_dir_block(ext2_filsys fs, blk_t block, @@ -564,13 +570,13 @@ extern errcode_t ext2fs_dir_iterate(ext2_filsys fs, int offset, int blocksize, char *buf, - void *private), - void *private); - /* private to library */ + void *priv_data), + void *priv_data); + /* priv_data to library */ extern int ext2fs_process_dir_block(ext2_filsys fs, blk_t *blocknr, int blockcnt, - void *private); + void *priv_data); /* dupfs.c */ extern errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest); @@ -622,7 +628,7 @@ extern void ext2fs_set_inode_callback errcode_t (*done_group)(ext2_filsys fs, ext2_inode_scan scan, dgrp_t group, - void * private), + void * priv_data), void *done_group_data); extern int ext2fs_inode_scan_flags(ext2_inode_scan scan, int set_flags, int clear_flags); diff --git a/lib/ext2fs/ext2fsP.h b/lib/ext2fs/ext2fsP.h index 113a9b69..f5bc1bef 100644 --- a/lib/ext2fs/ext2fsP.h +++ b/lib/ext2fs/ext2fsP.h @@ -52,15 +52,15 @@ struct dir_context { int offset, int blocksize, char *buf, - void *private); + void *priv_data); int (*func2)(ino_t dir, int entry, struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, - void *private); - void *private; + void *priv_data); + void *priv_data; errcode_t errcode; }; @@ -86,5 +86,5 @@ struct ext2_inode_cache_ent { extern int ext2_process_dir_block(ext2_filsys fs, blk_t *blocknr, int blockcnt, - void *private); + void *priv_data); diff --git a/lib/ext2fs/fileio.c b/lib/ext2fs/fileio.c index f0e55e14..fbe10fb9 100644 --- a/lib/ext2fs/fileio.c +++ b/lib/ext2fs/fileio.c @@ -15,7 +15,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" @@ -145,7 +149,7 @@ errcode_t ext2fs_file_read(ext2_file_t file, void *buf, errcode_t retval; blk_t b, pb; unsigned int start, left, c, count = 0; - char *ptr = buf; + char *ptr = (char *) buf; EXT2_CHECK_MAGIC(file, EXT2_ET_MAGIC_EXT2_FILE); fs = file->fs; @@ -215,7 +219,7 @@ errcode_t ext2fs_file_write(ext2_file_t file, void *buf, errcode_t retval; blk_t b, pb; unsigned int start, c, count = 0; - char *ptr = buf; + char *ptr = (char *) buf; EXT2_CHECK_MAGIC(file, EXT2_ET_MAGIC_EXT2_FILE); fs = file->fs; diff --git a/lib/ext2fs/freefs.c b/lib/ext2fs/freefs.c index 52a769e4..e5db058b 100644 --- a/lib/ext2fs/freefs.c +++ b/lib/ext2fs/freefs.c @@ -14,7 +14,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fsP.h" diff --git a/lib/ext2fs/get_pathname.c b/lib/ext2fs/get_pathname.c index 9ace71a7..b8a9f833 100644 --- a/lib/ext2fs/get_pathname.c +++ b/lib/ext2fs/get_pathname.c @@ -24,7 +24,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" @@ -42,12 +46,12 @@ static int get_pathname_proc(struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, - void *private) + void *priv_data) { struct get_pathname_struct *gp; errcode_t retval; - gp = (struct get_pathname_struct *) private; + gp = (struct get_pathname_struct *) priv_data; if ((dirent->name_len == 2) && !strncmp(dirent->name, "..", 2)) diff --git a/lib/ext2fs/getsize.c b/lib/ext2fs/getsize.c index a8cd59cd..296035d1 100644 --- a/lib/ext2fs/getsize.c +++ b/lib/ext2fs/getsize.c @@ -26,7 +26,12 @@ #include #endif /* HAVE_SYS_DISKLABEL_H */ +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif + #include "ext2fs.h" static int valid_offset (int fd, ext2_loff_t offset) diff --git a/lib/ext2fs/icount.c b/lib/ext2fs/icount.c index 72ef44d7..9abce82d 100644 --- a/lib/ext2fs/icount.c +++ b/lib/ext2fs/icount.c @@ -16,7 +16,12 @@ #include #include +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif + #include "ext2fs.h" /* @@ -170,8 +175,8 @@ static struct ext2_icount_el *insert_icount_el(ext2_icount_t icount, if (icount->count >= icount->size) { if (icount->count) { new_size = icount->list[(unsigned)icount->count-1].ino; - new_size = icount->count * - ((float) new_size / icount->num_inodes); + new_size = (ino_t) (icount->count * + ((float) new_size / icount->num_inodes)); } if (new_size < (icount->size + 100)) new_size = icount->size + 100; diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c index 4ab44de4..ebc41e62 100644 --- a/lib/ext2fs/initialize.c +++ b/lib/ext2fs/initialize.c @@ -24,7 +24,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/inline.c b/lib/ext2fs/inline.c index fc096689..729dd5de 100644 --- a/lib/ext2fs/inline.c +++ b/lib/ext2fs/inline.c @@ -26,7 +26,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #define INCLUDE_INLINE_FUNCS diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c index d72e00cc..cceaa957 100644 --- a/lib/ext2fs/inode.c +++ b/lib/ext2fs/inode.c @@ -21,7 +21,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fsP.h" @@ -43,7 +47,7 @@ struct ext2_struct_inode_scan { errcode_t (*done_group)(ext2_filsys fs, ext2_inode_scan scan, dgrp_t group, - void * private); + void * priv_data); void * done_group_data; int bad_block_ptr; int scan_flags; @@ -123,9 +127,13 @@ errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks, scan->fs = fs; scan->inode_size = EXT2_INODE_SIZE(fs->super); scan->bytes_left = 0; - scan->current_group = -1; + scan->current_group = 0; + scan->groups_left = fs->group_desc_count - 1; scan->inode_buffer_blocks = buffer_blocks ? buffer_blocks : 8; - scan->groups_left = fs->group_desc_count; + scan->current_block = scan->fs-> + group_desc[scan->current_group].bg_inode_table; + scan->inodes_left = EXT2_INODES_PER_GROUP(scan->fs->super); + scan->blocks_left = scan->fs->inode_blocks_per_group; retval = ext2fs_get_mem((size_t) (scan->inode_buffer_blocks * fs->blocksize), (void **) &scan->inode_buffer); @@ -166,7 +174,7 @@ void ext2fs_set_inode_callback(ext2_inode_scan scan, errcode_t (*done_group)(ext2_filsys fs, ext2_inode_scan scan, dgrp_t group, - void * private), + void * priv_data), void *done_group_data) { if (!scan || (scan->magic != EXT2_ET_MAGIC_INODE_SCAN)) diff --git a/lib/ext2fs/irel.h b/lib/ext2fs/irel.h index 9c7529ab..6c76ed5f 100644 --- a/lib/ext2fs/irel.h +++ b/lib/ext2fs/irel.h @@ -27,7 +27,7 @@ struct ext2_inode_relocation_table { __u32 magic; char *name; ino_t current; - void *private; + void *priv_data; /* * Add an inode relocation entry. diff --git a/lib/ext2fs/irel_ma.c b/lib/ext2fs/irel_ma.c index 2ca6fb5c..97ab8259 100644 --- a/lib/ext2fs/irel_ma.c +++ b/lib/ext2fs/irel_ma.c @@ -19,7 +19,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" #include "irel.h" @@ -88,7 +92,7 @@ errcode_t ext2fs_irel_memarray_create(char *name, ino_t max_inode, if (retval) goto errout; memset(ma, 0, sizeof(struct irel_ma)); - irel->private = ma; + irel->priv_data = ma; size = (size_t) (sizeof(ino_t) * (max_inode+1)); retval = ext2fs_get_mem(size, (void **) &ma->orig_map); @@ -142,7 +146,7 @@ static errcode_t ima_put(ext2_irel irel, ino_t old, errcode_t retval; int size; - ma = irel->private; + ma = irel->priv_data; if (old > ma->max_inode) return EXT2_ET_INVALID_ARGUMENT; @@ -177,7 +181,7 @@ static errcode_t ima_get(ext2_irel irel, ino_t old, { struct irel_ma *ma; - ma = irel->private; + ma = irel->priv_data; if (old > ma->max_inode) return EXT2_ET_INVALID_ARGUMENT; if (ma->entries[(unsigned) old].new == 0) @@ -192,7 +196,7 @@ static errcode_t ima_get_by_orig(ext2_irel irel, ino_t orig, ino_t *old, struct irel_ma *ma; ino_t ino; - ma = irel->private; + ma = irel->priv_data; if (orig > ma->max_inode) return EXT2_ET_INVALID_ARGUMENT; ino = ma->orig_map[(unsigned) orig]; @@ -214,7 +218,7 @@ static errcode_t ima_next(ext2_irel irel, ino_t *old, { struct irel_ma *ma; - ma = irel->private; + ma = irel->priv_data; while (++irel->current < ma->max_inode) { if (ma->entries[(unsigned) irel->current].new == 0) continue; @@ -235,7 +239,7 @@ static errcode_t ima_add_ref(ext2_irel irel, ino_t ino, struct ext2_inode_relocate_entry *ent; errcode_t retval; - ma = irel->private; + ma = irel->priv_data; if (ino > ma->max_inode) return EXT2_ET_INVALID_ARGUMENT; @@ -266,7 +270,7 @@ static errcode_t ima_start_iter_ref(ext2_irel irel, ino_t ino) { struct irel_ma *ma; - ma = irel->private; + ma = irel->priv_data; if (ino > ma->max_inode) return EXT2_ET_INVALID_ARGUMENT; if (ma->entries[(unsigned) ino].new == 0) @@ -282,7 +286,7 @@ static errcode_t ima_next_ref(ext2_irel irel, struct irel_ma *ma; struct inode_reference_entry *ref_ent; - ma = irel->private; + ma = irel->priv_data; ref_ent = ma->ref_entries + ma->ref_current; @@ -301,7 +305,7 @@ static errcode_t ima_move(ext2_irel irel, ino_t old, ino_t new) { struct irel_ma *ma; - ma = irel->private; + ma = irel->priv_data; if ((old > ma->max_inode) || (new > ma->max_inode)) return EXT2_ET_INVALID_ARGUMENT; if (ma->entries[(unsigned) old].new == 0) @@ -324,7 +328,7 @@ static errcode_t ima_delete(ext2_irel irel, ino_t old) { struct irel_ma *ma; - ma = irel->private; + ma = irel->priv_data; if (old > ma->max_inode) return EXT2_ET_INVALID_ARGUMENT; if (ma->entries[(unsigned) old].new == 0) @@ -348,7 +352,7 @@ static errcode_t ima_free(ext2_irel irel) if (!irel) return 0; - ma = irel->private; + ma = irel->priv_data; if (ma) { if (ma->orig_map) diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c index 0761ec8e..f1a69963 100644 --- a/lib/ext2fs/ismounted.c +++ b/lib/ext2fs/ismounted.c @@ -29,7 +29,12 @@ #include #endif /* HAVE_GETMNTINFO */ +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif + #include "ext2fs.h" #ifdef HAVE_MNTENT_H diff --git a/lib/ext2fs/link.c b/lib/ext2fs/link.c index 978a6f3b..b1a1572e 100644 --- a/lib/ext2fs/link.c +++ b/lib/ext2fs/link.c @@ -15,7 +15,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" @@ -31,9 +35,9 @@ static int link_proc(struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, - void *private) + void *priv_data) { - struct link_struct *ls = (struct link_struct *) private; + struct link_struct *ls = (struct link_struct *) priv_data; struct ext2_dir_entry *next; int rec_len; int ret = 0; diff --git a/lib/ext2fs/lookup.c b/lib/ext2fs/lookup.c index 833ba4e5..7996c16b 100644 --- a/lib/ext2fs/lookup.c +++ b/lib/ext2fs/lookup.c @@ -15,7 +15,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" @@ -33,9 +37,9 @@ static int lookup_proc(struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, - void *private) + void *priv_data) { - struct lookup_struct *ls = (struct lookup_struct *) private; + struct lookup_struct *ls = (struct lookup_struct *) priv_data; if (ls->len != dirent->name_len) return 0; diff --git a/lib/ext2fs/mkdir.c b/lib/ext2fs/mkdir.c index f517ba37..b2e8094d 100644 --- a/lib/ext2fs/mkdir.c +++ b/lib/ext2fs/mkdir.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/namei.c b/lib/ext2fs/namei.c index f44c7df3..c9bf6ce7 100644 --- a/lib/ext2fs/namei.c +++ b/lib/ext2fs/namei.c @@ -17,7 +17,11 @@ /* #define NAMEI_DEBUG */ +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/native.c b/lib/ext2fs/native.c index 3fdc4a0f..2ea85499 100644 --- a/lib/ext2fs/native.c +++ b/lib/ext2fs/native.c @@ -10,7 +10,12 @@ */ #include + +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/newdir.c b/lib/ext2fs/newdir.c index ed29a6f5..8c0511ec 100644 --- a/lib/ext2fs/newdir.c +++ b/lib/ext2fs/newdir.c @@ -15,7 +15,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c index 7c0e2eb8..54aeedc2 100644 --- a/lib/ext2fs/openfs.c +++ b/lib/ext2fs/openfs.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/read_bb.c b/lib/ext2fs/read_bb.c index 4e9a5ddb..d8c6463a 100644 --- a/lib/ext2fs/read_bb.c +++ b/lib/ext2fs/read_bb.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" @@ -39,9 +43,9 @@ struct read_bb_record { #pragma argsused #endif static int mark_bad_block(ext2_filsys fs, blk_t *block_nr, - int blockcnt, void *private) + int blockcnt, void *priv_data) { - struct read_bb_record *rb = (struct read_bb_record *) private; + struct read_bb_record *rb = (struct read_bb_record *) priv_data; if (blockcnt < 0) return 0; diff --git a/lib/ext2fs/read_bb_file.c b/lib/ext2fs/read_bb_file.c index 6cdb1405..dc62257e 100644 --- a/lib/ext2fs/read_bb_file.c +++ b/lib/ext2fs/read_bb_file.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/rs_bitmap.c b/lib/ext2fs/rs_bitmap.c index 73df276e..193039a6 100644 --- a/lib/ext2fs/rs_bitmap.c +++ b/lib/ext2fs/rs_bitmap.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c index 93b775ce..168a9e7f 100644 --- a/lib/ext2fs/rw_bitmaps.c +++ b/lib/ext2fs/rw_bitmaps.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/swapfs.c b/lib/ext2fs/swapfs.c index 1a780f64..63c5c2b6 100644 --- a/lib/ext2fs/swapfs.c +++ b/lib/ext2fs/swapfs.c @@ -15,7 +15,11 @@ #endif #include +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/test_io.c b/lib/ext2fs/test_io.c index 1ac06634..d5556844 100644 --- a/lib/ext2fs/test_io.c +++ b/lib/ext2fs/test_io.c @@ -23,7 +23,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/tst_badblocks.c b/lib/ext2fs/tst_badblocks.c index 0324dd7b..49b0bbdc 100644 --- a/lib/ext2fs/tst_badblocks.c +++ b/lib/ext2fs/tst_badblocks.c @@ -22,7 +22,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/tst_getsize.c b/lib/ext2fs/tst_getsize.c index 49e8b6fd..35f526e8 100644 --- a/lib/ext2fs/tst_getsize.c +++ b/lib/ext2fs/tst_getsize.c @@ -22,7 +22,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/tst_iscan.c b/lib/ext2fs/tst_iscan.c index 9f5874b7..ed9fe365 100644 --- a/lib/ext2fs/tst_iscan.c +++ b/lib/ext2fs/tst_iscan.c @@ -22,7 +22,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index 2c1d3c90..4639d4fd 100644 --- a/lib/ext2fs/unix_io.c +++ b/lib/ext2fs/unix_io.c @@ -25,7 +25,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/unlink.c b/lib/ext2fs/unlink.c index bdaa7c18..fad9d631 100644 --- a/lib/ext2fs/unlink.c +++ b/lib/ext2fs/unlink.c @@ -15,7 +15,11 @@ #include #endif +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" @@ -34,9 +38,9 @@ static int unlink_proc(struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, - void *private) + void *priv_data) { - struct link_struct *ls = (struct link_struct *) private; + struct link_struct *ls = (struct link_struct *) priv_data; if (ls->name && (dirent->name_len != ls->namelen)) return 0; diff --git a/lib/ext2fs/valid_blk.c b/lib/ext2fs/valid_blk.c index 6d6734ee..09c6e078 100644 --- a/lib/ext2fs/valid_blk.c +++ b/lib/ext2fs/valid_blk.c @@ -17,7 +17,11 @@ #include #include +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif #include "ext2fs.h" diff --git a/lib/ext2fs/version.c b/lib/ext2fs/version.c index e3c49cd4..9ce46c30 100644 --- a/lib/ext2fs/version.c +++ b/lib/ext2fs/version.c @@ -17,7 +17,12 @@ #include #include +#if EXT2_FLAT_INCLUDES +#include "ext2_fs.h" +#else #include +#endif + #include "ext2fs.h" #include "../../version.h"