Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2434 → Rev 2435

/branches/fs/uspace/fs/super.h
32,23 → 32,18
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** @addtogroup FileSystemImpl
* @{
*/
 
 
/*
* The s_ninodes field gives the number of inodes available
* for files and directories, including the root directory. Inode 0 is
* on the disk, but not used. Thus s_ninodes = 4 means that 5 bits will be
* used in the bit map, bit 0, which is always 1 and not used, and bits 1-4
* for files and directories. The disk layout is:
*
* Item # blocks
* boot block 1
* super block 1
* inode map s_imap_blocks
* zone map s_zmap_blocks
* inodes (s_ninodes + 'inodes per block' - 1)/'inodes per block'
* unused whatever is needed to fill out the current zone
* data zones (s_zones - s_firstdatazone) << s_log_zone_size
/**
* @file super.h
* @brief The s_ninodes field gives the number of inodes available
* for files and directories, including the root directory. Inode 0 is
* on the disk, but not used. Thus s_ninodes = 4 means that 5 bits will be
* used in the bit map, bit 0, which is always 1 and not used, and bits 1-4
* for files and directories.
*
*/
56,31 → 51,48
#ifndef _SUPER_H
#define _SUPER_H
 
#define NIL_SUPER (super_block_t *) 0
#define NIL_SUPER (super_block_t *) 0 /**< An empty super block */
 
/**
* The disk layout is:
*
* Item # blocks
* boot block 1
* super block 1
* inode map s_imap_blocks
* zone map s_zmap_blocks
* inodes (s_ninodes + 'inodes per block' - 1)/'inodes per block'
* unused whatever is needed to fill out the current zone
* data zones (s_zones - s_firstdatazone) << s_log_zone_size
*/
typedef struct {
ino_t s_ninodes; /* # usable inodes on the minor device */
zone1_t s_nzones; /* total device size, including bit maps etc */
short s_imap_blocks; /* # of blocks used by inode bit map */
short s_zmap_blocks; /* # of blocks used by zone bit map */
zone1_t s_firstdatazone; /* number of first data zone */
short s_log_zone_size; /* log2 of blocks/zone */
offset_t s_max_size; /* maximum file size on this device */
short s_magic; /* magic number to recognize super-blocks */
short s_pad; /* try to avoid compiler-dependent padding */
zone_t s_zones; /* number of zones (replaces s_nzones in V2) */
ino_t s_ninodes; /**< # usable inodes on the minor device */
zone1_t s_nzones; /**< total device size, including bit maps etc */
short s_imap_blocks; /**< # of blocks used by inode bit map */
short s_zmap_blocks; /**< # of blocks used by zone bit map */
zone1_t s_firstdatazone; /**< number of first data zone */
short s_log_zone_size; /**< log2 of blocks/zone */
offset_t s_max_size; /**< maximum file size on this device */
short s_magic; /**< magic number to recognize super-blocks */
short s_pad; /**< try to avoid compiler-dependent padding */
zone_t s_zones; /**< number of zones (replaces s_nzones in V2) */
/* The following items are only used when the super_block is in memory. */
unsigned s_inodes_per_block; /* precalculated from magic number */
int s_native; /* set to 1 iff not byte swapped file system */
int s_version; /* file system version, zero means bad magic */
int s_extend; /* 1 if file system support 30 chars in file name */
int s_ndzones; /* # direct zones in an inode */
int s_nindirs; /* # indirect zones per indirect block */
bit_t s_isearch; /* inodes below this bit number are in use */
bit_t s_zsearch; /* all zones below this bit number are in use*/
unsigned s_inodes_per_block; /**< precalculated from magic number */
int s_native; /**< set to 1 iff not byte swapped file system */
int s_version; /**< file system version, zero means bad magic */
int s_extend; /**< 1 if file system support 30 chars in file name */
int s_ndzones; /**< # direct zones in an inode */
int s_nindirs; /**< # indirect zones per indirect block */
bit_t s_isearch; /**< inodes below this bit number are in use */
bit_t s_zsearch; /**< all zones below this bit number are in use*/
} super_block_t;
 
extern super_block_t* super_block;
extern super_block_t* super_block; /**< A variable to store the super block */
 
#endif /* _SUPER_H */
 
/**
* }
*/