Ceci est le fichier Info libext2fs.info, produit par Makeinfo version
4.0 à partir ../../doc/libext2fs.texinfo.

INFO-DIR-SECTION Development
START-INFO-DIR-ENTRY
* libext2fs: (libext2fs.info).   The EXT2FS library.
END-INFO-DIR-ENTRY

   This file documents the ext2fs library, a library for manipulating
the ext2 filesystem.

   Copyright (C) 1997, 1998, 1999 Theodore Ts'o

   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the author.


File: libext2fs.info,  Node: Top,  Next: Introduction to the EXT2FS Library,  Prev: (dir),  Up: (dir)

The EXT2FS Library
******************

   This manual documents the EXT2FS Library, version 1.20.

* Menu:

* Introduction to the EXT2FS Library::
* EXT2FS Library Functions::
* Concept Index::
* Function Index::


File: libext2fs.info,  Node: Introduction to the EXT2FS Library,  Next: EXT2FS Library Functions,  Prev: Top,  Up: Top

Introduction to the EXT2FS Library
**********************************

   The EXT2FS library is designed to allow user-level programs to
manipulate an ext2 filesystem.


File: libext2fs.info,  Node: EXT2FS Library Functions,  Next: Concept Index,  Prev: Introduction to the EXT2FS Library,  Up: Top

EXT2FS Library Functions
************************

* Menu:

* Filesystem-level functions::
* Inode Functions::
* Directory functions::
* Bitmap Functions::
* EXT2 data abstractions::
* Byte-swapping functions::
* Other functions::


File: libext2fs.info,  Node: Filesystem-level functions,  Next: Inode Functions,  Prev: EXT2FS Library Functions,  Up: EXT2FS Library Functions

Filesystem-level functions
==========================

   The following functions operate on a filesystem handle.  Most EXT2FS
Library functions require a filesystem handle as their first argument.
There are two functions which create a filesystem handle, `ext2fs_open'
and `ext2fs_initialize'.

   The filesystem can also be closed using `ext2fs_close', and any
changes to the superblock and group descripts can be written out to disk
using `ext2fs_flush'.

* Menu:

* Opening an ext2 filesystem::
* Closing and flushing out changes::
* Initializing a filesystem::
* Filesystem flag functions::


File: libext2fs.info,  Node: Opening an ext2 filesystem,  Next: Closing and flushing out changes,  Prev: Filesystem-level functions,  Up: Filesystem-level functions

Opening an ext2 filesystem
--------------------------

   Most libext2fs functions take a filesystem handle of type
`ext2_filsys'.  A filesystem handle is created either by opening an
existing function using `ext2fs_open', or by initializing a new
filesystem using `ext2fs_initialize'.

 - Fonction: errcode_t ext2fs_open (const char *NAME, int FLAGS, int
          SUPERBLOCK, int BLOCK_SIZE, io_manager MANAGER, ext2_filsys
          *RET_FS)
     Opens a filesystem named NAME, using the the io_manager MANAGER to
     define the input/output routines needed to read and write the
     filesystem.  In the case of the `unix_io' io_manager, NAME is
     interpreted as the Unix filename of the filesystem image.  This is
     often a device file, such as `/dev/hda1'.

     The SUPERBLOCK parameter specifies the block number of the
     superblock which should be used when opening the filesystem.  If
     SUPERBLOCK is zero, `ext2fs_open' will use the primary superblock
     located at offset 1024 bytes from the start of the filesystem
     image.

     The BLOCK_SIZE parameter specifies the block size used by the
     filesystem.  Normally this is determined automatically from the
     filesystem uperblock.  If BLOCK_SIZE is non-zero, it must match
     the block size found in the superblock, or the error
     `EXT2_ET_UNEXPECTED_BLOCK_SIZE' will be returned.  The BLOCK_SIZE
     parameter is also used to help fund the superblock when SUPERBLOCK
     is non-zero.

     The FLAGS argument contains a bitmask of flags which control how
     the filesystem open should be handled.

    `EXT2_FLAG_RW'
          Open the filesystem for reading and writing.  Without this
          flag, the filesystem is opened for reading only.

    `EXT2_FLAG_FORCE'
          Open the filesystem regardless of the feature sets listed in
          the superblock.



File: libext2fs.info,  Node: Closing and flushing out changes,  Next: Initializing a filesystem,  Prev: Opening an ext2 filesystem,  Up: Filesystem-level functions

Closing and flushing out changes
--------------------------------

 - Fonction: errcode_t ext2fs_flush (ext2_filsys FS)
     Write any changes to the high-level filesystem data structures in
     the FS filesystem.  The following data structures will be written
     out:

        * The filesystem superblock

        * The filesystem group descriptors

        * The filesystem bitmaps, if read in via `ext2fs_read_bitmaps'.


 - Fonction: void ext2fs_free (ext2_filsys FS)
     Close the io_manager abstraction for FS and release all memory
     associated with the filesystem handle.

 - Fonction: errcode_t ext2fs_close (ext2_filsys FS)
     Flush out any changes to the high-level filesystem data structures
     using `ext2fs_flush' if the filesystem is marked dirty; then close
     and free the filesystem using `ext2fs_free'.



File: libext2fs.info,  Node: Initializing a filesystem,  Next: Filesystem flag functions,  Prev: Closing and flushing out changes,  Up: Filesystem-level functions

