1997-04-26 17:21:57 +04:00
|
|
|
/*
|
|
|
|
* ext2fs.h --- ext2fs
|
|
|
|
*
|
1997-04-29 20:17:09 +04:00
|
|
|
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
|
|
|
|
*
|
|
|
|
* %Begin-Header%
|
|
|
|
* This file may be redistributed under the terms of the GNU Public
|
|
|
|
* License.
|
|
|
|
* %End-Header%
|
1997-04-26 17:21:57 +04:00
|
|
|
*/
|
|
|
|
|
1998-02-17 01:00:37 +03:00
|
|
|
#ifndef _EXT2FS_EXT2FS_H
|
|
|
|
#define _EXT2FS_EXT2FS_H
|
|
|
|
|
2000-05-19 06:11:41 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1997-04-29 20:17:09 +04:00
|
|
|
/*
|
|
|
|
* Non-GNU C compilers won't necessarily understand inline
|
|
|
|
*/
|
1998-04-27 05:41:13 +04:00
|
|
|
#if (!defined(__GNUC__) && !defined(__WATCOMC__))
|
1997-04-29 20:17:09 +04:00
|
|
|
#define NO_INLINE_FUNCS
|
|
|
|
#endif
|
|
|
|
|
ChangeLog, Makefile.in, swapfs.c, unix.c:
Makefile.in: Add message.c and swapfs.c to the list of source files to
build the make depend.
swapfs.c, unix.c: Only support the -s and -S options to e2fsck if
ENABLE_SWAPFS is defined.
Many files:
ext2fs.h, bitops.h, block.c, bmap.c, closefs.c, dirblock.c, inode.c,
native.c, openfs.c, rw_bitmaps.c, swapfs.c: Only include the
byte-swapping logic if ENABLE_SWAPFS is turned on or if we're on a
big-endian machine.
initialize.c (ext2fs_initialize):Use WORDS_BIGENDIAN directly to set
EXT2_FLAG_SWAP_BYTES, instead of using ext2fs_native_flag.
native.c (ext2fs_native_flag): Use WORDS_BIGENDIAN provided by
autoconf to determine whether or not return EXT2_FLAG_SWAP_BYTES.
2001-06-11 11:00:04 +04:00
|
|
|
/*
|
|
|
|
* Build in support for byte-swapping filesystems if we the feature
|
|
|
|
* has been configured or if we're being built on a CPU architecture
|
|
|
|
* with a non-native byte order.
|
|
|
|
*/
|
|
|
|
#if defined(ENABLE_SWAPFS) || defined(WORDS_BIGENDIAN)
|
|
|
|
#define EXT2FS_ENABLE_SWAPFS
|
|
|
|
#endif
|
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/*
|
|
|
|
* Where the master copy of the superblock is located, and how big
|
|
|
|
* superblocks are supposed to be. We define SUPERBLOCK_SIZE because
|
|
|
|
* the size of the superblock structure is not necessarily trustworthy
|
|
|
|
* (some versions have the padding set up so that the superblock is
|
|
|
|
* 1032 bytes long).
|
|
|
|
*/
|
|
|
|
#define SUPERBLOCK_OFFSET 1024
|
|
|
|
#define SUPERBLOCK_SIZE 1024
|
|
|
|
|
1997-04-26 17:34:30 +04:00
|
|
|
/*
|
|
|
|
* The last ext2fs revision level that this version of the library is
|
|
|
|
* able to support.
|
|
|
|
*/
|
2001-01-01 19:17:12 +03:00
|
|
|
#define EXT2_LIB_CURRENT_REV EXT2_DYNAMIC_REV
|
1997-04-26 17:34:30 +04:00
|
|
|
|
1997-10-20 04:44:26 +04:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
1997-04-29 18:53:37 +04:00
|
|
|
#include <sys/types.h>
|
1997-10-20 04:44:26 +04:00
|
|
|
#endif
|
|
|
|
|
Many files:
dblist.c (ext2fs_get_num_dirs): Make ext2fs_get_num_dirs more paranoid
about validating the directory counts from the block group
information.
all files: Don't include stdlib.h anymore; include it in ext2_fs.h,
since that file requires stdlib.h
ChangeLog, Makefile.in, dirinfo.c:
dirinfo.c (e2fsck_add_dir_info): Use ext2fs_get_num_dirs instead of
e2fsck_get_num_dirs, which has been removed.
Makefile.in (PROGS): Remove @EXTRA_PROGS@, since we don't want to
compile and install flushb.
ChangeLog, configure.in:
Remove @EXTRA_PROGS@, since we aren't using it in 2fsck/Makefile.in anymore
ChangeLog, Makefile.in:
Install debugfs in /sbin, instead of /usr/sbin.
libext2fs.texinfo:
Update version string to be 1.12
Makefile.in:
Fix bug in find script which made the exclusion list, where a '-' was
missing from an -name option.
1997-12-01 21:24:10 +03:00
|
|
|
#include <stdlib.h>
|
1998-02-01 16:23:02 +03:00
|
|
|
|
|
|
|
#if EXT2_FLAT_INCLUDES
|
|
|
|
#include "e2_types.h"
|
|
|
|
#else
|
2001-06-02 03:49:46 +04:00
|
|
|
#include <ext2fs/ext2_types.h>
|
2000-04-03 17:45:40 +04:00
|
|
|
#endif /* EXT2_FLAT_INCLUDES */
|
1997-04-26 17:58:21 +04:00
|
|
|
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
typedef __u32 ext2_ino_t;
|
1997-04-26 17:58:21 +04:00
|
|
|
typedef __u32 blk_t;
|
1998-09-03 05:22:57 +04:00
|
|
|
typedef __u32 dgrp_t;
|
1997-10-26 02:37:42 +04:00
|
|
|
typedef __u32 ext2_off_t;
|
1998-06-11 00:39:43 +04:00
|
|
|
typedef __s64 e2_blkcnt_t;
|
1997-04-26 17:21:57 +04:00
|
|
|
|
Many files:
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++.
closefs.c (ext2fs_flush): Add a call to io_channel_flush() to
make sure the contents of the disk are flushed to disk.
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)
1998-01-19 17:47:53 +03:00
|
|
|
#if EXT2_FLAT_INCLUDES
|
|
|
|
#include "com_err.h"
|
|
|
|
#include "ext2_io.h"
|
|
|
|
#include "ext2_err.h"
|
|
|
|
#else
|
2001-05-21 06:54:21 +04:00
|
|
|
#include <et/com_err.h>
|
|
|
|
#include <ext2fs/ext2_io.h>
|
|
|
|
#include <ext2fs/ext2_err.h>
|
Many files:
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++.
closefs.c (ext2fs_flush): Add a call to io_channel_flush() to
make sure the contents of the disk are flushed to disk.
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)
1998-01-19 17:47:53 +03:00
|
|
|
#endif
|
1997-04-26 17:21:57 +04:00
|
|
|
|
1998-04-30 21:35:59 +04:00
|
|
|
/*
|
|
|
|
* Portability help for Microsoft Visual C++
|
|
|
|
*/
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#define EXT2_QSORT_TYPE int __cdecl
|
|
|
|
#else
|
|
|
|
#define EXT2_QSORT_TYPE int
|
|
|
|
#endif
|
|
|
|
|
1997-04-26 17:34:30 +04:00
|
|
|
typedef struct struct_ext2_filsys *ext2_filsys;
|
|
|
|
|
1997-04-29 18:53:37 +04:00
|
|
|
struct ext2fs_struct_generic_bitmap {
|
1997-08-11 03:07:40 +04:00
|
|
|
errcode_t magic;
|
1997-04-29 18:53:37 +04:00
|
|
|
ext2_filsys fs;
|
|
|
|
__u32 start, end;
|
|
|
|
__u32 real_end;
|
|
|
|
char * description;
|
|
|
|
char * bitmap;
|
|
|
|
errcode_t base_error_code;
|
|
|
|
__u32 reserved[7];
|
1997-04-26 17:34:30 +04:00
|
|
|
};
|
|
|
|
|
1997-04-29 18:53:37 +04:00
|
|
|
#define EXT2FS_MARK_ERROR 0
|
|
|
|
#define EXT2FS_UNMARK_ERROR 1
|
|
|
|
#define EXT2FS_TEST_ERROR 2
|
1997-04-26 17:34:30 +04:00
|
|
|
|
1997-04-29 18:53:37 +04:00
|
|
|
typedef struct ext2fs_struct_generic_bitmap *ext2fs_generic_bitmap;
|
|
|
|
typedef struct ext2fs_struct_generic_bitmap *ext2fs_inode_bitmap;
|
|
|
|
typedef struct ext2fs_struct_generic_bitmap *ext2fs_block_bitmap;
|
1997-04-26 17:34:30 +04:00
|
|
|
|
1997-04-26 18:48:50 +04:00
|
|
|
#ifdef EXT2_DYNAMIC_REV
|
|
|
|
#define EXT2_FIRST_INODE(s) EXT2_FIRST_INO(s)
|
|
|
|
#else
|
|
|
|
#define EXT2_FIRST_INODE(s) EXT2_FIRST_INO
|
|
|
|
#define EXT2_INODE_SIZE(s) sizeof(struct ext2_inode)
|
|
|
|
#endif
|
|
|
|
|
1997-04-29 20:17:09 +04:00
|
|
|
/*
|
|
|
|
* badblocks list definitions
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct ext2_struct_badblocks_list *ext2_badblocks_list;
|
|
|
|
typedef struct ext2_struct_badblocks_iterate *ext2_badblocks_iterate;
|
|
|
|
|
|
|
|
/* old */
|
|
|
|
typedef struct ext2_struct_badblocks_list *badblocks_list;
|
|
|
|
typedef struct ext2_struct_badblocks_iterate *badblocks_iterate;
|
|
|
|
|
|
|
|
#define BADBLOCKS_FLAG_DIRTY 1
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ext2_dblist structure and abstractions (see dblist.c)
|
|
|
|
*/
|
|
|
|
struct ext2_db_entry {
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
ext2_ino_t ino;
|
1997-04-29 20:17:09 +04:00
|
|
|
blk_t blk;
|
|
|
|
int blockcnt;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct ext2_struct_dblist *ext2_dblist;
|
|
|
|
|
|
|
|
#define DBLIST_ABORT 1
|
|
|
|
|
1997-10-26 02:37:42 +04:00
|
|
|
/*
|
|
|
|
* ext2_fileio definitions
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define EXT2_FILE_WRITE 0x0001
|
|
|
|
#define EXT2_FILE_CREATE 0x0002
|
|
|
|
|
|
|
|
#define EXT2_FILE_MASK 0x00FF
|
|
|
|
|
|
|
|
#define EXT2_FILE_BUF_DIRTY 0x4000
|
|
|
|
#define EXT2_FILE_BUF_VALID 0x2000
|
|
|
|
|
|
|
|
typedef struct ext2_file *ext2_file_t;
|
|
|
|
|
|
|
|
#define EXT2_SEEK_SET 0
|
|
|
|
#define EXT2_SEEK_CUR 1
|
|
|
|
#define EXT2_SEEK_END 2
|
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/*
|
ChangeLog, ext2_err.et.in, ext2fs.h, initialize.c, mkjournal.c, openfs.c:
initialize.c (ext2fs_initialize): Add support for initializing the
ext2 superblock for external journal devices. This basically means we
don't bother to allocate any block group descriptors.
openfs.c (ext2fs_open): Only open external journal devices if the new
flag EXT2_FLAG_JOURNAL_DEV_OK is passed to ext2fs_open. When opening
such devices, don't try to read the block group descriptors, since
they're not there.
ext2_err.et.in (EXT2_NO_JOURNAL_SB): Add new error code
mkjournal.c: Export a new function,
ext2fs_create_journal_superblock(), which allocates and returns a
buffer containing a journal superblock. This is needed by mke2fs to
create an external journal. Rewrote ext2fs_add_journal_device() so
that it no longer creates the external journal, but rather adds a
filesystem to an existing external journal. It handles all of the
UUID manipulation.
ext2fs.h: List the EXT3_FEATURE_JOURNAL_DEV as a flag supported by the
library. Define the EXT2_FLAG_JOURNAL_DEV_OK. Changed function
prototype for ext2fs_add_journal_device().
2001-01-16 09:56:14 +03:00
|
|
|
* Flags for the ext2_filsys structure and for ext2fs_open()
|
1997-04-26 17:21:57 +04:00
|
|
|
*/
|
1997-04-29 20:17:09 +04:00
|
|
|
#define EXT2_FLAG_RW 0x01
|
|
|
|
#define EXT2_FLAG_CHANGED 0x02
|
|
|
|
#define EXT2_FLAG_DIRTY 0x04
|
|
|
|
#define EXT2_FLAG_VALID 0x08
|
|
|
|
#define EXT2_FLAG_IB_DIRTY 0x10
|
|
|
|
#define EXT2_FLAG_BB_DIRTY 0x20
|
1997-04-29 19:29:49 +04:00
|
|
|
#define EXT2_FLAG_SWAP_BYTES 0x40
|
|
|
|
#define EXT2_FLAG_SWAP_BYTES_READ 0x80
|
|
|
|
#define EXT2_FLAG_SWAP_BYTES_WRITE 0x100
|
|
|
|
#define EXT2_FLAG_MASTER_SB_ONLY 0x200
|
1997-04-29 20:17:09 +04:00
|
|
|
#define EXT2_FLAG_FORCE 0x400
|
2001-01-03 17:56:46 +03:00
|
|
|
#define EXT2_FLAG_SUPER_ONLY 0x800
|
ChangeLog, ext2_err.et.in, ext2fs.h, initialize.c, mkjournal.c, openfs.c:
initialize.c (ext2fs_initialize): Add support for initializing the
ext2 superblock for external journal devices. This basically means we
don't bother to allocate any block group descriptors.
openfs.c (ext2fs_open): Only open external journal devices if the new
flag EXT2_FLAG_JOURNAL_DEV_OK is passed to ext2fs_open. When opening
such devices, don't try to read the block group descriptors, since
they're not there.
ext2_err.et.in (EXT2_NO_JOURNAL_SB): Add new error code
mkjournal.c: Export a new function,
ext2fs_create_journal_superblock(), which allocates and returns a
buffer containing a journal superblock. This is needed by mke2fs to
create an external journal. Rewrote ext2fs_add_journal_device() so
that it no longer creates the external journal, but rather adds a
filesystem to an existing external journal. It handles all of the
UUID manipulation.
ext2fs.h: List the EXT3_FEATURE_JOURNAL_DEV as a flag supported by the
library. Define the EXT2_FLAG_JOURNAL_DEV_OK. Changed function
prototype for ext2fs_add_journal_device().
2001-01-16 09:56:14 +03:00
|
|
|
#define EXT2_FLAG_JOURNAL_DEV_OK 0x1000
|
2001-05-03 08:02:29 +04:00
|
|
|
#define EXT2_FLAG_IMAGE_FILE 0x2000
|
1997-04-26 17:21:57 +04:00
|
|
|
|
1997-04-26 18:48:50 +04:00
|
|
|
/*
|
|
|
|
* Special flag in the ext2 inode i_flag field that means that this is
|
|
|
|
* a new inode. (So that ext2_write_inode() can clear extra fields.)
|
|
|
|
*/
|
|
|
|
#define EXT2_NEW_INODE_FL 0x80000000
|
|
|
|
|
2000-12-09 17:39:16 +03:00
|
|
|
/*
|
|
|
|
* Flags for mkjournal
|
|
|
|
*
|
|
|
|
* EXT2_MKJOURNAL_V1_SUPER Make a (deprecated) V1 journal superblock
|
|
|
|
*/
|
|
|
|
#define EXT2_MKJOURNAL_V1_SUPER 0x0000001
|
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
struct struct_ext2_filsys {
|
1997-08-11 03:07:40 +04:00
|
|
|
errcode_t magic;
|
1997-04-26 17:21:57 +04:00
|
|
|
io_channel io;
|
|
|
|
int flags;
|
|
|
|
char * device_name;
|
|
|
|
struct ext2_super_block * super;
|
|
|
|
int blocksize;
|
|
|
|
int fragsize;
|
1998-09-03 05:22:57 +04:00
|
|
|
dgrp_t group_desc_count;
|
1997-04-26 17:21:57 +04:00
|
|
|
unsigned long desc_blocks;
|
|
|
|
struct ext2_group_desc * group_desc;
|
|
|
|
int inode_blocks_per_group;
|
1997-04-26 17:34:30 +04:00
|
|
|
ext2fs_inode_bitmap inode_map;
|
|
|
|
ext2fs_block_bitmap block_map;
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
errcode_t (*get_blocks)(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks);
|
|
|
|
errcode_t (*check_directory)(ext2_filsys fs, ext2_ino_t ino);
|
1997-04-26 17:21:57 +04:00
|
|
|
errcode_t (*write_bitmaps)(ext2_filsys fs);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
errcode_t (*read_inode)(ext2_filsys fs, ext2_ino_t ino,
|
1997-04-29 18:53:37 +04:00
|
|
|
struct ext2_inode *inode);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
errcode_t (*write_inode)(ext2_filsys fs, ext2_ino_t ino,
|
1997-04-29 18:53:37 +04:00
|
|
|
struct ext2_inode *inode);
|
1997-04-29 20:17:09 +04:00
|
|
|
badblocks_list badblocks;
|
|
|
|
ext2_dblist dblist;
|
1997-04-30 01:26:48 +04:00
|
|
|
__u32 stride; /* for mke2fs */
|
2000-10-27 00:24:43 +04:00
|
|
|
struct ext2_super_block * orig_super;
|
2001-05-03 08:02:29 +04:00
|
|
|
struct ext2_image_hdr * image_header;
|
2001-12-24 17:40:00 +03:00
|
|
|
__u32 umask;
|
1997-04-29 20:17:09 +04:00
|
|
|
/*
|
|
|
|
* Reserved for future expansion
|
|
|
|
*/
|
2001-12-24 17:40:00 +03:00
|
|
|
__u32 reserved[8];
|
1997-04-26 17:21:57 +04:00
|
|
|
|
|
|
|
/*
|
1997-04-30 01:26:48 +04:00
|
|
|
* Reserved for the use of the calling application.
|
1997-04-26 17:21:57 +04:00
|
|
|
*/
|
Many files:
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++.
closefs.c (ext2fs_flush): Add a call to io_channel_flush() to
make sure the contents of the disk are flushed to disk.
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)
1998-01-19 17:47:53 +03:00
|
|
|
void * priv_data;
|
1997-04-30 01:26:48 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Inode cache
|
|
|
|
*/
|
|
|
|
struct ext2_inode_cache *icache;
|
1997-04-26 17:21:57 +04:00
|
|
|
};
|
|
|
|
|
1998-02-01 16:23:02 +03:00
|
|
|
#if EXT2_FLAT_INCLUDES
|
|
|
|
#include "e2_bitops.h"
|
|
|
|
#else
|
2001-05-21 06:54:21 +04:00
|
|
|
#include <ext2fs/bitops.h>
|
1998-02-01 16:23:02 +03:00
|
|
|
#endif
|
1997-10-20 04:44:26 +04:00
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/*
|
|
|
|
* Return flags for the block iterator functions
|
|
|
|
*/
|
|
|
|
#define BLOCK_CHANGED 1
|
|
|
|
#define BLOCK_ABORT 2
|
|
|
|
#define BLOCK_ERROR 4
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Block interate flags
|
1997-04-26 17:58:21 +04:00
|
|
|
*
|
|
|
|
* BLOCK_FLAG_APPEND, or BLOCK_FLAG_HOLE, indicates that the interator
|
|
|
|
* function should be called on blocks where the block number is zero.
|
|
|
|
* This is used by ext2fs_expand_dir() to be able to add a new block
|
|
|
|
* to an inode. It can also be used for programs that want to be able
|
|
|
|
* to deal with files that contain "holes".
|
|
|
|
*
|
|
|
|
* BLOCK_FLAG_TRAVERSE indicates that the iterator function for the
|
|
|
|
* indirect, doubly indirect, etc. blocks should be called after all
|
|
|
|
* of the blocks containined in the indirect blocks are processed.
|
|
|
|
* This is useful if you are going to be deallocating blocks from an
|
|
|
|
* inode.
|
1997-04-29 18:53:37 +04:00
|
|
|
*
|
|
|
|
* BLOCK_FLAG_DATA_ONLY indicates that the iterator function should be
|
|
|
|
* called for data blocks only.
|
Many files:
ext2fs.h: Add new superblock fields (s_algorithm_usage_bitmap,
s_prealloc_blocks, s_prealloc_dir_blocks). Added conditional defines
of new features COMPAT_DIR_PREALLOC, RO_COMPAT_LARGE_FILE
RO_COMPAT_BTREE_DIR, INCOMPAT_COMPRESSION, INCOMPAT_DIRNAME_SIZE.
Changed the library to declare that we support COMPAT_DIR_PREALLOC,
INCOMPAT_DIRNAME_SIZE, RO_COMPAT_LARGE_FILE.
fileio.c: Rename function ext2fs_file_llseek to be ext2fs_file_lseek,
which is more accurate.
block.c: Add new function ext2fs_block_iterate3 which calls the
iterator function with the blockcount argument of type blkcnt_t. This
version of the function is allowed to handle large files; the other
fucntions are not.
ext2fs.h: Add new type blkcnt_t
ext2_err.et.in: Add error code EXT2_ET_FILE_TOO_BIG
block.c (ext2fs_block_iterate2): Fix bug where the block count field
wasn't getting correctly incremented for sparse files when the
indirect or doubly-indirect block specified in the inode was zero.
unlink.c (unlink_proc):
lookup.c (lookup_proc):
link.c (link_proc):
get_pathname.c (get_pathname_proc):
dir_iterate.c (ext2fs_process_dir_block): Mask off high 8 bits from
dirent->name_len, so it can be used for other purposes.
ext2fs.h: Add definition of EXT2_FEATURE_INCOMPAT_DIRNAME_SIZE, and
indicate that we have support for this incompatible option.
1998-03-23 05:06:52 +03:00
|
|
|
*
|
|
|
|
* BLOCK_FLAG_NO_LARGE is for internal use only. It informs
|
Many files:
block.c (ext2fs_block_iterate3): Make the ref_offset field contain the
offset into the inode.i_blocks array when ref_block is zero. Since we
haven't done a formal release of e2fsprogs since block_iterate2 was
first introduced, I removed block_iterate2, and renamed block_iterate3
to be block_iterate2.
bb_inode.c, bmove.c, dblist_dir.c, dir_iterate.c, expanddir.c,
ext2fs.h, ext2fsP.h, read_bb.c: Change use of block_iterate and
block_iterate2 to block_iterate2 with the new prototype for the
interator function. (using blkcnt_t forr blockcount)
ChangeLog, debugfs.c, ls.c, lsdel.c:
debugfs.c, ls.c, lsdel.c: Add support for large files. (The high 32
bits share space with the i_dir_acl field.)
1998-03-24 19:17:51 +03:00
|
|
|
* ext2fs_block_iterate2 that large files won't be accepted.
|
1997-04-26 17:21:57 +04:00
|
|
|
*/
|
|
|
|
#define BLOCK_FLAG_APPEND 1
|
1997-04-26 17:58:21 +04:00
|
|
|
#define BLOCK_FLAG_HOLE 1
|
1997-04-26 17:21:57 +04:00
|
|
|
#define BLOCK_FLAG_DEPTH_TRAVERSE 2
|
1997-04-29 18:53:37 +04:00
|
|
|
#define BLOCK_FLAG_DATA_ONLY 4
|
|
|
|
|
Many files:
ext2fs.h: Add new superblock fields (s_algorithm_usage_bitmap,
s_prealloc_blocks, s_prealloc_dir_blocks). Added conditional defines
of new features COMPAT_DIR_PREALLOC, RO_COMPAT_LARGE_FILE
RO_COMPAT_BTREE_DIR, INCOMPAT_COMPRESSION, INCOMPAT_DIRNAME_SIZE.
Changed the library to declare that we support COMPAT_DIR_PREALLOC,
INCOMPAT_DIRNAME_SIZE, RO_COMPAT_LARGE_FILE.
fileio.c: Rename function ext2fs_file_llseek to be ext2fs_file_lseek,
which is more accurate.
block.c: Add new function ext2fs_block_iterate3 which calls the
iterator function with the blockcount argument of type blkcnt_t. This
version of the function is allowed to handle large files; the other
fucntions are not.
ext2fs.h: Add new type blkcnt_t
ext2_err.et.in: Add error code EXT2_ET_FILE_TOO_BIG
block.c (ext2fs_block_iterate2): Fix bug where the block count field
wasn't getting correctly incremented for sparse files when the
indirect or doubly-indirect block specified in the inode was zero.
unlink.c (unlink_proc):
lookup.c (lookup_proc):
link.c (link_proc):
get_pathname.c (get_pathname_proc):
dir_iterate.c (ext2fs_process_dir_block): Mask off high 8 bits from
dirent->name_len, so it can be used for other purposes.
ext2fs.h: Add definition of EXT2_FEATURE_INCOMPAT_DIRNAME_SIZE, and
indicate that we have support for this incompatible option.
1998-03-23 05:06:52 +03:00
|
|
|
#define BLOCK_FLAG_NO_LARGE 0x1000
|
|
|
|
|
1997-04-29 18:53:37 +04:00
|
|
|
/*
|
|
|
|
* Magic "block count" return values for the block iterator function.
|
|
|
|
*/
|
|
|
|
#define BLOCK_COUNT_IND (-1)
|
|
|
|
#define BLOCK_COUNT_DIND (-2)
|
|
|
|
#define BLOCK_COUNT_TIND (-3)
|
|
|
|
#define BLOCK_COUNT_TRANSLATOR (-4)
|
1997-04-26 17:21:57 +04:00
|
|
|
|
ChangeLog, Makefile.in, bmap.c, bmove.c, ext2fs.h, jump.funcs:
ext2fs.h: If __STRICT_ANSI__ is defined and we're on a platform with
32 bit longs, then we need to manually define __s64 and __u64, since
the current kernel header files don't define these if __STRICT_ANSI__
is defined. This is a problem if we are compiling with full GCC
warnings, since we do need 64 bit support.
Makefile.in (OBJS): Remove bmove.o from files to be built, since we're
not using ext2fs_move_blocks() and there is some question as to its
usefulness in its current form.
bmap.c (block_bmap): Remove unused function.
bmove.c (process_block): Fix -Wall warning.
ChangeLog, debugfs.c, debugfs.h, dump.c:
debugfs.h: Add declaration for do_dirty_filsys() to prevent -Wall
warnings.
debugfs.c (copy_file):
dump.c (dump_file): Fix -Wall warning caused by signed/unsigned mismatch.
1998-03-30 05:27:25 +04:00
|
|
|
#if 0
|
1997-06-09 18:51:29 +04:00
|
|
|
/*
|
|
|
|
* Flags for ext2fs_move_blocks
|
|
|
|
*/
|
|
|
|
#define EXT2_BMOVE_GET_DBLIST 0x0001
|
1997-06-14 11:25:40 +04:00
|
|
|
#define EXT2_BMOVE_DEBUG 0x0002
|
ChangeLog, Makefile.in, bmap.c, bmove.c, ext2fs.h, jump.funcs:
ext2fs.h: If __STRICT_ANSI__ is defined and we're on a platform with
32 bit longs, then we need to manually define __s64 and __u64, since
the current kernel header files don't define these if __STRICT_ANSI__
is defined. This is a problem if we are compiling with full GCC
warnings, since we do need 64 bit support.
Makefile.in (OBJS): Remove bmove.o from files to be built, since we're
not using ext2fs_move_blocks() and there is some question as to its
usefulness in its current form.
bmap.c (block_bmap): Remove unused function.
bmove.c (process_block): Fix -Wall warning.
ChangeLog, debugfs.c, debugfs.h, dump.c:
debugfs.h: Add declaration for do_dirty_filsys() to prevent -Wall
warnings.
debugfs.c (copy_file):
dump.c (dump_file): Fix -Wall warning caused by signed/unsigned mismatch.
1998-03-30 05:27:25 +04:00
|
|
|
#endif
|
1997-06-09 18:51:29 +04:00
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/*
|
|
|
|
* Return flags for the directory iterator functions
|
|
|
|
*/
|
|
|
|
#define DIRENT_CHANGED 1
|
|
|
|
#define DIRENT_ABORT 2
|
|
|
|
#define DIRENT_ERROR 3
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Directory iterator flags
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define DIRENT_FLAG_INCLUDE_EMPTY 1
|
dir_iterate.c (ext2fs_dir_iterate2, ext2fs_process_dir_block):
Add support for a new flag, DIRENT_FLAG_INCLUDE_REMOVED,
which will return deleted directory entries.
ext2fs_dir_iterate2 takes a new callback function which
is identical with the one used by
ext2fs_dblist_dir_iterate(). If the directory entry is
deleted, the callback function will be called with the
entry paraemter set to DIRENT_DELETED_FILE.
Makefile.in, alloc_stats.c (ext2fs_inode_alloc_stats,
ext2fs_block_alloc_stats): New functions which update
block/inode allocation statistics in the bitmaps, block
group descriptors, and superblock.
mkjournal.c (mkjournal_proc), mkdir.c (ext2fs_mkdir),
expanddir.c (expand_dir_proc), bb_inode.c
(clear_bad_block_proc, set_bad_block_proc,
ext2fs_update_bb_inode), alloc.c (ext2fs_alloc_block):
Update to use new block/inode allocation statistics.
2002-01-03 11:29:19 +03:00
|
|
|
#define DIRENT_FLAG_INCLUDE_REMOVED 2
|
1997-04-29 20:17:09 +04:00
|
|
|
|
|
|
|
#define DIRENT_DOT_FILE 1
|
|
|
|
#define DIRENT_DOT_DOT_FILE 2
|
|
|
|
#define DIRENT_OTHER_FILE 3
|
dir_iterate.c (ext2fs_dir_iterate2, ext2fs_process_dir_block):
Add support for a new flag, DIRENT_FLAG_INCLUDE_REMOVED,
which will return deleted directory entries.
ext2fs_dir_iterate2 takes a new callback function which
is identical with the one used by
ext2fs_dblist_dir_iterate(). If the directory entry is
deleted, the callback function will be called with the
entry paraemter set to DIRENT_DELETED_FILE.
Makefile.in, alloc_stats.c (ext2fs_inode_alloc_stats,
ext2fs_block_alloc_stats): New functions which update
block/inode allocation statistics in the bitmaps, block
group descriptors, and superblock.
mkjournal.c (mkjournal_proc), mkdir.c (ext2fs_mkdir),
expanddir.c (expand_dir_proc), bb_inode.c
(clear_bad_block_proc, set_bad_block_proc,
ext2fs_update_bb_inode), alloc.c (ext2fs_alloc_block):
Update to use new block/inode allocation statistics.
2002-01-03 11:29:19 +03:00
|
|
|
#define DIRENT_DELETED_FILE 4
|
1997-04-29 20:17:09 +04:00
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/*
|
|
|
|
* Inode scan definitions
|
|
|
|
*/
|
1997-04-26 17:34:30 +04:00
|
|
|
typedef struct ext2_struct_inode_scan *ext2_inode_scan;
|
|
|
|
|
1997-04-29 20:17:09 +04:00
|
|
|
/*
|
|
|
|
* ext2fs_scan flags
|
|
|
|
*/
|
|
|
|
#define EXT2_SF_CHK_BADBLOCKS 0x0001
|
|
|
|
#define EXT2_SF_BAD_INODE_BLK 0x0002
|
|
|
|
#define EXT2_SF_BAD_EXTRA_BYTES 0x0004
|
|
|
|
#define EXT2_SF_SKIP_MISSING_ITABLE 0x0008
|
1997-04-26 17:21:57 +04:00
|
|
|
|
1997-04-26 17:58:21 +04:00
|
|
|
/*
|
|
|
|
* ext2fs_check_if_mounted flags
|
|
|
|
*/
|
|
|
|
#define EXT2_MF_MOUNTED 1
|
|
|
|
#define EXT2_MF_ISROOT 2
|
1997-04-29 20:17:09 +04:00
|
|
|
#define EXT2_MF_READONLY 4
|
2001-12-24 23:20:22 +03:00
|
|
|
#define EXT2_MF_SWAP 8
|
1997-04-26 17:58:21 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Ext2/linux mode flags. We define them here so that we don't need
|
|
|
|
* to depend on the OS's sys/stat.h, since we may be compiling on a
|
|
|
|
* non-Linux system.
|
|
|
|
*/
|
|
|
|
#define LINUX_S_IFMT 00170000
|
|
|
|
#define LINUX_S_IFSOCK 0140000
|
|
|
|
#define LINUX_S_IFLNK 0120000
|
|
|
|
#define LINUX_S_IFREG 0100000
|
|
|
|
#define LINUX_S_IFBLK 0060000
|
|
|
|
#define LINUX_S_IFDIR 0040000
|
|
|
|
#define LINUX_S_IFCHR 0020000
|
|
|
|
#define LINUX_S_IFIFO 0010000
|
|
|
|
#define LINUX_S_ISUID 0004000
|
|
|
|
#define LINUX_S_ISGID 0002000
|
|
|
|
#define LINUX_S_ISVTX 0001000
|
|
|
|
|
1997-04-29 18:53:37 +04:00
|
|
|
#define LINUX_S_IRWXU 00700
|
|
|
|
#define LINUX_S_IRUSR 00400
|
|
|
|
#define LINUX_S_IWUSR 00200
|
|
|
|
#define LINUX_S_IXUSR 00100
|
|
|
|
|
|
|
|
#define LINUX_S_IRWXG 00070
|
|
|
|
#define LINUX_S_IRGRP 00040
|
|
|
|
#define LINUX_S_IWGRP 00020
|
|
|
|
#define LINUX_S_IXGRP 00010
|
|
|
|
|
|
|
|
#define LINUX_S_IRWXO 00007
|
|
|
|
#define LINUX_S_IROTH 00004
|
|
|
|
#define LINUX_S_IWOTH 00002
|
|
|
|
#define LINUX_S_IXOTH 00001
|
|
|
|
|
1997-04-26 17:58:21 +04:00
|
|
|
#define LINUX_S_ISLNK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFLNK)
|
|
|
|
#define LINUX_S_ISREG(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFREG)
|
|
|
|
#define LINUX_S_ISDIR(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFDIR)
|
|
|
|
#define LINUX_S_ISCHR(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFCHR)
|
|
|
|
#define LINUX_S_ISBLK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFBLK)
|
|
|
|
#define LINUX_S_ISFIFO(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFIFO)
|
|
|
|
#define LINUX_S_ISSOCK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFSOCK)
|
|
|
|
|
1997-04-29 20:17:09 +04:00
|
|
|
/*
|
|
|
|
* ext2_icount_t abstraction
|
|
|
|
*/
|
|
|
|
#define EXT2_ICOUNT_OPT_INCREMENT 0x01
|
|
|
|
|
|
|
|
typedef struct ext2_icount *ext2_icount_t;
|
|
|
|
|
1997-10-26 02:37:42 +04:00
|
|
|
/*
|
|
|
|
* Flags for ext2fs_bmap
|
|
|
|
*/
|
|
|
|
#define BMAP_ALLOC 1
|
|
|
|
|
ChangeLog, Makefile.in, e2image.h, ext2_err.et.in, ext2fs.h, imager.c:
imager.c (ext2fs_image_{inode,super,bitmap}_{read,write}, ext2_fs.h,
Makefile.in: New file that has routines that save ext2fs metadata to a
file.
ext2_err.et.in (EXT2_ET_MAGIC_E2IMAGE): New error code assigned.
e2image.h: New file which defines the file format for the ext2 image
file. (Saved copy of ext2 metadata to a file as a saving throw
against worst-case damage.)
ChangeLog, Makefile.in, e2image.c:
e2image.c, Makefile.in: New program which saves ext2 metadata to a
file for people who need a last-ditch saving throw.
2000-11-12 22:32:20 +03:00
|
|
|
/*
|
|
|
|
* Flags for imager.c functions
|
|
|
|
*/
|
|
|
|
#define IMAGER_FLAG_INODEMAP 1
|
|
|
|
#define IMAGER_FLAG_SPARSEWRITE 2
|
|
|
|
|
1997-04-26 17:34:30 +04:00
|
|
|
/*
|
|
|
|
* For checking structure magic numbers...
|
|
|
|
*/
|
1997-04-26 17:21:57 +04:00
|
|
|
|
1997-04-26 17:34:30 +04:00
|
|
|
#define EXT2_CHECK_MAGIC(struct, code) \
|
|
|
|
if ((struct)->magic != (code)) return (code)
|
1997-04-29 18:53:37 +04:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
2001-01-01 19:17:12 +03:00
|
|
|
* For ext2 compression support
|
1997-04-29 18:53:37 +04:00
|
|
|
*/
|
2000-02-11 18:44:08 +03:00
|
|
|
#define EXT2FS_COMPRESSED_BLKADDR ((blk_t) 0xffffffff)
|
|
|
|
#define HOLE_BLKADDR(_b) ((_b) == 0 || (_b) == EXT2FS_COMPRESSED_BLKADDR)
|
|
|
|
|
1997-04-29 21:48:10 +04:00
|
|
|
/*
|
2001-01-13 04:29:05 +03:00
|
|
|
* Features supported by this version of the library
|
1997-04-29 21:48:10 +04:00
|
|
|
*/
|
1999-09-15 00:21:26 +04:00
|
|
|
#define EXT2_LIB_FEATURE_COMPAT_SUPP (EXT2_FEATURE_COMPAT_DIR_PREALLOC|\
|
|
|
|
EXT2_FEATURE_COMPAT_IMAGIC_INODES|\
|
2001-07-02 19:54:09 +04:00
|
|
|
EXT3_FEATURE_COMPAT_HAS_JOURNAL|\
|
|
|
|
EXT2_FEATURE_COMPAT_EXT_ATTR)
|
2000-12-31 16:39:17 +03:00
|
|
|
|
2000-02-11 18:44:08 +03:00
|
|
|
/* This #ifdef is temporary until compression is fully supported */
|
|
|
|
#ifdef ENABLE_COMPRESSION
|
2000-04-03 17:45:40 +04:00
|
|
|
#ifndef I_KNOW_THAT_COMPRESSION_IS_EXPERIMENTAL
|
|
|
|
/* If the below warning bugs you, then have
|
|
|
|
`CPPFLAGS=-DI_KNOW_THAT_COMPRESSION_IS_EXPERIMENTAL' in your
|
|
|
|
environment at configure time. */
|
2001-01-06 01:23:22 +03:00
|
|
|
#warning "Compression support is experimental"
|
2000-04-03 17:45:40 +04:00
|
|
|
#endif
|
2000-02-11 18:44:08 +03:00
|
|
|
#define EXT2_LIB_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE|\
|
2000-07-07 08:37:35 +04:00
|
|
|
EXT2_FEATURE_INCOMPAT_COMPRESSION|\
|
ChangeLog, ext2_err.et.in, ext2fs.h, initialize.c, mkjournal.c, openfs.c:
initialize.c (ext2fs_initialize): Add support for initializing the
ext2 superblock for external journal devices. This basically means we
don't bother to allocate any block group descriptors.
openfs.c (ext2fs_open): Only open external journal devices if the new
flag EXT2_FLAG_JOURNAL_DEV_OK is passed to ext2fs_open. When opening
such devices, don't try to read the block group descriptors, since
they're not there.
ext2_err.et.in (EXT2_NO_JOURNAL_SB): Add new error code
mkjournal.c: Export a new function,
ext2fs_create_journal_superblock(), which allocates and returns a
buffer containing a journal superblock. This is needed by mke2fs to
create an external journal. Rewrote ext2fs_add_journal_device() so
that it no longer creates the external journal, but rather adds a
filesystem to an existing external journal. It handles all of the
UUID manipulation.
ext2fs.h: List the EXT3_FEATURE_JOURNAL_DEV as a flag supported by the
library. Define the EXT2_FLAG_JOURNAL_DEV_OK. Changed function
prototype for ext2fs_add_journal_device().
2001-01-16 09:56:14 +03:00
|
|
|
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|\
|
2000-07-07 08:37:35 +04:00
|
|
|
EXT3_FEATURE_INCOMPAT_RECOVER)
|
2000-02-11 18:44:08 +03:00
|
|
|
#else
|
2000-07-07 08:37:35 +04:00
|
|
|
#define EXT2_LIB_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE|\
|
ChangeLog, ext2_err.et.in, ext2fs.h, initialize.c, mkjournal.c, openfs.c:
initialize.c (ext2fs_initialize): Add support for initializing the
ext2 superblock for external journal devices. This basically means we
don't bother to allocate any block group descriptors.
openfs.c (ext2fs_open): Only open external journal devices if the new
flag EXT2_FLAG_JOURNAL_DEV_OK is passed to ext2fs_open. When opening
such devices, don't try to read the block group descriptors, since
they're not there.
ext2_err.et.in (EXT2_NO_JOURNAL_SB): Add new error code
mkjournal.c: Export a new function,
ext2fs_create_journal_superblock(), which allocates and returns a
buffer containing a journal superblock. This is needed by mke2fs to
create an external journal. Rewrote ext2fs_add_journal_device() so
that it no longer creates the external journal, but rather adds a
filesystem to an existing external journal. It handles all of the
UUID manipulation.
ext2fs.h: List the EXT3_FEATURE_JOURNAL_DEV as a flag supported by the
library. Define the EXT2_FLAG_JOURNAL_DEV_OK. Changed function
prototype for ext2fs_add_journal_device().
2001-01-16 09:56:14 +03:00
|
|
|
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|\
|
2000-07-07 08:37:35 +04:00
|
|
|
EXT3_FEATURE_INCOMPAT_RECOVER)
|
2000-02-11 18:44:08 +03:00
|
|
|
#endif
|
Many files:
ext2fs.h: Add new superblock fields (s_algorithm_usage_bitmap,
s_prealloc_blocks, s_prealloc_dir_blocks). Added conditional defines
of new features COMPAT_DIR_PREALLOC, RO_COMPAT_LARGE_FILE
RO_COMPAT_BTREE_DIR, INCOMPAT_COMPRESSION, INCOMPAT_DIRNAME_SIZE.
Changed the library to declare that we support COMPAT_DIR_PREALLOC,
INCOMPAT_DIRNAME_SIZE, RO_COMPAT_LARGE_FILE.
fileio.c: Rename function ext2fs_file_llseek to be ext2fs_file_lseek,
which is more accurate.
block.c: Add new function ext2fs_block_iterate3 which calls the
iterator function with the blockcount argument of type blkcnt_t. This
version of the function is allowed to handle large files; the other
fucntions are not.
ext2fs.h: Add new type blkcnt_t
ext2_err.et.in: Add error code EXT2_ET_FILE_TOO_BIG
block.c (ext2fs_block_iterate2): Fix bug where the block count field
wasn't getting correctly incremented for sparse files when the
indirect or doubly-indirect block specified in the inode was zero.
unlink.c (unlink_proc):
lookup.c (lookup_proc):
link.c (link_proc):
get_pathname.c (get_pathname_proc):
dir_iterate.c (ext2fs_process_dir_block): Mask off high 8 bits from
dirent->name_len, so it can be used for other purposes.
ext2fs.h: Add definition of EXT2_FEATURE_INCOMPAT_DIRNAME_SIZE, and
indicate that we have support for this incompatible option.
1998-03-23 05:06:52 +03:00
|
|
|
#define EXT2_LIB_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER|\
|
|
|
|
EXT2_FEATURE_RO_COMPAT_LARGE_FILE)
|
1997-04-26 17:21:57 +04:00
|
|
|
/*
|
|
|
|
* function prototypes
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* alloc.c */
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_new_inode(ext2_filsys fs, ext2_ino_t dir, int mode,
|
|
|
|
ext2fs_inode_bitmap map, ext2_ino_t *ret);
|
1997-04-26 17:21:57 +04:00
|
|
|
extern errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal,
|
1997-04-26 17:34:30 +04:00
|
|
|
ext2fs_block_bitmap map, blk_t *ret);
|
1997-04-26 17:21:57 +04:00
|
|
|
extern errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start,
|
1997-04-26 17:34:30 +04:00
|
|
|
blk_t finish, int num,
|
|
|
|
ext2fs_block_bitmap map,
|
1997-04-26 17:21:57 +04:00
|
|
|
blk_t *ret);
|
1997-10-26 02:37:42 +04:00
|
|
|
extern errcode_t ext2fs_alloc_block(ext2_filsys fs, blk_t goal,
|
|
|
|
char *block_buf, blk_t *ret);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
dir_iterate.c (ext2fs_dir_iterate2, ext2fs_process_dir_block):
Add support for a new flag, DIRENT_FLAG_INCLUDE_REMOVED,
which will return deleted directory entries.
ext2fs_dir_iterate2 takes a new callback function which
is identical with the one used by
ext2fs_dblist_dir_iterate(). If the directory entry is
deleted, the callback function will be called with the
entry paraemter set to DIRENT_DELETED_FILE.
Makefile.in, alloc_stats.c (ext2fs_inode_alloc_stats,
ext2fs_block_alloc_stats): New functions which update
block/inode allocation statistics in the bitmaps, block
group descriptors, and superblock.
mkjournal.c (mkjournal_proc), mkdir.c (ext2fs_mkdir),
expanddir.c (expand_dir_proc), bb_inode.c
(clear_bad_block_proc, set_bad_block_proc,
ext2fs_update_bb_inode), alloc.c (ext2fs_alloc_block):
Update to use new block/inode allocation statistics.
2002-01-03 11:29:19 +03:00
|
|
|
/* alloc_stats.c */
|
|
|
|
void ext2fs_inode_alloc_stats(ext2_filsys fs, ext2_ino_t ino, int inuse);
|
|
|
|
void ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse);
|
|
|
|
|
1997-06-09 18:51:29 +04:00
|
|
|
/* alloc_tables.c */
|
|
|
|
extern errcode_t ext2fs_allocate_tables(ext2_filsys fs);
|
1998-09-03 05:22:57 +04:00
|
|
|
extern errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group,
|
1997-06-09 18:51:29 +04:00
|
|
|
ext2fs_block_bitmap bmap);
|
1997-04-29 20:17:09 +04:00
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/* badblocks.c */
|
1997-04-29 20:17:09 +04:00
|
|
|
extern errcode_t ext2fs_badblocks_list_create(ext2_badblocks_list *ret,
|
|
|
|
int size);
|
|
|
|
extern errcode_t ext2fs_badblocks_list_add(ext2_badblocks_list bb,
|
|
|
|
blk_t blk);
|
|
|
|
extern int ext2fs_badblocks_list_test(ext2_badblocks_list bb,
|
|
|
|
blk_t blk);
|
|
|
|
extern errcode_t
|
|
|
|
ext2fs_badblocks_list_iterate_begin(ext2_badblocks_list bb,
|
|
|
|
ext2_badblocks_iterate *ret);
|
|
|
|
extern int ext2fs_badblocks_list_iterate(ext2_badblocks_iterate iter,
|
|
|
|
blk_t *blk);
|
|
|
|
extern void ext2fs_badblocks_list_iterate_end(ext2_badblocks_iterate iter);
|
1997-04-30 01:26:48 +04:00
|
|
|
extern errcode_t ext2fs_badblocks_copy(ext2_badblocks_list src,
|
|
|
|
ext2_badblocks_list *dest);
|
2000-07-04 23:20:25 +04:00
|
|
|
extern int ext2fs_badblocks_equal(ext2_badblocks_list bb1,
|
|
|
|
ext2_badblocks_list bb2);
|
1997-04-29 20:17:09 +04:00
|
|
|
|
|
|
|
/* bb_compat */
|
1997-04-26 17:21:57 +04:00
|
|
|
extern errcode_t badblocks_list_create(badblocks_list *ret, int size);
|
|
|
|
extern errcode_t badblocks_list_add(badblocks_list bb, blk_t blk);
|
|
|
|
extern int badblocks_list_test(badblocks_list bb, blk_t blk);
|
|
|
|
extern errcode_t badblocks_list_iterate_begin(badblocks_list bb,
|
|
|
|
badblocks_iterate *ret);
|
|
|
|
extern int badblocks_list_iterate(badblocks_iterate iter, blk_t *blk);
|
|
|
|
extern void badblocks_list_iterate_end(badblocks_iterate iter);
|
1997-04-30 01:26:48 +04:00
|
|
|
extern void badblocks_list_free(badblocks_list bb);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
|
|
|
/* bb_inode.c */
|
|
|
|
extern errcode_t ext2fs_update_bb_inode(ext2_filsys fs,
|
1997-04-29 20:17:09 +04:00
|
|
|
ext2_badblocks_list bb_list);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
|
|
|
/* bitmaps.c */
|
|
|
|
extern errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs);
|
|
|
|
extern errcode_t ext2fs_write_block_bitmap (ext2_filsys fs);
|
|
|
|
extern errcode_t ext2fs_read_inode_bitmap (ext2_filsys fs);
|
|
|
|
extern errcode_t ext2fs_read_block_bitmap(ext2_filsys fs);
|
1997-04-29 18:53:37 +04:00
|
|
|
extern errcode_t ext2fs_allocate_generic_bitmap(__u32 start,
|
|
|
|
__u32 end,
|
|
|
|
__u32 real_end,
|
|
|
|
const char *descr,
|
|
|
|
ext2fs_generic_bitmap *ret);
|
1997-04-26 17:58:21 +04:00
|
|
|
extern errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs,
|
|
|
|
const char *descr,
|
|
|
|
ext2fs_block_bitmap *ret);
|
|
|
|
extern errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs,
|
|
|
|
const char *descr,
|
|
|
|
ext2fs_inode_bitmap *ret);
|
|
|
|
extern errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap,
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
ext2_ino_t end, ext2_ino_t *oend);
|
1997-04-26 17:58:21 +04:00
|
|
|
extern errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap,
|
|
|
|
blk_t end, blk_t *oend);
|
|
|
|
extern void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap);
|
|
|
|
extern void ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap);
|
1997-04-26 17:21:57 +04:00
|
|
|
extern errcode_t ext2fs_read_bitmaps(ext2_filsys fs);
|
|
|
|
extern errcode_t ext2fs_write_bitmaps(ext2_filsys fs);
|
|
|
|
|
|
|
|
/* block.c */
|
|
|
|
extern errcode_t ext2fs_block_iterate(ext2_filsys fs,
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
ext2_ino_t ino,
|
1997-04-26 17:21:57 +04:00
|
|
|
int flags,
|
|
|
|
char *block_buf,
|
|
|
|
int (*func)(ext2_filsys fs,
|
|
|
|
blk_t *blocknr,
|
|
|
|
int blockcnt,
|
Many files:
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++.
closefs.c (ext2fs_flush): Add a call to io_channel_flush() to
make sure the contents of the disk are flushed to disk.
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)
1998-01-19 17:47:53 +03:00
|
|
|
void *priv_data),
|
|
|
|
void *priv_data);
|
1997-04-29 20:17:09 +04:00
|
|
|
errcode_t ext2fs_block_iterate2(ext2_filsys fs,
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
ext2_ino_t ino,
|
Many files:
ext2fs.h: Add new superblock fields (s_algorithm_usage_bitmap,
s_prealloc_blocks, s_prealloc_dir_blocks). Added conditional defines
of new features COMPAT_DIR_PREALLOC, RO_COMPAT_LARGE_FILE
RO_COMPAT_BTREE_DIR, INCOMPAT_COMPRESSION, INCOMPAT_DIRNAME_SIZE.
Changed the library to declare that we support COMPAT_DIR_PREALLOC,
INCOMPAT_DIRNAME_SIZE, RO_COMPAT_LARGE_FILE.
fileio.c: Rename function ext2fs_file_llseek to be ext2fs_file_lseek,
which is more accurate.
block.c: Add new function ext2fs_block_iterate3 which calls the
iterator function with the blockcount argument of type blkcnt_t. This
version of the function is allowed to handle large files; the other
fucntions are not.
ext2fs.h: Add new type blkcnt_t
ext2_err.et.in: Add error code EXT2_ET_FILE_TOO_BIG
block.c (ext2fs_block_iterate2): Fix bug where the block count field
wasn't getting correctly incremented for sparse files when the
indirect or doubly-indirect block specified in the inode was zero.
unlink.c (unlink_proc):
lookup.c (lookup_proc):
link.c (link_proc):
get_pathname.c (get_pathname_proc):
dir_iterate.c (ext2fs_process_dir_block): Mask off high 8 bits from
dirent->name_len, so it can be used for other purposes.
ext2fs.h: Add definition of EXT2_FEATURE_INCOMPAT_DIRNAME_SIZE, and
indicate that we have support for this incompatible option.
1998-03-23 05:06:52 +03:00
|
|
|
int flags,
|
|
|
|
char *block_buf,
|
|
|
|
int (*func)(ext2_filsys fs,
|
|
|
|
blk_t *blocknr,
|
1998-06-11 00:39:43 +04:00
|
|
|
e2_blkcnt_t blockcnt,
|
Many files:
ext2fs.h: Add new superblock fields (s_algorithm_usage_bitmap,
s_prealloc_blocks, s_prealloc_dir_blocks). Added conditional defines
of new features COMPAT_DIR_PREALLOC, RO_COMPAT_LARGE_FILE
RO_COMPAT_BTREE_DIR, INCOMPAT_COMPRESSION, INCOMPAT_DIRNAME_SIZE.
Changed the library to declare that we support COMPAT_DIR_PREALLOC,
INCOMPAT_DIRNAME_SIZE, RO_COMPAT_LARGE_FILE.
fileio.c: Rename function ext2fs_file_llseek to be ext2fs_file_lseek,
which is more accurate.
block.c: Add new function ext2fs_block_iterate3 which calls the
iterator function with the blockcount argument of type blkcnt_t. This
version of the function is allowed to handle large files; the other
fucntions are not.
ext2fs.h: Add new type blkcnt_t
ext2_err.et.in: Add error code EXT2_ET_FILE_TOO_BIG
block.c (ext2fs_block_iterate2): Fix bug where the block count field
wasn't getting correctly incremented for sparse files when the
indirect or doubly-indirect block specified in the inode was zero.
unlink.c (unlink_proc):
lookup.c (lookup_proc):
link.c (link_proc):
get_pathname.c (get_pathname_proc):
dir_iterate.c (ext2fs_process_dir_block): Mask off high 8 bits from
dirent->name_len, so it can be used for other purposes.
ext2fs.h: Add definition of EXT2_FEATURE_INCOMPAT_DIRNAME_SIZE, and
indicate that we have support for this incompatible option.
1998-03-23 05:06:52 +03:00
|
|
|
blk_t ref_blk,
|
|
|
|
int ref_offset,
|
|
|
|
void *priv_data),
|
|
|
|
void *priv_data);
|
1997-04-29 20:17:09 +04:00
|
|
|
|
1997-10-26 02:37:42 +04:00
|
|
|
/* bmap.c */
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino,
|
1997-10-26 02:37:42 +04:00
|
|
|
struct ext2_inode *inode,
|
|
|
|
char *block_buf, int bmap_flags,
|
|
|
|
blk_t block, blk_t *phys_blk);
|
|
|
|
|
|
|
|
|
ChangeLog, Makefile.in, bmap.c, bmove.c, ext2fs.h, jump.funcs:
ext2fs.h: If __STRICT_ANSI__ is defined and we're on a platform with
32 bit longs, then we need to manually define __s64 and __u64, since
the current kernel header files don't define these if __STRICT_ANSI__
is defined. This is a problem if we are compiling with full GCC
warnings, since we do need 64 bit support.
Makefile.in (OBJS): Remove bmove.o from files to be built, since we're
not using ext2fs_move_blocks() and there is some question as to its
usefulness in its current form.
bmap.c (block_bmap): Remove unused function.
bmove.c (process_block): Fix -Wall warning.
ChangeLog, debugfs.c, debugfs.h, dump.c:
debugfs.h: Add declaration for do_dirty_filsys() to prevent -Wall
warnings.
debugfs.c (copy_file):
dump.c (dump_file): Fix -Wall warning caused by signed/unsigned mismatch.
1998-03-30 05:27:25 +04:00
|
|
|
#if 0
|
1997-06-09 18:51:29 +04:00
|
|
|
/* bmove.c */
|
|
|
|
extern errcode_t ext2fs_move_blocks(ext2_filsys fs,
|
|
|
|
ext2fs_block_bitmap reserve,
|
1997-06-12 02:27:41 +04:00
|
|
|
ext2fs_block_bitmap alloc_map,
|
1997-06-09 18:51:29 +04:00
|
|
|
int flags);
|
ChangeLog, Makefile.in, bmap.c, bmove.c, ext2fs.h, jump.funcs:
ext2fs.h: If __STRICT_ANSI__ is defined and we're on a platform with
32 bit longs, then we need to manually define __s64 and __u64, since
the current kernel header files don't define these if __STRICT_ANSI__
is defined. This is a problem if we are compiling with full GCC
warnings, since we do need 64 bit support.
Makefile.in (OBJS): Remove bmove.o from files to be built, since we're
not using ext2fs_move_blocks() and there is some question as to its
usefulness in its current form.
bmap.c (block_bmap): Remove unused function.
bmove.c (process_block): Fix -Wall warning.
ChangeLog, debugfs.c, debugfs.h, dump.c:
debugfs.h: Add declaration for do_dirty_filsys() to prevent -Wall
warnings.
debugfs.c (copy_file):
dump.c (dump_file): Fix -Wall warning caused by signed/unsigned mismatch.
1998-03-30 05:27:25 +04:00
|
|
|
#endif
|
1997-06-09 18:51:29 +04:00
|
|
|
|
1997-04-26 17:34:30 +04:00
|
|
|
/* check_desc.c */
|
|
|
|
extern errcode_t ext2fs_check_desc(ext2_filsys fs);
|
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/* closefs.c */
|
|
|
|
extern errcode_t ext2fs_close(ext2_filsys fs);
|
|
|
|
extern errcode_t ext2fs_flush(ext2_filsys fs);
|
1997-04-29 21:48:10 +04:00
|
|
|
extern int ext2fs_bg_has_super(ext2_filsys fs, int group_block);
|
2000-12-13 21:36:23 +03:00
|
|
|
extern void ext2fs_update_dynamic_rev(ext2_filsys fs);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
1997-04-26 17:58:21 +04:00
|
|
|
/* cmp_bitmaps.c */
|
|
|
|
extern errcode_t ext2fs_compare_block_bitmap(ext2fs_block_bitmap bm1,
|
|
|
|
ext2fs_block_bitmap bm2);
|
|
|
|
extern errcode_t ext2fs_compare_inode_bitmap(ext2fs_inode_bitmap bm1,
|
|
|
|
ext2fs_inode_bitmap bm2);
|
|
|
|
|
1997-04-29 20:17:09 +04:00
|
|
|
/* dblist.c */
|
|
|
|
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_get_num_dirs(ext2_filsys fs, ext2_ino_t *ret_num_dirs);
|
1997-04-30 01:26:48 +04:00
|
|
|
extern errcode_t ext2fs_init_dblist(ext2_filsys fs, ext2_dblist *ret_dblist);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ext2_ino_t ino,
|
1997-04-30 01:26:48 +04:00
|
|
|
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,
|
Many files:
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++.
closefs.c (ext2fs_flush): Add a call to io_channel_flush() to
make sure the contents of the disk are flushed to disk.
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)
1998-01-19 17:47:53 +03:00
|
|
|
void *priv_data),
|
|
|
|
void *priv_data);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_set_dir_block(ext2_dblist dblist, ext2_ino_t ino,
|
1997-04-30 01:26:48 +04:00
|
|
|
blk_t blk, int blockcnt);
|
|
|
|
extern errcode_t ext2fs_copy_dblist(ext2_dblist src,
|
|
|
|
ext2_dblist *dest);
|
1997-06-17 07:55:00 +04:00
|
|
|
extern int ext2fs_dblist_count(ext2_dblist dblist);
|
1997-04-29 20:17:09 +04:00
|
|
|
|
|
|
|
/* dblist_dir.c */
|
|
|
|
extern errcode_t
|
|
|
|
ext2fs_dblist_dir_iterate(ext2_dblist dblist,
|
|
|
|
int flags,
|
|
|
|
char *block_buf,
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
int (*func)(ext2_ino_t dir,
|
1997-04-29 20:17:09 +04:00
|
|
|
int entry,
|
|
|
|
struct ext2_dir_entry *dirent,
|
|
|
|
int offset,
|
|
|
|
int blocksize,
|
|
|
|
char *buf,
|
Many files:
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++.
closefs.c (ext2fs_flush): Add a call to io_channel_flush() to
make sure the contents of the disk are flushed to disk.
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)
1998-01-19 17:47:53 +03:00
|
|
|
void *priv_data),
|
|
|
|
void *priv_data);
|
1997-04-26 17:58:21 +04:00
|
|
|
|
|
|
|
/* dirblock.c */
|
|
|
|
extern errcode_t ext2fs_read_dir_block(ext2_filsys fs, blk_t block,
|
|
|
|
void *buf);
|
|
|
|
extern errcode_t ext2fs_write_dir_block(ext2_filsys fs, blk_t block,
|
|
|
|
void *buf);
|
|
|
|
|
1997-04-29 20:17:09 +04:00
|
|
|
/* dir_iterate.c */
|
|
|
|
extern errcode_t ext2fs_dir_iterate(ext2_filsys fs,
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
ext2_ino_t dir,
|
1997-04-29 20:17:09 +04:00
|
|
|
int flags,
|
|
|
|
char *block_buf,
|
|
|
|
int (*func)(struct ext2_dir_entry *dirent,
|
|
|
|
int offset,
|
|
|
|
int blocksize,
|
|
|
|
char *buf,
|
Many files:
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++.
closefs.c (ext2fs_flush): Add a call to io_channel_flush() to
make sure the contents of the disk are flushed to disk.
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)
1998-01-19 17:47:53 +03:00
|
|
|
void *priv_data),
|
|
|
|
void *priv_data);
|
dir_iterate.c (ext2fs_dir_iterate2, ext2fs_process_dir_block):
Add support for a new flag, DIRENT_FLAG_INCLUDE_REMOVED,
which will return deleted directory entries.
ext2fs_dir_iterate2 takes a new callback function which
is identical with the one used by
ext2fs_dblist_dir_iterate(). If the directory entry is
deleted, the callback function will be called with the
entry paraemter set to DIRENT_DELETED_FILE.
Makefile.in, alloc_stats.c (ext2fs_inode_alloc_stats,
ext2fs_block_alloc_stats): New functions which update
block/inode allocation statistics in the bitmaps, block
group descriptors, and superblock.
mkjournal.c (mkjournal_proc), mkdir.c (ext2fs_mkdir),
expanddir.c (expand_dir_proc), bb_inode.c
(clear_bad_block_proc, set_bad_block_proc,
ext2fs_update_bb_inode), alloc.c (ext2fs_alloc_block):
Update to use new block/inode allocation statistics.
2002-01-03 11:29:19 +03:00
|
|
|
extern errcode_t ext2fs_dir_iterate2(ext2_filsys fs,
|
|
|
|
ext2_ino_t dir,
|
|
|
|
int flags,
|
|
|
|
char *block_buf,
|
|
|
|
int (*func)(ext2_ino_t dir,
|
|
|
|
int entry,
|
|
|
|
struct ext2_dir_entry *dirent,
|
|
|
|
int offset,
|
|
|
|
int blocksize,
|
|
|
|
char *buf,
|
|
|
|
void *priv_data),
|
|
|
|
void *priv_data);
|
1997-04-29 20:17:09 +04:00
|
|
|
|
1997-04-30 01:26:48 +04:00
|
|
|
/* dupfs.c */
|
|
|
|
extern errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest);
|
1997-04-29 20:17:09 +04:00
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/* expanddir.c */
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_expand_dir(ext2_filsys fs, ext2_ino_t dir);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
2001-07-02 19:54:09 +04:00
|
|
|
/* ext_attr.c */
|
|
|
|
void ext2fs_swap_ext_attr(ext2_filsys fs, char *to, char *from);
|
|
|
|
extern errcode_t ext2fs_read_ext_attr(ext2_filsys fs, blk_t block, void *buf);
|
|
|
|
extern errcode_t ext2fs_write_ext_attr(ext2_filsys fs, blk_t block, void *buf);
|
1997-10-26 02:37:42 +04:00
|
|
|
/* fileio.c */
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_file_open(ext2_filsys fs, ext2_ino_t ino,
|
1997-10-26 02:37:42 +04:00
|
|
|
int flags, ext2_file_t *ret);
|
1997-11-03 22:16:55 +03:00
|
|
|
extern ext2_filsys ext2fs_file_get_fs(ext2_file_t file);
|
1997-10-26 02:37:42 +04:00
|
|
|
extern errcode_t ext2fs_file_close(ext2_file_t file);
|
|
|
|
extern errcode_t ext2fs_file_read(ext2_file_t file, void *buf,
|
1997-11-03 22:16:55 +03:00
|
|
|
unsigned int wanted, unsigned int *got);
|
1997-10-26 02:37:42 +04:00
|
|
|
extern errcode_t ext2fs_file_write(ext2_file_t file, void *buf,
|
1997-11-03 22:16:55 +03:00
|
|
|
unsigned int nbytes, unsigned int *written);
|
Many files:
ext2fs.h: Add new superblock fields (s_algorithm_usage_bitmap,
s_prealloc_blocks, s_prealloc_dir_blocks). Added conditional defines
of new features COMPAT_DIR_PREALLOC, RO_COMPAT_LARGE_FILE
RO_COMPAT_BTREE_DIR, INCOMPAT_COMPRESSION, INCOMPAT_DIRNAME_SIZE.
Changed the library to declare that we support COMPAT_DIR_PREALLOC,
INCOMPAT_DIRNAME_SIZE, RO_COMPAT_LARGE_FILE.
fileio.c: Rename function ext2fs_file_llseek to be ext2fs_file_lseek,
which is more accurate.
block.c: Add new function ext2fs_block_iterate3 which calls the
iterator function with the blockcount argument of type blkcnt_t. This
version of the function is allowed to handle large files; the other
fucntions are not.
ext2fs.h: Add new type blkcnt_t
ext2_err.et.in: Add error code EXT2_ET_FILE_TOO_BIG
block.c (ext2fs_block_iterate2): Fix bug where the block count field
wasn't getting correctly incremented for sparse files when the
indirect or doubly-indirect block specified in the inode was zero.
unlink.c (unlink_proc):
lookup.c (lookup_proc):
link.c (link_proc):
get_pathname.c (get_pathname_proc):
dir_iterate.c (ext2fs_process_dir_block): Mask off high 8 bits from
dirent->name_len, so it can be used for other purposes.
ext2fs.h: Add definition of EXT2_FEATURE_INCOMPAT_DIRNAME_SIZE, and
indicate that we have support for this incompatible option.
1998-03-23 05:06:52 +03:00
|
|
|
extern errcode_t ext2fs_file_lseek(ext2_file_t file, ext2_off_t offset,
|
|
|
|
int whence, ext2_off_t *ret_pos);
|
1997-11-03 22:16:55 +03:00
|
|
|
extern ext2_off_t ext2fs_file_get_size(ext2_file_t file);
|
|
|
|
extern errcode_t ext2fs_file_set_size(ext2_file_t file, ext2_off_t size);
|
1997-10-26 02:37:42 +04:00
|
|
|
|
2000-08-19 21:00:47 +04:00
|
|
|
/* finddev.c */
|
|
|
|
extern char *ext2fs_find_block_device(dev_t device);
|
|
|
|
|
ChangeLog, MCONFIG.in, configure, configure.in:
MCONFIG.in: Change --enable-gcc-wall handling so that it's no longer a
configure option, but something which is done when the developer uses
the command "make gcc-wall".
configure.in: Remove test for ino_t, since we don't use it any more
(we always use our own ext2_ino_t). Remove --enable-gcc-wall support.
Add test for sys/ioctl.h
.del-types.h.in~ca55114a:
Remove definition of ino_t
ChangeLog, Makefile.in, ext2fs.h, flushb.c, jump.funcs:
flushb.c (ext2fs_sync_device): New function which centralizes all of
the places which might try to use the BLKFLSBUF or FDFLUSH ioctls (and
usually failing to define them since the system header files don't
usually do this for us, and we're trying to avoid usage of kernel
include files now.)
2001-01-11 18:48:50 +03:00
|
|
|
/* flushb.c */
|
|
|
|
extern errcode_t ext2fs_sync_device(int fd, int flushb);
|
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/* freefs.c */
|
|
|
|
extern void ext2fs_free(ext2_filsys fs);
|
1997-04-29 18:53:37 +04:00
|
|
|
extern void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap);
|
1997-04-26 17:58:21 +04:00
|
|
|
extern void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap);
|
|
|
|
extern void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap);
|
1997-04-30 01:26:48 +04:00
|
|
|
extern void ext2fs_free_dblist(ext2_dblist dblist);
|
|
|
|
extern void ext2fs_badblocks_list_free(badblocks_list bb);
|
1997-04-26 17:58:21 +04:00
|
|
|
|
|
|
|
/* getsize.c */
|
|
|
|
extern errcode_t ext2fs_get_device_size(const char *file, int blocksize,
|
|
|
|
blk_t *retblocks);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
ChangeLog, Makefile.in, e2image.h, ext2_err.et.in, ext2fs.h, imager.c:
imager.c (ext2fs_image_{inode,super,bitmap}_{read,write}, ext2_fs.h,
Makefile.in: New file that has routines that save ext2fs metadata to a
file.
ext2_err.et.in (EXT2_ET_MAGIC_E2IMAGE): New error code assigned.
e2image.h: New file which defines the file format for the ext2 image
file. (Saved copy of ext2 metadata to a file as a saving throw
against worst-case damage.)
ChangeLog, Makefile.in, e2image.c:
e2image.c, Makefile.in: New program which saves ext2 metadata to a
file for people who need a last-ditch saving throw.
2000-11-12 22:32:20 +03:00
|
|
|
/* imager.c */
|
|
|
|
extern errcode_t ext2fs_image_inode_write(ext2_filsys fs, int fd, int flags);
|
|
|
|
extern errcode_t ext2fs_image_inode_read(ext2_filsys fs, int fd, int flags);
|
|
|
|
extern errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd, int flags);
|
|
|
|
extern errcode_t ext2fs_image_super_read(ext2_filsys fs, int fd, int flags);
|
|
|
|
extern errcode_t ext2fs_image_bitmap_write(ext2_filsys fs, int fd, int flags);
|
|
|
|
extern errcode_t ext2fs_image_bitmap_read(ext2_filsys fs, int fd, int flags);
|
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/* initialize.c */
|
|
|
|
extern errcode_t ext2fs_initialize(const char *name, int flags,
|
|
|
|
struct ext2_super_block *param,
|
|
|
|
io_manager manager, ext2_filsys *ret_fs);
|
|
|
|
|
|
|
|
/* inode.c */
|
ChangeLog, Makefile.in, e2image.h, ext2_err.et.in, ext2fs.h, imager.c:
imager.c (ext2fs_image_{inode,super,bitmap}_{read,write}, ext2_fs.h,
Makefile.in: New file that has routines that save ext2fs metadata to a
file.
ext2_err.et.in (EXT2_ET_MAGIC_E2IMAGE): New error code assigned.
e2image.h: New file which defines the file format for the ext2 image
file. (Saved copy of ext2 metadata to a file as a saving throw
against worst-case damage.)
ChangeLog, Makefile.in, e2image.c:
e2image.c, Makefile.in: New program which saves ext2 metadata to a
file for people who need a last-ditch saving throw.
2000-11-12 22:32:20 +03:00
|
|
|
extern errcode_t ext2fs_flush_icache(ext2_filsys fs);
|
1997-04-26 17:21:57 +04:00
|
|
|
extern errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks,
|
|
|
|
ext2_inode_scan *ret_scan);
|
|
|
|
extern void ext2fs_close_inode_scan(ext2_inode_scan scan);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ext2_ino_t *ino,
|
1997-04-26 17:21:57 +04:00
|
|
|
struct ext2_inode *inode);
|
1997-04-29 20:17:09 +04:00
|
|
|
extern errcode_t ext2fs_inode_scan_goto_blockgroup(ext2_inode_scan scan,
|
|
|
|
int group);
|
|
|
|
extern void ext2fs_set_inode_callback
|
|
|
|
(ext2_inode_scan scan,
|
|
|
|
errcode_t (*done_group)(ext2_filsys fs,
|
|
|
|
ext2_inode_scan scan,
|
|
|
|
dgrp_t group,
|
Many files:
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++.
closefs.c (ext2fs_flush): Add a call to io_channel_flush() to
make sure the contents of the disk are flushed to disk.
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)
1998-01-19 17:47:53 +03:00
|
|
|
void * priv_data),
|
1997-04-29 20:17:09 +04:00
|
|
|
void *done_group_data);
|
|
|
|
extern int ext2fs_inode_scan_flags(ext2_inode_scan scan, int set_flags,
|
|
|
|
int clear_flags);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_read_inode (ext2_filsys fs, ext2_ino_t ino,
|
1997-04-26 17:21:57 +04:00
|
|
|
struct ext2_inode * inode);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_write_inode(ext2_filsys fs, ext2_ino_t ino,
|
1997-04-26 17:21:57 +04:00
|
|
|
struct ext2_inode * inode);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_get_blocks(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks);
|
|
|
|
extern errcode_t ext2fs_check_directory(ext2_filsys fs, ext2_ino_t ino);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
1997-04-29 20:17:09 +04:00
|
|
|
/* icount.c */
|
|
|
|
extern void ext2fs_free_icount(ext2_icount_t icount);
|
1997-04-29 21:48:10 +04:00
|
|
|
extern errcode_t ext2fs_create_icount2(ext2_filsys fs, int flags, int size,
|
|
|
|
ext2_icount_t hint, ext2_icount_t *ret);
|
1997-04-29 20:17:09 +04:00
|
|
|
extern errcode_t ext2fs_create_icount(ext2_filsys fs, int flags, int size,
|
|
|
|
ext2_icount_t *ret);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_icount_fetch(ext2_icount_t icount, ext2_ino_t ino,
|
1997-04-29 20:17:09 +04:00
|
|
|
__u16 *ret);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_icount_increment(ext2_icount_t icount, ext2_ino_t ino,
|
1997-04-29 20:17:09 +04:00
|
|
|
__u16 *ret);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_icount_decrement(ext2_icount_t icount, ext2_ino_t ino,
|
1997-04-29 20:17:09 +04:00
|
|
|
__u16 *ret);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_icount_store(ext2_icount_t icount, ext2_ino_t ino,
|
1997-04-29 20:17:09 +04:00
|
|
|
__u16 count);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern ext2_ino_t ext2fs_get_icount_size(ext2_icount_t icount);
|
1997-04-29 21:48:10 +04:00
|
|
|
errcode_t ext2fs_icount_validate(ext2_icount_t icount, FILE *);
|
1997-04-29 20:17:09 +04:00
|
|
|
|
1997-04-26 17:58:21 +04:00
|
|
|
/* ismounted.c */
|
|
|
|
extern errcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags);
|
2001-01-03 17:56:46 +03:00
|
|
|
extern errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags,
|
|
|
|
char *mtpt, int mtlen);
|
1997-04-26 17:58:21 +04:00
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/* namei.c */
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_lookup(ext2_filsys fs, ext2_ino_t dir, const char *name,
|
|
|
|
int namelen, char *buf, ext2_ino_t *inode);
|
|
|
|
extern errcode_t ext2fs_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,
|
|
|
|
const char *name, ext2_ino_t *inode);
|
|
|
|
errcode_t ext2fs_namei_follow(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,
|
|
|
|
const char *name, ext2_ino_t *inode);
|
|
|
|
extern errcode_t ext2fs_follow_link(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,
|
|
|
|
ext2_ino_t inode, ext2_ino_t *res_inode);
|
1997-04-29 18:53:37 +04:00
|
|
|
|
|
|
|
/* native.c */
|
|
|
|
int ext2fs_native_flag(void);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
|
|
|
/* newdir.c */
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_new_dir_block(ext2_filsys fs, ext2_ino_t dir_ino,
|
|
|
|
ext2_ino_t parent_ino, char **block);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
|
|
|
/* mkdir.c */
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_mkdir(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t inum,
|
1997-04-26 17:21:57 +04:00
|
|
|
const char *name);
|
|
|
|
|
2000-10-24 22:33:16 +04:00
|
|
|
/* mkjournal.c */
|
ChangeLog, ext2_err.et.in, ext2fs.h, initialize.c, mkjournal.c, openfs.c:
initialize.c (ext2fs_initialize): Add support for initializing the
ext2 superblock for external journal devices. This basically means we
don't bother to allocate any block group descriptors.
openfs.c (ext2fs_open): Only open external journal devices if the new
flag EXT2_FLAG_JOURNAL_DEV_OK is passed to ext2fs_open. When opening
such devices, don't try to read the block group descriptors, since
they're not there.
ext2_err.et.in (EXT2_NO_JOURNAL_SB): Add new error code
mkjournal.c: Export a new function,
ext2fs_create_journal_superblock(), which allocates and returns a
buffer containing a journal superblock. This is needed by mke2fs to
create an external journal. Rewrote ext2fs_add_journal_device() so
that it no longer creates the external journal, but rather adds a
filesystem to an existing external journal. It handles all of the
UUID manipulation.
ext2fs.h: List the EXT3_FEATURE_JOURNAL_DEV as a flag supported by the
library. Define the EXT2_FLAG_JOURNAL_DEV_OK. Changed function
prototype for ext2fs_add_journal_device().
2001-01-16 09:56:14 +03:00
|
|
|
extern errcode_t ext2fs_create_journal_superblock(ext2_filsys fs,
|
|
|
|
__u32 size, int flags,
|
|
|
|
char **ret_jsb);
|
|
|
|
extern errcode_t ext2fs_add_journal_device(ext2_filsys fs,
|
|
|
|
ext2_filsys journal_dev);
|
2001-01-03 16:04:12 +03:00
|
|
|
extern errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size,
|
|
|
|
int flags);
|
2000-10-24 22:33:16 +04:00
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/* openfs.c */
|
|
|
|
extern errcode_t ext2fs_open(const char *name, int flags, int superblock,
|
|
|
|
int block_size, io_manager manager,
|
|
|
|
ext2_filsys *ret_fs);
|
|
|
|
|
|
|
|
/* get_pathname.c */
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern errcode_t ext2fs_get_pathname(ext2_filsys fs, ext2_ino_t dir, ext2_ino_t ino,
|
1997-04-26 17:21:57 +04:00
|
|
|
char **name);
|
|
|
|
|
|
|
|
/* link.c */
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
errcode_t ext2fs_link(ext2_filsys fs, ext2_ino_t dir, const char *name,
|
|
|
|
ext2_ino_t ino, int flags);
|
|
|
|
errcode_t ext2fs_unlink(ext2_filsys fs, ext2_ino_t dir, const char *name,
|
|
|
|
ext2_ino_t ino, int flags);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
|
|
|
/* read_bb.c */
|
1997-04-29 20:17:09 +04:00
|
|
|
extern errcode_t ext2fs_read_bb_inode(ext2_filsys fs,
|
|
|
|
ext2_badblocks_list *bb_list);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
|
|
|
/* read_bb_file.c */
|
2000-07-04 23:20:25 +04:00
|
|
|
extern errcode_t ext2fs_read_bb_FILE2(ext2_filsys fs, FILE *f,
|
|
|
|
ext2_badblocks_list *bb_list,
|
|
|
|
void *private,
|
|
|
|
void (*invalid)(ext2_filsys fs,
|
|
|
|
blk_t blk,
|
|
|
|
char *badstr,
|
|
|
|
void *private));
|
1997-04-26 17:21:57 +04:00
|
|
|
extern errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f,
|
1997-04-29 20:17:09 +04:00
|
|
|
ext2_badblocks_list *bb_list,
|
1997-04-26 17:21:57 +04:00
|
|
|
void (*invalid)(ext2_filsys fs,
|
|
|
|
blk_t blk));
|
|
|
|
|
1997-04-29 20:17:09 +04:00
|
|
|
/* rs_bitmap.c */
|
|
|
|
extern errcode_t ext2fs_resize_generic_bitmap(__u32 new_end,
|
|
|
|
__u32 new_real_end,
|
|
|
|
ext2fs_generic_bitmap bmap);
|
|
|
|
extern errcode_t ext2fs_resize_inode_bitmap(__u32 new_end, __u32 new_real_end,
|
|
|
|
ext2fs_inode_bitmap bmap);
|
|
|
|
extern errcode_t ext2fs_resize_block_bitmap(__u32 new_end, __u32 new_real_end,
|
|
|
|
ext2fs_block_bitmap bmap);
|
1997-04-30 01:26:48 +04:00
|
|
|
extern errcode_t ext2fs_copy_bitmap(ext2fs_generic_bitmap src,
|
|
|
|
ext2fs_generic_bitmap *dest);
|
1997-04-29 20:17:09 +04:00
|
|
|
|
1997-04-26 17:58:21 +04:00
|
|
|
/* swapfs.c */
|
|
|
|
extern void ext2fs_swap_super(struct ext2_super_block * super);
|
|
|
|
extern void ext2fs_swap_group_desc(struct ext2_group_desc *gdp);
|
1997-04-29 18:53:37 +04:00
|
|
|
extern void ext2fs_swap_inode(ext2_filsys fs,struct ext2_inode *t,
|
|
|
|
struct ext2_inode *f, int hostorder);
|
|
|
|
|
1997-04-29 20:17:09 +04:00
|
|
|
/* valid_blk.c */
|
1997-04-29 21:48:10 +04:00
|
|
|
extern int ext2fs_inode_has_valid_blocks(struct ext2_inode *inode);
|
|
|
|
|
|
|
|
/* version.c */
|
|
|
|
extern int ext2fs_parse_version_string(const char *ver_string);
|
|
|
|
extern int ext2fs_get_library_version(const char **ver_string,
|
|
|
|
const char **date_string);
|
1997-04-26 17:58:21 +04:00
|
|
|
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
/* write_bb_file.c */
|
|
|
|
extern errcode_t ext2fs_write_bb_FILE(ext2_badblocks_list bb_list,
|
|
|
|
unsigned int flags,
|
|
|
|
FILE *f);
|
|
|
|
|
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/* inline functions */
|
1997-11-03 22:16:55 +03:00
|
|
|
extern errcode_t ext2fs_get_mem(unsigned long size, void **ptr);
|
1997-10-26 06:41:24 +03:00
|
|
|
extern errcode_t ext2fs_free_mem(void **ptr);
|
1998-04-27 05:41:13 +04:00
|
|
|
extern errcode_t ext2fs_resize_mem(unsigned long old_size,
|
|
|
|
unsigned long size, void **ptr);
|
1997-04-26 17:21:57 +04:00
|
|
|
extern void ext2fs_mark_super_dirty(ext2_filsys fs);
|
|
|
|
extern void ext2fs_mark_changed(ext2_filsys fs);
|
|
|
|
extern int ext2fs_test_changed(ext2_filsys fs);
|
|
|
|
extern void ext2fs_mark_valid(ext2_filsys fs);
|
|
|
|
extern void ext2fs_unmark_valid(ext2_filsys fs);
|
|
|
|
extern int ext2fs_test_valid(ext2_filsys fs);
|
|
|
|
extern void ext2fs_mark_ib_dirty(ext2_filsys fs);
|
|
|
|
extern void ext2fs_mark_bb_dirty(ext2_filsys fs);
|
|
|
|
extern int ext2fs_test_ib_dirty(ext2_filsys fs);
|
|
|
|
extern int ext2fs_test_bb_dirty(ext2_filsys fs);
|
|
|
|
extern int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk);
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
extern int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino);
|
1997-04-26 17:21:57 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The actual inlined functions definitions themselves...
|
|
|
|
*
|
|
|
|
* If NO_INLINE_FUNCS is defined, then we won't try to do inline
|
|
|
|
* functions at all!
|
|
|
|
*/
|
|
|
|
#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
|
|
|
|
#ifdef INCLUDE_INLINE_FUNCS
|
|
|
|
#define _INLINE_ extern
|
|
|
|
#else
|
1998-04-27 05:41:13 +04:00
|
|
|
#ifdef __GNUC__
|
1997-04-26 17:21:57 +04:00
|
|
|
#define _INLINE_ extern __inline__
|
1998-04-27 05:41:13 +04:00
|
|
|
#else /* For Watcom C */
|
|
|
|
#define _INLINE_ extern inline
|
|
|
|
#endif
|
1997-04-26 17:21:57 +04:00
|
|
|
#endif
|
|
|
|
|
1997-10-26 06:41:24 +03:00
|
|
|
#ifndef EXT2_CUSTOM_MEMORY_ROUTINES
|
|
|
|
/*
|
|
|
|
* Allocate memory
|
|
|
|
*/
|
1997-11-03 22:16:55 +03:00
|
|
|
_INLINE_ errcode_t ext2fs_get_mem(unsigned long size, void **ptr)
|
1997-10-26 06:41:24 +03:00
|
|
|
{
|
|
|
|
*ptr = malloc(size);
|
|
|
|
if (!*ptr)
|
1997-10-31 09:17:08 +03:00
|
|
|
return EXT2_ET_NO_MEMORY;
|
1997-10-26 06:41:24 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Free memory
|
|
|
|
*/
|
|
|
|
_INLINE_ errcode_t ext2fs_free_mem(void **ptr)
|
|
|
|
{
|
|
|
|
free(*ptr);
|
|
|
|
*ptr = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Resize memory
|
|
|
|
*/
|
1998-04-27 05:41:13 +04:00
|
|
|
_INLINE_ errcode_t ext2fs_resize_mem(unsigned long old_size,
|
|
|
|
unsigned long size, void **ptr)
|
1997-10-26 06:41:24 +03:00
|
|
|
{
|
|
|
|
void *p;
|
|
|
|
|
|
|
|
p = realloc(*ptr, size);
|
|
|
|
if (!p)
|
1997-10-31 09:17:08 +03:00
|
|
|
return EXT2_ET_NO_MEMORY;
|
1997-10-26 06:41:24 +03:00
|
|
|
*ptr = p;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif /* Custom memory routines */
|
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
/*
|
|
|
|
* Mark a filesystem superblock as dirty
|
|
|
|
*/
|
|
|
|
_INLINE_ void ext2fs_mark_super_dirty(ext2_filsys fs)
|
|
|
|
{
|
|
|
|
fs->flags |= EXT2_FLAG_DIRTY | EXT2_FLAG_CHANGED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mark a filesystem as changed
|
|
|
|
*/
|
|
|
|
_INLINE_ void ext2fs_mark_changed(ext2_filsys fs)
|
|
|
|
{
|
|
|
|
fs->flags |= EXT2_FLAG_CHANGED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check to see if a filesystem has changed
|
|
|
|
*/
|
|
|
|
_INLINE_ int ext2fs_test_changed(ext2_filsys fs)
|
|
|
|
{
|
|
|
|
return (fs->flags & EXT2_FLAG_CHANGED);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mark a filesystem as valid
|
|
|
|
*/
|
|
|
|
_INLINE_ void ext2fs_mark_valid(ext2_filsys fs)
|
|
|
|
{
|
|
|
|
fs->flags |= EXT2_FLAG_VALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mark a filesystem as NOT valid
|
|
|
|
*/
|
|
|
|
_INLINE_ void ext2fs_unmark_valid(ext2_filsys fs)
|
|
|
|
{
|
|
|
|
fs->flags &= ~EXT2_FLAG_VALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check to see if a filesystem is valid
|
|
|
|
*/
|
|
|
|
_INLINE_ int ext2fs_test_valid(ext2_filsys fs)
|
|
|
|
{
|
|
|
|
return (fs->flags & EXT2_FLAG_VALID);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mark the inode bitmap as dirty
|
|
|
|
*/
|
|
|
|
_INLINE_ void ext2fs_mark_ib_dirty(ext2_filsys fs)
|
|
|
|
{
|
|
|
|
fs->flags |= EXT2_FLAG_IB_DIRTY | EXT2_FLAG_CHANGED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mark the block bitmap as dirty
|
|
|
|
*/
|
|
|
|
_INLINE_ void ext2fs_mark_bb_dirty(ext2_filsys fs)
|
|
|
|
{
|
|
|
|
fs->flags |= EXT2_FLAG_BB_DIRTY | EXT2_FLAG_CHANGED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check to see if a filesystem's inode bitmap is dirty
|
|
|
|
*/
|
|
|
|
_INLINE_ int ext2fs_test_ib_dirty(ext2_filsys fs)
|
|
|
|
{
|
|
|
|
return (fs->flags & EXT2_FLAG_IB_DIRTY);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check to see if a filesystem's block bitmap is dirty
|
|
|
|
*/
|
|
|
|
_INLINE_ int ext2fs_test_bb_dirty(ext2_filsys fs)
|
|
|
|
{
|
|
|
|
return (fs->flags & EXT2_FLAG_BB_DIRTY);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Return the group # of a block
|
|
|
|
*/
|
|
|
|
_INLINE_ int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk)
|
|
|
|
{
|
|
|
|
return (blk - fs->super->s_first_data_block) /
|
|
|
|
fs->super->s_blocks_per_group;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Return the group # of an inode number
|
|
|
|
*/
|
Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
to protect applications that attempt to compile
-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?). So
we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 07:54:39 +03:00
|
|
|
_INLINE_ int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino)
|
1997-04-26 17:21:57 +04:00
|
|
|
{
|
|
|
|
return (ino - 1) / fs->super->s_inodes_per_group;
|
|
|
|
}
|
|
|
|
#undef _INLINE_
|
|
|
|
#endif
|
|
|
|
|
2000-05-19 06:11:41 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1998-02-17 01:00:37 +03:00
|
|
|
#endif /* _EXT2FS_EXT2FS_H */
|