ext2.h revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
ext2.h -- ext2 header
Copyright (C) 1998-2000, 2007 Free Software Foundation, Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _EXT2_H
#define _EXT2_H
#include "tune.h"
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if ENABLE_NLS
# include <libintl.h>
#else
#endif /* ENABLE_NLS */
/* Ehrm.... sorry, pedanticists! :-) */
#ifndef offsetof
#endif
#ifdef __BEOS__
#endif
#if defined(__sun)
#else
#endif
#ifdef HAVE_LINUX_EXT2_FS_H
#define _LINUX_TYPES_H
#define i_version i_generation
#else
#include "ext2_fs.h"
#endif
extern unsigned char _bitmap[8];
struct ext2_buffer_cache
{
struct ext2_buffer_head *cache;
struct ext2_buffer_head *heads;
struct ext2_buffer_head **hash;
int size;
int numalloc;
unsigned char *buffermem;
};
struct ext2_buffer_head
{
struct ext2_buffer_head *next;
struct ext2_buffer_head *prev;
unsigned char *data;
int usecount;
int dirty;
struct ext2_buffer_cache *bc;
int alloc;
};
struct ext2_dev_ops
{
};
struct ext2_dev_handle
{
struct ext2_dev_ops *ops;
void *cookie;
};
struct ext2_fs
{
struct ext2_dev_handle *devhandle;
struct ext2_super_block sb;
struct ext2_group_desc *gd;
struct ext2_buffer_cache *bc;
int metadirty; /* 0:all sb&gd copies clean
1:all sb&gd copies dirty
2:only first sb&gd copy clean */
int dynamic_version;
int sparse; /* sparse superblocks */
int has_journal; /* journal */
int has_internal_journal;
int blocksize;
int logsize;
int numgroups;
int r_frac; /* reserved % of blocks */
unsigned char *relocator_pool;
unsigned char *relocator_pool_end;
int opt_debug;
int opt_safe;
int opt_verbose;
void *journal;
};
#define EXT2_ACTION_ADD 1
#define EXT2_ACTION_DELETE 2
#define EXT2_ACTION_FIND 3
#define EXT2_META_CLEAN 0
#define EXT2_META_PRIMARY_SB 1
#define EXT2_META_BACKUP_SB 2
#define EXT2_META_PRIMARY_GD 4
#define EXT2_META_BACKUP_GD 8
/* generic stuff */
/* block related */
/* block relocator */
/* buffer */
/* inode relocator */
/* journalling */
/* metadata mover */
/* fs creation */
struct ext2_fs *ext2_mkfs (struct ext2_dev_handle *handle, blk_t numblocks, int log_block_size, blk_t blocks_per_group, int inodes_per_group, int sparse_sb, int reserved_block_percentage, PedTimer* timer);
/* resize */
/* unix I/O */
{
int group;
return 0;
return 0;
return 0;
return 1;
}
#endif