#define ROOT_INO 1
+/*
+ * Global variables used in minix_programs.h inline fuctions
+ */
+int fs_version = 1;
+char *super_block_buffer;
+
+
+static char *inode_buffer = NULL;
+
+#define Inode (((struct minix_inode *) inode_buffer) - 1)
+#define Inode2 (((struct minix2_inode *) inode_buffer) - 1)
+
+static char *inode_map;
+static char *zone_map;
+
static char * program_name = "fsck.minix";
static char * device_name = NULL;
static int IN;
/*
* Global variables.
*/
-static int fs_version = 1; /* this default value needs to change in a near future */
+extern int fs_version;
+extern char *super_block_buffer;
-static char *super_block_buffer;
-static char *inode_buffer = NULL;
+#define Super (*(struct minix_super_block *) super_block_buffer)
+#define Super3 (*(struct minix3_super_block *) super_block_buffer)
-static char *inode_map;
-static char *zone_map;
+#define INODE_SIZE (sizeof(struct minix_inode))
+#define INODE2_SIZE (sizeof(struct minix2_inode))
+
+#define BITS_PER_BLOCK (MINIX_BLOCK_SIZE << 3)
+
+#define UPPER(size,n) ((size+((n)-1))/(n))
/*
* Inline functions.
#define MAX_INODES 65535
+/*
+ * Global variables used in minix_programs.h inline fuctions
+ */
+int fs_version = 1;
+char *super_block_buffer;
+
+static char *inode_buffer = NULL;
+
+#define Inode (((struct minix_inode *) inode_buffer) - 1)
+#define Inode2 (((struct minix2_inode *) inode_buffer) - 1)
+
+static char *inode_map;
+static char *zone_map;
+
static char * program_name = "mkfs";
static char * device_name = NULL;
static int DEV = -1;
static char root_block[MINIX_BLOCK_SIZE] = "\0";
static char boot_block_buffer[512];
-#define Super (*(struct minix_super_block *)super_block_buffer)
static unsigned short good_blocks_table[MAX_GOOD_BLOCKS];
static int used_good_blocks = 0;
#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
#define MINIX3_SUPER_MAGIC 0x4d5a /* minix V3 fs (60 char names) */
-#define Inode (((struct minix_inode *) inode_buffer)-1)
-#define Inode2 (((struct minix2_inode *) inode_buffer)-1)
-
-#define INODE_SIZE (sizeof(struct minix_inode))
-#define INODE2_SIZE (sizeof(struct minix2_inode))
-
-#define BITS_PER_BLOCK (MINIX_BLOCK_SIZE<<3)
-
-#define UPPER(size,n) ((size+((n)-1))/(n))
-
-/*
- * wrappers to different superblock attributes
- */
-#define Super (*(struct minix_super_block *)super_block_buffer)
-#define Super3 (*(struct minix3_super_block *)super_block_buffer)
-
#endif /* UTIL_LINUX_MINIX_H */