summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/efs_fs.h (renamed from include/linux/efs.h)41
-rw-r--r--include/linux/efs_fs_i.h (renamed from include/linux/efs_inode.h)68
-rw-r--r--include/linux/efs_fs_sb.h (renamed from include/linux/efs_super.h)29
3 files changed, 63 insertions, 75 deletions
diff --git a/include/linux/efs.h b/include/linux/efs_fs.h
index 340a0b2f1..98b0181ee 100644
--- a/include/linux/efs.h
+++ b/include/linux/efs_fs.h
@@ -1,13 +1,17 @@
/*
- * efs.h
+ * efs_fs.h
*
* Copyright (c) 1999 Al Smith
*
* Portions derived from work (c) 1995,1996 Christian Vogelgsang.
*/
-#ifndef __EFS_H__
-#define __EFS_H__
+#ifndef __EFS_FS_H__
+#define __EFS_FS_H__
+
+#define VERSION "0.97"
+
+static const char cprt[] = "EFS: version "VERSION" - (c) 1999 Al Smith <Al.Smith@aeschi.ch.eu.org>";
#include <linux/stat.h>
#include <linux/sched.h>
@@ -25,10 +29,11 @@
#include <asm/uaccess.h>
#include <asm/byteorder.h>
-#include "efs_vh.h"
-#include "efs_super.h"
-#include "efs_inode.h"
-#include "efs_dir.h"
+#define EFS_BLOCKSIZE 512
+#define EFS_BLOCKSIZE_BITS 9
+
+#include <linux/efs_fs_i.h>
+#include <linux/efs_dir.h>
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
@@ -37,14 +42,20 @@
#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];
+/* 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;
@@ -61,5 +72,7 @@ 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__ */
+extern int init_efs_fs(void);
+
+#endif /* __EFS_FS_H__ */
diff --git a/include/linux/efs_inode.h b/include/linux/efs_fs_i.h
index eb61c941e..60e21fc6f 100644
--- a/include/linux/efs_inode.h
+++ b/include/linux/efs_fs_i.h
@@ -1,66 +1,32 @@
/*
- * efs_ino.h
+ * efs_fs_i.h
*
* Copyright (c) 1999 Al Smith
*
* Portions derived from IRIX header files (c) 1988 Silicon Graphics
*/
-#ifndef __EFS_INO_
-#define __EFS_INO_
+#ifndef __EFS_FS_I_H__
+#define __EFS_FS_I_H__
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;
+#define EFS_DIRECTEXTENTS 12
/*
* layout of an extent, in memory and on disk. 8 bytes exactly
*/
-typedef struct extent {
- union extent1 u1;
- union extent2 u2;
+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;
-#define EFS_DIRECTEXTENTS 12
-
/*
* extent based filesystem inode as it appears on disk. The efs inode
* is exactly 128 bytes long.
@@ -84,5 +50,13 @@ struct efs_dinode {
} di_u;
};
-#endif /* __EFS_INO_ */
+/* 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_super.h b/include/linux/efs_fs_sb.h
index b840abcc4..2b651820e 100644
--- a/include/linux/efs_super.h
+++ b/include/linux/efs_fs_sb.h
@@ -1,13 +1,13 @@
/*
- * efs_super.h
+ * efs_fs_sb.h
*
* Copyright (c) 1999 Al Smith
*
* Portions derived from IRIX header files (c) 1988 Silicon Graphics
*/
-#ifndef __EFS_SUPER_H__
-#define __EFS_SUPER_H__
+#ifndef __EFS_FS_SB_H__
+#define __EFS_FS_SB_H__
/* statfs() magic number for EFS */
#define EFS_SUPER_MAGIC 0x414A83
@@ -20,10 +20,9 @@
#define EFS_SUPER 1
#define EFS_ROOTINODE 2
-#define EFS_BLOCKSIZE 512
-#define EFS_BLOCKSIZE_BITS 9
-struct efs {
+/* 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 */
@@ -46,16 +45,18 @@ struct efs {
int32_t fs_checksum; /* checksum of volume portion of fs */
};
-/* efs superblock information */
-struct efs_spb {
- int32_t fs_magic; /* first block of filesystem */
+/* 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 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 */
+ 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_SUPER_H__ */
+#endif /* __EFS_FS_SB_H__ */