22db14d54b
Minimize differencies between our ext2fs headers and relevant Linux versions by using EXT2_SB macro to access the superblock fields. Most of the differencies in access to these fields are now hidden inside this macro. - Rename the s_db_per_group field of ext2fs_sb_info to s_gdb_count to reflect the similar change in Linux headers. New name also seem to be more appropriate for this field. - Use proper types for s_first_inode and s_inode_size in-core superblock fields. Now they reflec types used in the on-disk superblock version. - Add support for older filesystem revisions that doesn't have proper s_first_ino and s_inode_size fields in the on-disk superblock. In these cases predefined values for these fields are used. - Add simple sanity checks for s_first_inode and s_inode_size correctness. Reviewed by: bde (previous version) MFC after: 2 weeks
101 lines
3.5 KiB
C
101 lines
3.5 KiB
C
/*-
|
|
* modified for EXT2FS support in Lites 1.1
|
|
*
|
|
* Aug 1995, Godmar Back (gback@cs.utah.edu)
|
|
* University of Utah, Department of Computer Science
|
|
*
|
|
* $FreeBSD$
|
|
*/
|
|
/*-
|
|
* linux/include/linux/ext2_fs_sb.h
|
|
*
|
|
* Copyright (C) 1992, 1993, 1994, 1995
|
|
* Remy Card (card@masi.ibp.fr)
|
|
* Laboratoire MASI - Institut Blaise Pascal
|
|
* Universite Pierre et Marie Curie (Paris VI)
|
|
*
|
|
* from
|
|
*
|
|
* linux/include/linux/minix_fs_sb.h
|
|
*
|
|
* Copyright (C) 1991, 1992 Linus Torvalds
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*
|
|
*/
|
|
|
|
#ifndef _LINUX_EXT2_FS_SB
|
|
#define _LINUX_EXT2_FS_SB
|
|
|
|
/*
|
|
* The following is not needed anymore since the descriptors buffer
|
|
* heads are now dynamically allocated
|
|
*/
|
|
/* #define EXT2_MAX_GROUP_DESC 8 */
|
|
|
|
#define EXT2_MAX_GROUP_LOADED 8
|
|
|
|
#define buffer_head buf
|
|
#define MAXMNTLEN 512
|
|
|
|
/*
|
|
* second extended-fs super-block data in memory
|
|
*/
|
|
struct ext2_sb_info {
|
|
unsigned long s_frag_size; /* Size of a fragment in bytes */
|
|
unsigned long s_frags_per_block;/* Number of fragments per block */
|
|
unsigned long s_inodes_per_block;/* Number of inodes per block */
|
|
unsigned long s_frags_per_group;/* Number of fragments in a group */
|
|
unsigned long s_blocks_per_group;/* Number of blocks in a group */
|
|
unsigned long s_inodes_per_group;/* Number of inodes in a group */
|
|
unsigned long s_itb_per_group; /* Number of inode table blocks per group */
|
|
unsigned long s_gdb_count; /* Number of group descriptor blocks */
|
|
unsigned long s_desc_per_block; /* Number of group descriptors per block */
|
|
unsigned long s_groups_count; /* Number of groups in the fs */
|
|
struct buffer_head * s_sbh; /* Buffer containing the super block */
|
|
struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */
|
|
struct buffer_head ** s_group_desc;
|
|
unsigned short s_loaded_inode_bitmaps;
|
|
unsigned short s_loaded_block_bitmaps;
|
|
unsigned long s_inode_bitmap_number[EXT2_MAX_GROUP_LOADED];
|
|
struct buffer_head * s_inode_bitmap[EXT2_MAX_GROUP_LOADED];
|
|
unsigned long s_block_bitmap_number[EXT2_MAX_GROUP_LOADED];
|
|
struct buffer_head * s_block_bitmap[EXT2_MAX_GROUP_LOADED];
|
|
unsigned long s_mount_opt;
|
|
#ifdef notyet
|
|
uid_t s_resuid;
|
|
gid_t s_resgid;
|
|
#endif
|
|
unsigned short s_inode_size;
|
|
unsigned int s_first_ino;
|
|
unsigned short s_mount_state;
|
|
/*
|
|
stuff that FFS keeps in its super block or that linux
|
|
has in its non-ext2 specific super block and which is
|
|
generally considered useful
|
|
*/
|
|
unsigned long s_blocksize;
|
|
unsigned long s_blocksize_bits;
|
|
unsigned int s_bshift; /* = log2(s_blocksize) */
|
|
quad_t s_qbmask; /* = s_blocksize - 1 */
|
|
unsigned int s_fsbtodb; /* shift to get disk block */
|
|
char s_rd_only; /* read-only */
|
|
char s_dirt; /* fs modified flag */
|
|
char s_wasvalid; /* valid at mount time */
|
|
off_t fs_maxfilesize;
|
|
char fs_fsmnt[MAXMNTLEN]; /* name mounted on */
|
|
};
|
|
|
|
#endif /* _LINUX_EXT2_FS_SB */
|