Initializing a filesystem
-------------------------

   An ext2 filesystem is initializing by the `mke2fs' program.  The two
functions described here, `ext2fs_initialize' and
`ext2fs_allocate_tables' do much of the initial work for setting up a
filesystem.  However, they don't do the whole job.  `mke2fs' calls
`ext2fs_initialize' to set up the filesystem superblock, and calls
`ext2fs_allocate_tables' to allocate space for the inode table, and the
inode and block bitmaps.  In addition, `mke2fs' must also initialize
the inode tables by clearing them with zeros, create the root and
lost+found directories, and reserve the reserved inodes.

 - Fonction: errcode_t ext2fs_initialize (const char *NAME, int FLAGS,
          struct ext2_super_block *PARAM, io_manager MANAGER,
          ext2_filsys *RET_FS)
     This function is used by the `mke2fs' program to initialize a
     filesystem.  The `ext2fs_initialize' function creates a filesystem
     handle which is returned in RET_FS that has been properly setup
     for a filesystem to be located in NAME, using the io_manager
     MANAGER.  The prototype superblock in PARAM is used to supply
     parameters such as the number of blocks in the filesystem, the
     block size, etc.

     The `ext2fs_initialize' function does not actually do any I/O; that
     will be done when the application program calls `ext2fs_close' or
     `ext2fs_flush'.  Also, this function only initializes the
     superblock and group descriptor structures.  It does not create the
     inode table or the root directory.  This must be done by the
     calling application, such as `mke2fs'.

     The following values may be set in the PARAM prototype superblock;
     if a value of 0 is found in a field, `ext2fs_initialize' will use a
     default value.  The calling application should zero out the
     prototype entire superblock, and then fill in any appropriate
     values.

    `s_blocks_count'
          The number of blocks in the filesystem.  This parameter is
          mandatory and must be set by the calling application.

    `s_inodes_count'
          The number of inodes in the filesystem.  The default value is
          determined by calculating the size of the filesystem, and
          creating one inode for every 4096 bytes.

    `s_r_blocks_count'
          The number of blocks which should be reserved for the
          superuser.  The default value is zero blocks.

    `s_log_block_size'
          The blocksize of the filesystem.  Valid values are 0 (1024
          bytes), 1 (2048 bytes), or 2 (4096 bytes).  The default
          blocksize is 1024 bytes.

    `s_log_frag_size'
          The size of fragments.  The ext2 filesystem does not support
          fragments (and may never support fragments).  Currently this
          field must be the same as `s_log_block_size'.

    `s_first_data_block'
          The first data block for the filesystem.  For filesystem with
          a blocksize of 1024 bytes, this value must be at least 1,
          since the superblock is located in block number 1.  For
          filesystems with larger blocksizes, the superblock is still
          located at an offset of 1024 bytes, so the superblock is
          located in block number 0.  By default, this value is set to
          1 for filesystems with a block size of 1024 bytes, or 0 for
          filesystems with larger blocksizes.

    `s_max_mnt_count'
          This field defines the number of times that the filesystem
          can be mounted before it should be checked using `e2fsck'.
          When `e2fsck' is run without the `-f' option, `e2fsck' will
          skip the filesystem check if the number of times that the
          filesystem has been mounted is less than `s_max_mnt_count'
          and if the interval between the last time a filesystem check
          was performed and the current time is less than
          `s_checkinterval' (see below).  The default value of
          `s_max_mnt_count' is 20.

    `s_checkinterval'
          This field defines the minimal interval between filesystem
          checks.  See the previous entry for a discussion of how this
          field is used by `e2fsck'.  The default value of this field
          is 180 days (six months).

    `s_errors'
          This field defines the behavior which should be used by the
          kernel of errors are detected in the filesystem.  Possible
          values include:

         `EXT2_ERRORS_CONTINUE'
               Continue execution when errors are detected.

         `EXT2_ERRORS_RO'
               Remount the filesystem read-only.

         `EXT2_ERRORS_PANIC'
               Panic.

          The default behavior is `EXT2_ERRORS_CONTINUE'.


 - Fonction: errcode_t ext2fs_allocate_tables (ext2_filsys FS)
     Allocate space for the inode table and the block and inode
     bitmaps.  The inode tables and block and inode bitmaps aren't
     actually initialized; this function just allocates the space for
     them.


File: libext2fs.info,  Node: Filesystem flag functions,  Prev: Initializing a filesystem,  Up: Filesystem-level functions

Filesystem flag functions
-------------------------

   The filesystem handle has a number of flags which can be manipulated
using the following function.  Some of these flags affect how the
libext2fs filesystem behaves; others are provided solely for the
application's convenience.

 - Fonction: void ext2fs_mark_changed (ext2_filsys FS)
 - Fonction: int ext2fs_test_changed (ext2_filsys FS)
     This flag indicates whether or not the filesystem has been changed.
     It is not used by the ext2fs library.

 - Fonction: void ext2fs_mark_super_dirty (ext2_filsys FS)
     Mark the filesystem FS as being dirty; this will cause the
     superblock information to be flushed out when `ext2fs_close' is
     called.  `ext2fs_mark_super_dirty' will also set the filesystem
     changed flag.  The dirty flag is automatically cleared by
     `ext2fs_flush' when the superblock is written to disk.

 - Fonction: void ext2fs_mark_valid (ext2_filsys FS)
 - Fonction: void ext2fs_unmark_valid (ext2_filsys FS)
 - Fonction: int ext2fs_test_valid (ext2_filsys FS)
     This flag indicates whether or not the filesystem is free of
     errors.  It is not used by libext2fs, and is solely for the
     application's convenience.

 - Fonction: void ext2fs_mark_ib_dirty (ext2_filsys FS)
 - Fonction: void ext2fs_mark_bb_dirty (ext2_filsys FS)
 - Fonction: int ext2fs_test_ib_dirty (ext2_filsys FS)
 - Fonction: int ext2fs_test_bb_dirty (ext2_filsys FS)
     These flags indicate whether or not the inode or block bitmaps
     have been modified.   If the flag is set, it will cause the
     appropriate bitmap to be written when the filesystem is closed or
     flushed.


File: libext2fs.info,  Node: Inode Functions,  Next: Directory functions,  Prev: Filesystem-level functions,  Up: EXT2FS Library Functions

Inode Functions
===============

* Menu:

* Reading and writing inodes::
* Iterating over inodes in a filesystem::
* Iterating over blocks in an inode::
* Inode Convenience Functions::


File: libext2fs.info,  Node: Reading and writing inodes,  Next: Iterating over inodes in a filesystem,  Prev: Inode Functions,  Up: Inode Functions

