+Sat Jan 17 13:13:31 1998 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * 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 <tytso@rsts-11.mit.edu>
+
+ * 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 <tytso@rsts-11.mit.edu>
+
+ * 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 <tytso@rsts-11.mit.edu>
* dblist.c (ext2fs_get_num_dirs): Make ext2fs_get_num_dirs more
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fsP.h"
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fsP.h"
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
};
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
#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;
#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;
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
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;
}
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <unistd.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
int bcount,
blk_t ref_blk,
int ref_offset,
- void *private);
+ void *priv_data);
int bcount;
int bsize;
int flags;
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,
!(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;
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;
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;
!(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;
}
!(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;
!(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;
}
!(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;
!(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;
}
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;
ctx.fs = fs;
ctx.func = func;
- ctx.private = private;
+ ctx.priv_data = priv_data;
ctx.flags = flags;
ctx.bcount = 0;
if (block_buf) {
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;
}
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;
}
int (*func)(ext2_filsys fs,
blk_t *blocknr,
int bcount,
- void *private);
+ void *priv_data);
void *real_private;
};
#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);
}
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,
#include <unistd.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <sys/time.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
+
#include "ext2fs/ext2fs.h"
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;
__u32 magic;
char *name;
blk_t current;
- void *private;
+ void *priv_data;
/*
* Add a block relocation entry.
#include <errno.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include "brel.h"
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));
{
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;
{
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)
{
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;
{
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)
{
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)
if (!brel)
return 0;
- ma = brel->private;
+ ma = brel->priv_data;
if (ma) {
if (ma->entries)
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <time.h>
#include <string.h>
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fsP.h"
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) {
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <string.h>
#include <time.h>
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fsP.h"
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);
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;
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;
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;
}
#include <string.h>
#include <time.h>
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#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,
int offset,
int blocksize,
char *buf,
- void *private),
- void *private)
+ void *priv_data),
+ void *priv_data)
{
errcode_t retval;
struct dir_context ctx;
}
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);
}
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);
}
#include <errno.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fsP.h"
int offset,
int blocksize,
char *buf,
- void *private),
- void *private)
+ void *priv_data),
+ void *priv_data)
{
struct dir_context ctx;
errcode_t retval;
}
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);
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;
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++;
}
#include <string.h>
#include <time.h>
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
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;
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);
#include <time.h>
#include <string.h>
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fsP.h"
#include <unistd.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
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;
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;
/*
* Reserved for the use of the calling application.
*/
- void * private;
+ void * priv_data;
/*
* Inode cache
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,
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,
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,
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,
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);
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);
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;
};
extern int ext2_process_dir_block(ext2_filsys fs,
blk_t *blocknr,
int blockcnt,
- void *private);
+ void *priv_data);
#include <unistd.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
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;
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;
#include <unistd.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fsP.h"
#include <unistd.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
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))
#include <sys/disklabel.h>
#endif /* HAVE_SYS_DISKLABEL_H */
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
+
#include "ext2fs.h"
static int valid_offset (int fd, ext2_loff_t offset)
#include <string.h>
#include <stdio.h>
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
+
#include "ext2fs.h"
/*
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;
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#define INCLUDE_INLINE_FUNCS
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fsP.h"
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;
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);
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))
__u32 magic;
char *name;
ino_t current;
- void *private;
+ void *priv_data;
/*
* Add an inode relocation entry.
#include <errno.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include "irel.h"
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);
errcode_t retval;
int size;
- ma = irel->private;
+ ma = irel->priv_data;
if (old > ma->max_inode)
return EXT2_ET_INVALID_ARGUMENT;
{
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)
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];
{
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;
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;
{
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)
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;
{
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)
{
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)
if (!irel)
return 0;
- ma = irel->private;
+ ma = irel->priv_data;
if (ma) {
if (ma->orig_map)
#include <sys/mount.h>
#endif /* HAVE_GETMNTINFO */
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
+
#include "ext2fs.h"
#ifdef HAVE_MNTENT_H
#include <unistd.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
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;
#include <unistd.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
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;
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
/* #define NAMEI_DEBUG */
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
*/
#include <stdio.h>
+
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <unistd.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#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;
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#endif
#include <time.h>
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <errno.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <errno.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <errno.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <sys/types.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <unistd.h>
#endif
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
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;
#include <string.h>
#include <time.h>
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
#include "ext2fs.h"
#include <stdio.h>
#include <ctype.h>
+#if EXT2_FLAT_INCLUDES
+#include "ext2_fs.h"
+#else
#include <linux/ext2_fs.h>
+#endif
+
#include "ext2fs.h"
#include "../../version.h"