From ae7b6b442dd0b4578271a10c9bdd5886e0ee51af Mon Sep 17 00:00:00 2001 From: Al Smith Date: Wed, 31 Mar 1999 11:25:39 +0000 Subject: Updated efs files for efs-0.97. --- include/linux/efs.h | 65 ---------------------------------- include/linux/efs_fs.h | 78 +++++++++++++++++++++++++++++++++++++++++ include/linux/efs_fs_i.h | 62 +++++++++++++++++++++++++++++++++ include/linux/efs_fs_sb.h | 62 +++++++++++++++++++++++++++++++++ include/linux/efs_inode.h | 88 ----------------------------------------------- include/linux/efs_super.h | 61 -------------------------------- 6 files changed, 202 insertions(+), 214 deletions(-) delete mode 100644 include/linux/efs.h create mode 100644 include/linux/efs_fs.h create mode 100644 include/linux/efs_fs_i.h create mode 100644 include/linux/efs_fs_sb.h delete mode 100644 include/linux/efs_inode.h delete mode 100644 include/linux/efs_super.h (limited to 'include/linux') diff --git a/include/linux/efs.h b/include/linux/efs.h deleted file mode 100644 index 340a0b2f1..000000000 --- a/include/linux/efs.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * efs.h - * - * Copyright (c) 1999 Al Smith - * - * Portions derived from work (c) 1995,1996 Christian Vogelgsang. - */ - -#ifndef __EFS_H__ -#define __EFS_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "efs_vh.h" -#include "efs_super.h" -#include "efs_inode.h" -#include "efs_dir.h" - -#ifndef MIN -#define MIN(a,b) ((a)<(b)?(a):(b)) -#endif -#ifndef MAX -#define MAX(a,b) ((a)>(b)?(a):(b)) -#endif - -/* private inode storage */ -struct efs_in_info { - int numextents; - int lastextent; - - efs_extent extents[EFS_DIRECTEXTENTS]; -}; - -extern struct inode_operations efs_dir_inode_operations; -extern struct inode_operations efs_file_inode_operations; -extern struct inode_operations efs_symlink_inode_operations; - -extern int init_module(void); -extern void cleanup_module(void); -extern struct super_block *efs_read_super(struct super_block *, void *, int); -extern void efs_put_super(struct super_block *); -extern int efs_statfs(struct super_block *, struct statfs *, int); - -extern void efs_read_inode(struct inode *); -extern efs_block_t efs_read_block(struct inode *, efs_block_t); - -extern int efs_lookup(struct inode *, struct dentry *); -extern int efs_bmap(struct inode *, int); - -#endif /* __EFS_H__ */ - diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h new file mode 100644 index 000000000..98b0181ee --- /dev/null +++ b/include/linux/efs_fs.h @@ -0,0 +1,78 @@ +/* + * efs_fs.h + * + * Copyright (c) 1999 Al Smith + * + * Portions derived from work (c) 1995,1996 Christian Vogelgsang. + */ + +#ifndef __EFS_FS_H__ +#define __EFS_FS_H__ + +#define VERSION "0.97" + +static const char cprt[] = "EFS: version "VERSION" - (c) 1999 Al Smith "; + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define EFS_BLOCKSIZE 512 +#define EFS_BLOCKSIZE_BITS 9 + +#include +#include + +#ifndef MIN +#define MIN(a,b) ((a)<(b)?(a):(b)) +#endif +#ifndef MAX +#define MAX(a,b) ((a)>(b)?(a):(b)) +#endif + +/* efs superblock information in memory */ +struct efs_spb { + int32_t fs_magic; /* superblock magic number */ + int32_t fs_start; /* first block of filesystem */ + int32_t first_block; /* first data block in filesystem */ + int32_t total_blocks; /* total number of blocks in filesystem */ + int32_t group_size; /* # of blocks a group consists of */ + int32_t data_free; /* # of free data blocks */ + int32_t inode_free; /* # of free inodes */ + short inode_blocks; /* # of blocks used for inodes in every grp */ + short total_groups; /* # of groups */ +}; + + +extern struct inode_operations efs_dir_inode_operations; +extern struct inode_operations efs_file_inode_operations; +extern struct inode_operations efs_symlink_inode_operations; + +extern int init_module(void); +extern void cleanup_module(void); +extern struct super_block *efs_read_super(struct super_block *, void *, int); +extern void efs_put_super(struct super_block *); +extern int efs_statfs(struct super_block *, struct statfs *, int); + +extern void efs_read_inode(struct inode *); +extern efs_block_t efs_read_block(struct inode *, efs_block_t); + +extern int efs_lookup(struct inode *, struct dentry *); +extern int efs_bmap(struct inode *, int); + +extern int init_efs_fs(void); + +#endif /* __EFS_FS_H__ */ + diff --git a/include/linux/efs_fs_i.h b/include/linux/efs_fs_i.h new file mode 100644 index 000000000..60e21fc6f --- /dev/null +++ b/include/linux/efs_fs_i.h @@ -0,0 +1,62 @@ +/* + * efs_fs_i.h + * + * Copyright (c) 1999 Al Smith + * + * Portions derived from IRIX header files (c) 1988 Silicon Graphics + */ + +#ifndef __EFS_FS_I_H__ +#define __EFS_FS_I_H__ + +typedef int32_t efs_block_t; +typedef uint32_t efs_ino_t; + +#define EFS_DIRECTEXTENTS 12 + +/* + * layout of an extent, in memory and on disk. 8 bytes exactly + */ +typedef union extent_u { + struct extent_s { + unsigned int ex_magic:8; /* magic # (zero) */ + unsigned int ex_bn:24; /* basic block */ + unsigned int ex_length:8; /* numblocks in this extent */ + unsigned int ex_offset:24; /* logical offset into file */ + } cooked; + unsigned char raw[8]; +} efs_extent; + +/* + * extent based filesystem inode as it appears on disk. The efs inode + * is exactly 128 bytes long. + */ +struct efs_dinode { + u_short di_mode; /* mode and type of file */ + short di_nlink; /* number of links to file */ + u_short di_uid; /* owner's user id */ + u_short di_gid; /* owner's group id */ + int32_t di_size; /* number of bytes in file */ + int32_t di_atime; /* time last accessed */ + int32_t di_mtime; /* time last modified */ + int32_t di_ctime; /* time created */ + uint32_t di_gen; /* generation number */ + short di_numextents; /* # of extents */ + u_char di_version; /* version of inode */ + u_char di_spare; /* spare - used by AFS */ + union di_addr { + efs_extent di_extents[EFS_DIRECTEXTENTS]; + dev_t di_dev; /* device for IFCHR/IFBLK */ + } di_u; +}; + +/* efs inode storage in memory */ +struct efs_inode_info { + int numextents; + int lastextent; + + efs_extent extents[EFS_DIRECTEXTENTS]; +}; + +#endif /* __EFS_FS_I_H__ */ + diff --git a/include/linux/efs_fs_sb.h b/include/linux/efs_fs_sb.h new file mode 100644 index 000000000..2b651820e --- /dev/null +++ b/include/linux/efs_fs_sb.h @@ -0,0 +1,62 @@ +/* + * efs_fs_sb.h + * + * Copyright (c) 1999 Al Smith + * + * Portions derived from IRIX header files (c) 1988 Silicon Graphics + */ + +#ifndef __EFS_FS_SB_H__ +#define __EFS_FS_SB_H__ + +/* statfs() magic number for EFS */ +#define EFS_SUPER_MAGIC 0x414A83 + +/* EFS superblock magic numbers */ +#define EFS_MAGIC 0x072959 +#define EFS_NEWMAGIC 0x07295a + +#define IS_EFS_MAGIC(x) ((x == EFS_MAGIC) || (x == EFS_NEWMAGIC)) + +#define EFS_SUPER 1 +#define EFS_ROOTINODE 2 + +/* efs superblock on disk */ +struct efs_super { + int32_t fs_size; /* size of filesystem, in sectors */ + int32_t fs_firstcg; /* bb offset to first cg */ + int32_t fs_cgfsize; /* size of cylinder group in bb's */ + short fs_cgisize; /* bb's of inodes per cylinder group */ + short fs_sectors; /* sectors per track */ + short fs_heads; /* heads per cylinder */ + short fs_ncg; /* # of cylinder groups in filesystem */ + short fs_dirty; /* fs needs to be fsck'd */ + int32_t fs_time; /* last super-block update */ + int32_t fs_magic; /* magic number */ + char fs_fname[6]; /* file system name */ + char fs_fpack[6]; /* file system pack name */ + int32_t fs_bmsize; /* size of bitmap in bytes */ + int32_t fs_tfree; /* total free data blocks */ + int32_t fs_tinode; /* total free inodes */ + int32_t fs_bmblock; /* bitmap location. */ + int32_t fs_replsb; /* Location of replicated superblock. */ + int32_t fs_lastialloc; /* last allocated inode */ + char fs_spare[20]; /* space for expansion - MUST BE ZERO */ + int32_t fs_checksum; /* checksum of volume portion of fs */ +}; + +/* efs superblock information in memory */ +struct efs_sb_info { + int32_t fs_magic; /* superblock magic number */ + int32_t fs_start; /* first block of filesystem */ + int32_t first_block; /* first data block in filesystem */ + int32_t total_blocks; /* total number of blocks in filesystem */ + int32_t group_size; /* # of blocks a group consists of */ + int32_t data_free; /* # of free data blocks */ + int32_t inode_free; /* # of free inodes */ + short inode_blocks; /* # of blocks used for inodes in every grp */ + short total_groups; /* # of groups */ +}; + +#endif /* __EFS_FS_SB_H__ */ + diff --git a/include/linux/efs_inode.h b/include/linux/efs_inode.h deleted file mode 100644 index eb61c941e..000000000 --- a/include/linux/efs_inode.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * efs_ino.h - * - * Copyright (c) 1999 Al Smith - * - * Portions derived from IRIX header files (c) 1988 Silicon Graphics - */ - -#ifndef __EFS_INO_ -#define __EFS_INO_ - -typedef int32_t efs_block_t; -typedef uint32_t efs_ino_t; - -/* this is very icky */ -union extent1 { -#ifdef __LITTLE_ENDIAN - struct s1 { - unsigned int ex_bn:24; /* basic block # */ - unsigned int ex_magic:8; /* magic # (zero) */ - } s; -#else -#ifdef __BIG_ENDIAN - struct s1 { - unsigned int ex_magic:8; /* magic # (zero) */ - unsigned int ex_bn:24; /* basic block # */ - } s; -#else -#error system endianness is undefined -#endif -#endif - unsigned long l; -} extent1; - -union extent2 { -#ifdef __LITTLE_ENDIAN - struct s2 { - unsigned int ex_offset:24; /* logical bb offset into file */ - unsigned int ex_length:8; /* numblocks in this extent */ - } s; -#else -#ifdef __BIG_ENDIAN - struct s2 { - unsigned int ex_length:8; /* numblocks in this extent */ - unsigned int ex_offset:24; /* logical bb offset into file */ - } s; -#else -#error system endianness is undefined -#endif -#endif - unsigned long l; -} extent2; - -/* - * layout of an extent, in memory and on disk. 8 bytes exactly - */ -typedef struct extent { - union extent1 u1; - union extent2 u2; -} efs_extent; - -#define EFS_DIRECTEXTENTS 12 - -/* - * extent based filesystem inode as it appears on disk. The efs inode - * is exactly 128 bytes long. - */ -struct efs_dinode { - u_short di_mode; /* mode and type of file */ - short di_nlink; /* number of links to file */ - u_short di_uid; /* owner's user id */ - u_short di_gid; /* owner's group id */ - int32_t di_size; /* number of bytes in file */ - int32_t di_atime; /* time last accessed */ - int32_t di_mtime; /* time last modified */ - int32_t di_ctime; /* time created */ - uint32_t di_gen; /* generation number */ - short di_numextents; /* # of extents */ - u_char di_version; /* version of inode */ - u_char di_spare; /* spare - used by AFS */ - union di_addr { - efs_extent di_extents[EFS_DIRECTEXTENTS]; - dev_t di_dev; /* device for IFCHR/IFBLK */ - } di_u; -}; - -#endif /* __EFS_INO_ */ - diff --git a/include/linux/efs_super.h b/include/linux/efs_super.h deleted file mode 100644 index b840abcc4..000000000 --- a/include/linux/efs_super.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * efs_super.h - * - * Copyright (c) 1999 Al Smith - * - * Portions derived from IRIX header files (c) 1988 Silicon Graphics - */ - -#ifndef __EFS_SUPER_H__ -#define __EFS_SUPER_H__ - -/* statfs() magic number for EFS */ -#define EFS_SUPER_MAGIC 0x414A83 - -/* EFS superblock magic numbers */ -#define EFS_MAGIC 0x072959 -#define EFS_NEWMAGIC 0x07295a - -#define IS_EFS_MAGIC(x) ((x == EFS_MAGIC) || (x == EFS_NEWMAGIC)) - -#define EFS_SUPER 1 -#define EFS_ROOTINODE 2 -#define EFS_BLOCKSIZE 512 -#define EFS_BLOCKSIZE_BITS 9 - -struct efs { - int32_t fs_size; /* size of filesystem, in sectors */ - int32_t fs_firstcg; /* bb offset to first cg */ - int32_t fs_cgfsize; /* size of cylinder group in bb's */ - short fs_cgisize; /* bb's of inodes per cylinder group */ - short fs_sectors; /* sectors per track */ - short fs_heads; /* heads per cylinder */ - short fs_ncg; /* # of cylinder groups in filesystem */ - short fs_dirty; /* fs needs to be fsck'd */ - int32_t fs_time; /* last super-block update */ - int32_t fs_magic; /* magic number */ - char fs_fname[6]; /* file system name */ - char fs_fpack[6]; /* file system pack name */ - int32_t fs_bmsize; /* size of bitmap in bytes */ - int32_t fs_tfree; /* total free data blocks */ - int32_t fs_tinode; /* total free inodes */ - int32_t fs_bmblock; /* bitmap location. */ - int32_t fs_replsb; /* Location of replicated superblock. */ - int32_t fs_lastialloc; /* last allocated inode */ - char fs_spare[20]; /* space for expansion - MUST BE ZERO */ - int32_t fs_checksum; /* checksum of volume portion of fs */ -}; - -/* efs superblock information */ -struct efs_spb { - int32_t fs_magic; /* first block of filesystem */ - int32_t fs_start; /* first block of filesystem */ - int32_t total_blocks; /* total number of blocks in filesystem */ - int32_t first_block; /* first data block in filesystem */ - int32_t group_size; /* number of blocks a group consists of */ - short inode_blocks; /* number of blocks used for inodes in every grp */ - short total_groups; /* number of groups */ -}; - -#endif /* __EFS_SUPER_H__ */ - -- cgit v1.2.3