Reading and writing inodes
--------------------------

 - Fonction: errcode_t ext2fs_read_inode (ext2_filsys FS, ext2_ino_t
          INO, struct ext2_inode *INODE)
     Read the inode number INO into INODE.

 - Fonction: errcode_t ext2fs_write_inode(ext2_filsys FS, ext2_ino_t
          INO, struct ext2_inode *INODE)
     Write INODE to inode INO.


File: libext2fs.info,  Node: Iterating over inodes in a filesystem,  Next: Iterating over blocks in an inode,  Prev: Reading and writing inodes,  Up: Inode Functions

Iterating over inodes in a filesystem
-------------------------------------

   The inode_scan abstraction is useful for iterating over all the
inodes in a filesystem.

 - Fonction: errcode_t ext2fs_open_inode_scan (ext2_filsys FS, int
          BUFFER_BLOCKS, ext2_inode_scan *SCAN)
     Initialize the iteration variable SCAN.  This variable is used by
     `ext2fs_get_next_inode'.  The BUFFER_BLOCKS parameter controls how
     many blocks of the inode table are read in at a time.  A large
     number of blocks requires more memory, but reduces the overhead in
     seeking and reading from the disk.  If BUFFER_BLOCKS is zero, a
     suitable default value will be used.

 - Fonction: void ext2fs_close_inode_scan (ext2_inode_scan SCAN)
     Release the memory associated with SCAN and invalidate it.

 - Fonction: errcode_t ext2fs_get_next_inode (ext2_inode_scan SCAN,
          ext2_ino_t *INO, struct ext2_inode *INODE)
     This function returns the next inode from the filesystem; the inode
     number of the inode is stored in INO, and the inode is stored in
     INODE.

     If the inode is located in a block that has been marked as bad,
     `ext2fs_get_next_inode' will return the error
     `EXT2_ET_BAD_BLOCK_IN_INODE_TABLE'.

 - Fonction: errcode_t ext2fs_inode_scan_goto_blockgroup
          (ext2_inode_scan SCAN, int GROUP)
     Start the inode scan at a particular ext2 blockgroup, GROUP.  This
     function may be safely called at any time while SCAN is valid.

 - Fonction: void ext2fs_set_inode_callback (ext2_inode_scan SCAN,
          errcode_t (*done_group)(ext2_filsys FS, ext2_inode_scan SCAN,
          dgrp_t GROUP, void * PRIVATE), void *DONE_GROUP_DATA)
     Register a callback function which will be called by
     `ext2_get_next_inode' when all of the inodes in a block group have
     been processed.

 - Fonction: int ext2fs_inode_scan_flags (ext2_inode_scan SCAN, int
          SET_FLAGS, int CLEAR_FLAGS)
     Set the scan_flags SET_FLAGS and clear the scan_flags CLEAR_FLAGS.
     The following flags can be set using this interface:

    `EXT2_SF_SKIP_MISSING_ITABLE'
          When a block group is missing an inode table, skip it.  If
          this flag is not set `ext2fs_get_next_inode' will return the
          error EXT2_ET_MISSING_INODE_TABLE.



File: libext2fs.info,  Node: Iterating over blocks in an inode,  Next: Inode Convenience Functions,  Prev: Iterating over inodes in a filesystem,  Up: Inode Functions

Iterating over blocks in an inode
---------------------------------

 - Fonction: errcode_t ext2fs_block_iterate (ext2_filsys FS, ext2_ino_t
          INO, int FLAGS, char *block_buf, int (*func)(ext2_filsys FS,
          blk_t *BLOCKNR, int BLOCKCNT, void *PRIVATE), void *PRIVATE)

 - Fonction: errcode_t ext2fs_block_iterate2 (ext2_filsys FS,
          ext2_ino_t INO, int FLAGS, char *BLOCK_buf, int
          (*func)(ext2_filsys FS, blk_t *BLOCKNR, e2_blkcnt_t BLOCKCNT,
          blk_t REF_BLK, int REF_OFFSET, void *PRIVATE), void *PRIVATE)


File: libext2fs.info,  Node: Inode Convenience Functions,  Prev: Iterating over blocks in an inode,  Up: Inode Functions

Convenience functions for Inodes
--------------------------------

 - Fonction: errcode_t ext2fs_get_blocks (ext2_filsys FS, ext2_ino_t
          INO, blk_t *BLOCKS)
     Returns an array of blocks corresponding to the direct, indirect,
     doubly indirect, and triply indirect blocks as stored in the inode
     structure.

 - Fonction: errcode_t ext2fs_check_directory (ext2_filsys FS,
          ext2_ino_t INO)
     Returns 0 if INO is a directory, and `ENOTDIR' if it is not.

 - Fonction: int ext2_inode_has_valid_blocks (struct ext2_inode *INODE)
     Returns 1 if the inode's block entries actually valid block
     entries, and 0 if not.  Inodes which represent devices and fast
     symbolic links do not contain valid block entries.


File: libext2fs.info,  Node: Directory functions,  Next: Bitmap Functions,  Prev: Inode Functions,  Up: EXT2FS Library Functions

Directory functions
===================

* Menu:

* Directory block functions::
* Iterating over a directory::
* Creating and expanding directories::
* Creating and removing directory entries::
* Looking up filenames::
* Translating inode numbers to filenames::


File: libext2fs.info,  Node: Directory block functions,  Next: Iterating over a directory,  Prev: Directory functions,  Up: Directory functions

Directory block functions
-------------------------

 - Fonction: errcode_t ext2fs_read_dir_block (ext2_filsys FS, blk_t
          BLOCK, void *BUF)

 - Fonction: errcode_t ext2fs_write_dir_block (ext2_filsys FS, blk_t
          BLOCK, void *BUF)

 - Fonction: errcode_t ext2fs_new_dir_block (ext2_filsys FS, ext2_ino_t
          DIR_ino, ext2_ino_t PARENT_INO, char **BLOCK)


File: libext2fs.info,  Node: Iterating over a directory,  Next: Creating and expanding directories,  Prev: Directory block functions,  Up: Directory functions

Iterating over a directory
--------------------------

 - Fonction: errcode_t ext2fs_dir_iterate (ext2_filsys FS, ext2_ino_t
          DIR, int FLAGS, char *BLOCK_BUF, int (*FUNC)(struct
          ext2_dir_entry *DIRENT, int OFFSET, int BLOCKSIZE, char *BUF,
          void *PRIVATE), void *PRIVATE)


File: libext2fs.info,  Node: Creating and expanding directories,  Next: Creating and removing directory entries,  Prev: Iterating over a directory,  Up: Directory functions

Creating and expanding directories
----------------------------------

 - Fonction: errcode_t ext2fs_mkdir (ext2_filsys FS, ext2_ino_t PARENT,
          ext2_ino_t INUM, const char *NAME)

 - Fonction: errcode_t ext2fs_expand_dir (ext2_filsys FS, ext2_ino_t
          DIR)


File: libext2fs.info,  Node: Creating and removing directory entries,  Next: Looking up filenames,  Prev: Creating and expanding directories,  Up: Directory functions

Creating and removing directory entries
---------------------------------------

 - Fonction: errcode_t ext2fs_link (ext2_filsys FS, ext2_ino_t DIR,
          const char *NAME, ext2_ino_t INO, int flags)

 - Fonction: errcode_t ext2fs_unlink (ext2_filsys FS, ext2_ino_t DIR,
          const char *NAME, ext2_ino_t INO, int FLAGS)


File: libext2fs.info,  Node: Looking up filenames,  Next: Translating inode numbers to filenames,  Prev: Creating and removing directory entries,  Up: Directory functions

Looking up filenames
--------------------

 - Fonction: errcode_t ext2fs_lookup (ext2_filsys FS, ext2_ino_t DIR,
          const char *NAME, int NAMELEN, char *BUF, ext2_ino_t *INODE)

 - Fonction: errcode_t ext2fs_namei (ext2_filsys FS, ext2_ino_t ROOT,
          ext2_ino_t CWD, const char *NAME, ext2_ino_t *INODE)

 - Fonction: errcode_t ext2fs_namei_follow (ext2_filsys FS, ext2_ino_t
          ROOT, ext2_ino_t CWD, const char *NAME, ext2_ino_t *INODE)

 - Fonction: 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)


File: libext2fs.info,  Node: Translating inode numbers to filenames,  Prev: Looking up filenames,  Up: Directory functions

Translating inode numbers to filenames
--------------------------------------

 - Fonction: errcode_t ext2fs_get_pathname (ext2_filsys FS, ext2_ino_t
          DIR, ext2_ino_t INO, char **NAME)


File: libext2fs.info,  Node: Bitmap Functions,  Next: EXT2 data abstractions,  Prev: Directory functions,  Up: EXT2FS Library Functions

Bitmap Functions
================

* Menu:

* Reading and Writing Bitmaps::
* Allocating Bitmaps::
* Free bitmaps::
* Bitmap Operations::
* Comparing bitmaps::
* Modifying Bitmaps::
* Resizing Bitmaps::
* Clearing Bitmaps::


File: libext2fs.info,  Node: Reading and Writing Bitmaps,  Next: Allocating Bitmaps,  Prev: Bitmap Functions,  Up: Bitmap Functions

Reading and Writing Bitmaps
---------------------------

 - Fonction: errcode_t ext2fs_write_inode_bitmap (ext2_filsys FS)

 - Fonction: errcode_t ext2fs_write_block_bitmap (ext2_filsys FS)

 - Fonction: errcode_t ext2fs_read_inode_bitmap (ext2_filsys FS)

 - Fonction: errcode_t ext2fs_read_block_bitmap (ext2_filsys FS)

 - Fonction: errcode_t ext2fs_read_bitmaps (ext2_filsys FS)

 - Fonction: errcode_t ext2fs_write_bitmaps (ext2_filsys FS)


File: libext2fs.info,  Node: Allocating Bitmaps,  Next: Free bitmaps,  Prev: Reading and Writing Bitmaps,  Up: Bitmap Functions

Allocating Bitmaps
------------------

 - Fonction: errcode_t ext2fs_allocate_generic_bitmap (__u32 START,
          __u32 END, _u32 REAL_END, const char *DESCR,
          ext2fs_generic_bitmap *RET)

 - Fonction: errcode_t ext2fs_allocate_block_bitmap (ext2_filsys FS,
          const char *DESCR, ext2fs_block_bitmap *RET)

 - Fonction: errcode_t ext2fs_allocate_inode_bitmap (ext2_filsys FS,
          const char *DESCR, ext2fs_inode_bitmap *RET)


File: libext2fs.info,  Node: Free bitmaps,  Next: Bitmap Operations,  Prev: Allocating Bitmaps,  Up: Bitmap Functions

Freeing bitmaps
---------------

 - Fonction: void ext2fs_free_generic_bitmap (ext2fs_inode_bitmap
          BITMAP)

 - Fonction: void ext2fs_free_block_bitmap (ext2fs_block_bitmap BITMAP)

 - Fonction: void ext2fs_free_inode_bitmap (ext2fs_inode_bitmap BITMAP)


File: libext2fs.info,  Node: Bitmap Operations,  Next: Comparing bitmaps,  Prev: Free bitmaps,  Up: Bitmap Functions

Bitmap Operations
-----------------

 - Fonction: void ext2fs_mark_block_bitmap (ext2fs_block_bitmap BITMAP,
          blk_t BLOCK)
 - Fonction: void ext2fs_unmark_block_bitmap (ext2fs_block_bitmap
          BITMAP, blk_t BLOCK)
 - Fonction: int ext2fs_test_block_bitmap (ext2fs_block_bitmap BITMAP,
          blk_t BLOCK)
     These functions set, clear, and test bits in a block bitmap BITMAP.

 - Fonction: void ext2fs_mark_inode_bitmap (ext2fs_inode_bitmap BITMAP,
          ext2_ino_t INODE)
 - Fonction: void ext2fs_unmark_inode_bitmap (ext2fs_inode_bitmap
          BITMAP, ext2_ino_t INODE)
 - Fonction: int ext2fs_test_inode_bitmap (ext2fs_inode_bitmap BITMAP,
          ext2_ino_t INODE)
     These functions set, clear, and test bits in an inode bitmap
     BITMAP.

 - Fonction: void ext2fs_fast_mark_block_bitmap (ext2fs_block_bitmap
          BITMAP, blk_t BLOCK)
 - Fonction: void ext2fs_fast_unmark_block_bitmap (ext2fs_block_bitmap
          BITMAP, blk_t BLOCK)
 - Fonction: int ext2fs_fast_test_block_bitmap (ext2fs_block_bitmap
          BITMAP, blk_t BLOCK)
 - Fonction: void ext2fs_fast_mark_inode_bitmap (ext2fs_inode_bitmap
          BITMAP, ext2_ino_t INODE)
 - Fonction: void ext2fs_fast_unmark_inode_bitmap (ext2fs_inode_bitmap
          BITMAP, ext2_ino_t INODE)
 - Fonction: int ext2fs_fast_test_inode_bitmap (ext2fs_inode_bitmap
          BITMAP, ext2_ino_t INODE)
     These "fast" functions are like their normal counterparts; however,
     they are implemented as inline functions and do not perform bounds
     checks on the inode number or block number; they are assumed to be
     correct.  They should only be used in speed-critical applications,
     where the inode or block number has already been validated by
     other means.

 - Fonction: blk_t ext2fs_get_block_bitmap_start (ext2fs_block_bitmap
          BITMAP)
 - Fonction: ext2_ino_t ext2fs_get_inode_bitmap_start
          (ext2fs_inode_bitmap BITMAP)
     Return the first inode or block which is stored in the bitmap.

 - Fonction: blk_t ext2fs_get_block_bitmap_end (ext2fs_block_bitmap
          BITMAP)
 - Fonction: ext2_ino_t ext2fs_get_inode_bitmap_end
          (ext2fs_inode_bitmap BITMAP)
     Return the first inode or block which is stored in the bitmap.


File: libext2fs.info,  Node: Comparing bitmaps,  Next: Modifying Bitmaps,  Prev: Bitmap Operations,  Up: Bitmap Functions

Comparing bitmaps
-----------------

 - Fonction: errcode_t ext2fs_compare_block_bitmap (ext2fs_block_bitmap
          BM1, ext2fs_block_bitmap BM2)

 - Fonction: errcode_t ext2fs_compare_inode_bitmap (ext2fs_inode_bitmap
          BM1, ext2fs_inode_bitmap BM2)


File: libext2fs.info,  Node: Modifying Bitmaps,  Next: Resizing Bitmaps,  Prev: Comparing bitmaps,  Up: Bitmap Functions

Modifying Bitmaps
-----------------

 - Fonction: errcode_t ext2fs_fudge_inode_bitmap_end
          (ext2fs_inode_bitmap BITMAP, ext2_ino_t END, ext2_ino_t *OEND)

 - Fonction: errcode_t ext2fs_fudge_block_bitmap_end
          (ext2fs_block_bitmap BITMAP, blk_t END, blk_t *OEND)


File: libext2fs.info,  Node: Resizing Bitmaps,  Next: Clearing Bitmaps,  Prev: Modifying Bitmaps,  Up: Bitmap Functions

Resizing Bitmaps
----------------

 - Fonction: errcode_t ext2fs_resize_generic_bitmap (__u32 NEW_END,
          __u32 NEW_REAL_END, ext2fs_generic_bitmap BMAP)

 - Fonction: errcode_t ext2fs_resize_inode_bitmap (__u32 NEW_END, __u32
          NEW_REAL_END, ext2fs_inode_bitmap BMAP)

 - Fonction: errcode_t ext2fs_resize_block_bitmap (__u32 NEW_END, __u32
          NEW_REAL_END, ext2fs_block_bitmap BMAP)


File: libext2fs.info,  Node: Clearing Bitmaps,  Prev: Resizing Bitmaps,  Up: Bitmap Functions

Clearing Bitmaps
----------------

 - Fonction: void ext2fs_clear_inode_bitmap (ext2fs_inode_bitmap BITMAP)

 - Fonction: void ext2fs_clear_block_bitmap (ext2fs_block_bitmap BITMAP)


File: libext2fs.info,  Node: EXT2 data abstractions,  Next: Byte-swapping functions,  Prev: Bitmap Functions,  Up: EXT2FS Library Functions

EXT2 data abstractions
======================

   The ext2 library has a number of abstractions which are useful for
ext2 utility programs.

* Menu:

* Badblocks list management::
* Directory-block list management::
* Inode count functions::


File: libext2fs.info,  Node: Badblocks list management,  Next: Directory-block list management,  Prev: EXT2 data abstractions,  Up: EXT2 data abstractions

Badblocks list management
-------------------------

 - Fonction: errcode_t ext2fs_badblocks_list_create
          (ext2_badblocks_list *RET, int SIZE)

 - Fonction: void ext2fs_badblocks_list_free (ext2_badblocks_list BB)

 - Fonction: errcode_t ext2fs_badblocks_list_add (ext2_badblocks_list
          BB, blk_t BLK)

 - Fonction: int ext2fs_badblocks_list_test (ext2_badblocks_list BB,
          blk_t BLK)

 - Fonction: errcode_t ext2fs_badblocks_list_iterate_begin
          (ext2_badblocks_list BB, ext2_badblocks_iterate *RET)

 - Fonction: int ext2fs_badblocks_list_iterate (ext2_badblocks_iterate
          iter, blk_t *BLK)

 - Fonction: void ext2fs_badblocks_list_iterate_end
          (ext2_badblocks_iterate ITER)

 - Fonction: errcode_t ext2fs_update_bb_inode (ext2_filsys FS,
          ext2_badblocks_list BB_LIST)

 - Fonction: errcode_t ext2fs_read_bb_inode (ext2_filsys FS,
          ext2_badblocks_list *BB_LIST)

 - Fonction: errcode_t ext2fs_read_bb_FILE (ext2_filsys FS, FILE *f,
          ext2_badblocks_list *BB_LIST, void (*invalid)(ext2_filsys FS,
          blk_t BLK))


File: libext2fs.info,  Node: Directory-block list management,  Next: Inode count functions,  Prev: Badblocks list management,  Up: EXT2 data abstractions

Directory-block list management
-------------------------------

   The dblist abstraction stores a list of blocks belonging to
directories.  This list can be useful when a program needs to interate
over all directory entries in a filesystem; `e2fsck' does this in pass
2 of its operations, and `debugfs' needs to do this when it is trying
to turn an inode number into a pathname.

 - Fonction: errcode_t ext2fs_init_dblist (ext2_filsys FS, ext2_dblist
          *RET_DBLIST)
     Creates a dblist data structure and return it in RET_DBLIST.

 - Fonction: void ext2fs_free_dblist (ext2_dblist DBLIST)
     Free a dblist data structure.

 - Fonction: errcode_t ext2fs_add_dir_block (ext2_dblist DBLIST,
          ext2_ino_t INO, blk_t BLK, int BLOCKCNT)
     Add an entry to the dblist data structure.  This call records the
     fact that block number BLOCKCNT of directory inode INO is stored
     in block BLK.

 - Fonction: errcode_t ext2fs_set_dir_block (ext2_dblist DBLIST,
          ext2_ino_t INO, blk_t BLK, int BLOCKCNT)
     Change an entry in the dblist data structure; this changes the
     location of block number BLOCKCNT of directory indoe INO to be
     block BLK.

 - Fonction: errcode_t ext2fs_dblist_iterate (ext2_dblist DBLIST, int
          (*func)(ext2_filsys FS, struct ext2_db_entry *DB_INFO, void
          *PRIVATE), void *PRIVATE)
     This iterator calls FUNC for every entry in the dblist data
     structure.

 - Fonction: errcode_t ext2fs_dblist_dir_iterate (ext2_dblist DBLIST,
          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 *PRIVATE), void *PRIVATE)
     This iterator takes reads in the directory block indicated in each
     dblist entry, and calls FUNC for each directory entry in each
     directory block.  If DBLIST contains all the directory blocks in a
     filesystem, this function provides a convenient way to iterate
     over all directory entries for that filesystem.


File: libext2fs.info,  Node: Inode count functions,  Prev: Directory-block list management,  Up: EXT2 data abstractions

Inode count functions
---------------------

   The icount abstraction is a specialized data type used by `e2fsck'
to store how many times a particular inode is referenced by the
filesystem.  This is used twice; once to store the actual number of
times that the inode is reference; and once to store the claimed number
of times the inode is referenced according to the inode structure.

   This abstraction is designed to be extremely efficient for storing
this sort of information, by taking advantage of the following
properties of inode counts, namely (1) inode counts are very often zero
(because the inode is currrently not in use), and (2) many files have a
inode count of 1 (because they are a file which has no additional hard
links).

 - Fonction: errcode_t ext2fs_create_icount2(ext2_filsys FS, int FLAGS,
          int SIZE, ext2_icount_t HINT, ext2_icount_t *RET)
     Creates an icount stucture for a filesystem FS, with initial space
     for SIZE inodes whose count is greater than 1.  The FLAGS
     parameter is either 0 or `EXT2_ICOUNT_OPT_INCREMENT', which
     indicates that icount structure should be able to increment inode
     counts quickly.  The icount structure is returned in RET.  The
     returned icount structure initially has a count of zero for all
     inodes.

     The HINT parameter allows the caller to optionally pass in another
     icount structure which is used to initialize the array of inodes
     whose count is greater than 1.  It is used purely as a speed
     optimization so that the icount structure can determine in advance
     which inodes are likely to contain a count grater than 1.

 - Fonction: void ext2fs_free_icount(ext2_icount_t ICOUNT)
     Frees an icount structure.

 - Fonction: errcode_t ext2fs_icount_fetch(ext2_icount_t ICOUNT,
          ext2_ino_t INO, __u16 *RET)
     Returns in RET fetches the count for a particular inode INO.

 - Fonction: errcode_t ext2fs_icount_increment(ext2_icount_t ICOUNT,
          ext2_ino_t INO, __u16 *RET)
     Increments the ref count for inode INO.

 - Fonction: errcode_t ext2fs_icount_decrement(ext2_icount_t ICOUNT,
          ext2_ino_t INO, __u16 *RET)
     Decrements the ref count for inode INO.

 - Fonction: errcode_t ext2fs_icount_store(ext2_icount_t ICOUNT,
          ext2_ino_t INO, __u16 COUNT)
     Sets the reference count for inode INO to be COUNT.

 - Fonction: ext2_ino_t ext2fs_get_icount_size(ext2_icount_t ICOUNT)
     Returns the current number of inodes in ICOUNT which has a count
     greater than 1.

 - Fonction: errcode_t ext2fs_icount_validate(ext2_icount_t ICOUNT,
          FILE *F)
     Validates the internal rep invariant of ICOUNT; if there are any
     problems, print out debugging information to F.  This function is
     intended for debugging and testing use only.


File: libext2fs.info,  Node: Byte-swapping functions,  Next: Other functions,  Prev: EXT2 data abstractions,  Up: EXT2FS Library Functions

Byte-swapping functions
=======================

 - Fonction: void ext2fs_swap_super (struct ext2_super_block * SUPER)

 - Fonction: void ext2fs_swap_group_desc (struct ext2_group_desc *GDP)

 - Fonction: void ext2fs_swap_inode (ext2_filsys FS, struct ext2_inode
          *TO, struct ext2_inode *FROM, int HOSTORDER)

 - Fonction: int ext2fs_native_flag (void)


File: libext2fs.info,  Node: Other functions,  Prev: Byte-swapping functions,  Up: EXT2FS Library Functions

Other functions
===============

   /* alloc.c */

 - Fonction: errcode_t ext2fs_new_inode (ext2_filsys FS, ext2_ino_t
          DIR, int MODE, ext2fs_inode_bitmap MAP, ext2_ino_t *RET)

 - Fonction: errcode_t ext2fs_new_block (ext2_filsys FS, blk_t GOAL,
          ext2fs_block_bitmap MAP, blk_t *RET)

 - Fonction: errcode_t ext2fs_get_free_blocks (ext2_filsys FS, blk_t
          START, blk_t FINISH, int NUM, ext2fs_block_bitmap MAP, blk_t
          *RET)

   /* check_desc.c */

 - Fonction: errcode_t ext2fs_check_desc (ext2_filsys FS)

 - Fonction: errcode_t ext2_get_num_dirs (ext2_filsys FS, ext2_ino_t
          *RET_NUM_DIRS)

   /* getsize.c */

 - Fonction: errcode_t ext2fs_get_device_size (const char *FILE, int
          BLOCKSIZE, blk_t *RETBLOCKS)

   /* ismounted.c */

 - Fonction: errcode_t ext2fs_check_if_mounted (const char *FILE, int
          *MOUNT_FLAGS)

   /* version.c */

 - Fonction: int ext2fs_get_library_version(const char **VER_STRING,
          const char **DATE_STRING)
     This function returns the current version of the ext2 library.  The
     return value contains an integer version code, which consists of
     the major version number of the library multiplied by 100, plus
     the minor version number of the library.  Hence, if the library
     version is 1.08, the returned value will be 108.

     If VER_STRING and/or DATE_STRING are non-NULL, they will be set to
     point at a constant string containing the library version and/or
     release date, respectively.

 - Fonction: int ext2fs_parse_version_string(const char *VER_STRING)
     This function takes a version string which may included in an
     application and returns a version code using the same algorithm
     used by `ext2fs_get_library_version'.  It can be used by programs
     included in the `e2fsprogs' distribution to assure that they are
     using an up-to-date ext2 shared library.

   /* inline functions */

 - Fonction: int ext2fs_group_of_blk (ext2_filsys FS, blk_t BLK)

 - Fonction: int ext2fs_group_of_ino (ext2_filsys FS, ext2_ino_t INO)


File: libext2fs.info,  Node: Concept Index,  Next: Function Index,  Prev: EXT2FS Library Functions,  Up: Top

Concept Index
*************

* Menu:

File: libext2fs.info,  Node: Function Index,  Prev: Concept Index,  Up: Top

Function and Type Index
***********************

* Menu:

* ext2_get_num_dirs:                     Other functions.
* ext2_inode_has_valid_blocks:           Inode Convenience Functions.
* ext2fs_add_dir_block:                  Directory-block list management.
* ext2fs_allocate_block_bitmap:          Allocating Bitmaps.
* ext2fs_allocate_generic_bitmap:        Allocating Bitmaps.
* ext2fs_allocate_inode_bitmap:          Allocating Bitmaps.
* ext2fs_allocate_tables:                Initializing a filesystem.
* ext2fs_badblocks_list_add:             Badblocks list management.
* ext2fs_badblocks_list_create:          Badblocks list management.
* ext2fs_badblocks_list_free:            Badblocks list management.
* ext2fs_badblocks_list_iterate:         Badblocks list management.
* ext2fs_badblocks_list_iterate_begin:   Badblocks list management.
* ext2fs_badblocks_list_iterate_end:     Badblocks list management.
* ext2fs_badblocks_list_test:            Badblocks list management.
* ext2fs_block_iterate:                  Iterating over blocks in an inode.
* ext2fs_block_iterate2:                 Iterating over blocks in an inode.
* ext2fs_check_desc:                     Other functions.
* ext2fs_check_directory:                Inode Convenience Functions.
* ext2fs_check_if_mounted:               Other functions.
* ext2fs_clear_block_bitmap:             Clearing Bitmaps.
* ext2fs_clear_inode_bitmap:             Clearing Bitmaps.
* ext2fs_close:                          Closing and flushing out changes.
* ext2fs_close_inode_scan:               Iterating over inodes in a filesystem.
* ext2fs_compare_block_bitmap:           Comparing bitmaps.
* ext2fs_compare_inode_bitmap:           Comparing bitmaps.
* ext2fs_create_icount2:                 Inode count functions.
* ext2fs_dblist_dir_iterate:             Directory-block list management.
* ext2fs_dblist_iterate:                 Directory-block list management.
* ext2fs_dir_iterate:                    Iterating over a directory.
* ext2fs_expand_dir:                     Creating and expanding directories.
* ext2fs_fast_mark_block_bitmap:         Bitmap Operations.
* ext2fs_fast_mark_inode_bitmap:         Bitmap Operations.
* ext2fs_fast_test_block_bitmap:         Bitmap Operations.
* ext2fs_fast_test_inode_bitmap:         Bitmap Operations.
* ext2fs_fast_unmark_block_bitmap:       Bitmap Operations.
* ext2fs_fast_unmark_inode_bitmap:       Bitmap Operations.
* ext2fs_flush:                          Closing and flushing out changes.
* ext2fs_follow_link:                    Looking up filenames.
* ext2fs_free:                           Closing and flushing out changes.
* ext2fs_free_block_bitmap:              Free bitmaps.
* ext2fs_free_dblist:                    Directory-block list management.
* ext2fs_free_generic_bitmap:            Free bitmaps.
* ext2fs_free_icount:                    Inode count functions.
* ext2fs_free_inode_bitmap:              Free bitmaps.
* ext2fs_fudge_block_bitmap_end:         Modifying Bitmaps.
* ext2fs_fudge_inode_bitmap_end:         Modifying Bitmaps.
* ext2fs_get_block_bitmap_end:           Bitmap Operations.
* ext2fs_get_block_bitmap_start:         Bitmap Operations.
* ext2fs_get_blocks:                     Inode Convenience Functions.
* ext2fs_get_device_size:                Other functions.
* ext2fs_get_free_blocks:                Other functions.
* ext2fs_get_icount_size:                Inode count functions.
* ext2fs_get_inode_bitmap_end:           Bitmap Operations.
* ext2fs_get_inode_bitmap_start:         Bitmap Operations.
* ext2fs_get_library_version:            Other functions.
* ext2fs_get_next_inode:                 Iterating over inodes in a filesystem.
* ext2fs_get_pathname:                   Translating inode numbers to filenames.
* ext2fs_group_of_blk:                   Other functions.
* ext2fs_group_of_ino:                   Other functions.
* ext2fs_icount_decrement:               Inode count functions.
* ext2fs_icount_fetch:                   Inode count functions.
* ext2fs_icount_increment:               Inode count functions.
* ext2fs_icount_store:                   Inode count functions.
* ext2fs_icount_validate:                Inode count functions.
* ext2fs_init_dblist:                    Directory-block list management.
* ext2fs_initialize:                     Initializing a filesystem.
* ext2fs_inode_scan_flags:               Iterating over inodes in a filesystem.
* ext2fs_inode_scan_goto_blockgroup:     Iterating over inodes in a filesystem.
* ext2fs_link:                           Creating and removing directory entries.
* ext2fs_lookup:                         Looking up filenames.
* ext2fs_mark_bb_dirty:                  Filesystem flag functions.
* ext2fs_mark_block_bitmap:              Bitmap Operations.
* ext2fs_mark_changed:                   Filesystem flag functions.
* ext2fs_mark_ib_dirty:                  Filesystem flag functions.
* ext2fs_mark_inode_bitmap:              Bitmap Operations.
* ext2fs_mark_super_dirty:               Filesystem flag functions.
* ext2fs_mark_valid:                     Filesystem flag functions.
* ext2fs_mkdir:                          Creating and expanding directories.
* ext2fs_namei:                          Looking up filenames.
* ext2fs_namei_follow:                   Looking up filenames.
* ext2fs_native_flag:                    Byte-swapping functions.
* ext2fs_new_block:                      Other functions.
* ext2fs_new_dir_block:                  Directory block functions.
* ext2fs_new_inode:                      Other functions.
* ext2fs_open:                           Opening an ext2 filesystem.
* ext2fs_open_inode_scan:                Iterating over inodes in a filesystem.
* ext2fs_parse_version_string:           Other functions.
* ext2fs_read_bb_FILE:                   Badblocks list management.
* ext2fs_read_bb_inode:                  Badblocks list management.
* ext2fs_read_bitmaps:                   Reading and Writing Bitmaps.
* ext2fs_read_block_bitmap:              Reading and Writing Bitmaps.
* ext2fs_read_dir_block:                 Directory block functions.
* ext2fs_read_inode:                     Reading and writing inodes.
* ext2fs_read_inode_bitmap:              Reading and Writing Bitmaps.
* ext2fs_resize_block_bitmap:            Resizing Bitmaps.
* ext2fs_resize_generic_bitmap:          Resizing Bitmaps.
* ext2fs_resize_inode_bitmap:            Resizing Bitmaps.
* ext2fs_set_dir_block:                  Directory-block list management.
* ext2fs_set_inode_callback:             Iterating over inodes in a filesystem.
* ext2fs_swap_group_desc:                Byte-swapping functions.
* ext2fs_swap_inode:                     Byte-swapping functions.
* ext2fs_swap_super:                     Byte-swapping functions.
* ext2fs_test_bb_dirty:                  Filesystem flag functions.
* ext2fs_test_block_bitmap:              Bitmap Operations.
* ext2fs_test_changed:                   Filesystem flag functions.
* ext2fs_test_ib_dirty:                  Filesystem flag functions.
* ext2fs_test_inode_bitmap:              Bitmap Operations.
* ext2fs_test_valid:                     Filesystem flag functions.
* ext2fs_unlink:                         Creating and removing directory entries.
* ext2fs_unmark_block_bitmap:            Bitmap Operations.
* ext2fs_unmark_inode_bitmap:            Bitmap Operations.
* ext2fs_unmark_valid:                   Filesystem flag functions.
* ext2fs_update_bb_inode:                Badblocks list management.
* ext2fs_write_bitmaps:                  Reading and Writing Bitmaps.
* ext2fs_write_block_bitmap:             Reading and Writing Bitmaps.
* ext2fs_write_dir_block:                Directory block functions.
* ext2fs_write_inode:                    Reading and writing inodes.
* ext2fs_write_inode_bitmap:             Reading and Writing Bitmaps.



Tag Table:
Node: Top1033
Node: Introduction to the EXT2FS Library1352
Node: EXT2FS Library Functions1643
Node: Filesystem-level functions2007
Node: Opening an ext2 filesystem2751
Node: Closing and flushing out changes4784
Node: Initializing a filesystem5788
Node: Filesystem flag functions10961
Node: Inode Functions12746
Node: Reading and writing inodes13074
Node: Iterating over inodes in a filesystem13576
Node: Iterating over blocks in an inode16048
Node: Inode Convenience Functions16767
Node: Directory functions17636
Node: Directory block functions18031
Node: Iterating over a directory18555
Node: Creating and expanding directories19018
Node: Creating and removing directory entries19468
Node: Looking up filenames19969
Node: Translating inode numbers to filenames20747
Node: Bitmap Functions21068
Node: Reading and Writing Bitmaps21432
Node: Allocating Bitmaps22013
Node: Free bitmaps22595
Node: Bitmap Operations22980
Node: Comparing bitmaps25366
Node: Modifying Bitmaps25754
Node: Resizing Bitmaps26159
Node: Clearing Bitmaps26690
Node: EXT2 data abstractions26970
Node: Badblocks list management27356
Node: Directory-block list management28611
Node: Inode count functions30809
Node: Byte-swapping functions33744
Node: Other functions34249
Node: Concept Index36438
Node: Function Index36587

End Tag Table
