diff options
author | Sami Kerola | 2011-07-20 20:28:55 +0200 |
---|---|---|
committer | Sami Kerola | 2011-07-20 20:43:16 +0200 |
commit | 7cc112d92704211654d0447877dc9759fadea660 (patch) | |
tree | ea7d31c4c7f1c660645a165072254db37464f2ad /include/minix.h | |
parent | libblkid: use MINIX_BLOCK_SIZE from minix.h (diff) | |
download | kernel-qcow2-util-linux-7cc112d92704211654d0447877dc9759fadea660.tar.gz kernel-qcow2-util-linux-7cc112d92704211654d0447877dc9759fadea660.tar.xz kernel-qcow2-util-linux-7cc112d92704211654d0447877dc9759fadea660.zip |
minix: move globals and inline functions to minix_programs.h
Global variables and inline functions are moved from minix.h to
minix_programs.h which is included in mkfs.minix and fsck.minix.
The minix.h will have only struct definitions etc generic
contents which is reasonable to share with utilities and
libraries.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'include/minix.h')
-rw-r--r-- | include/minix.h | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/include/minix.h b/include/minix.h index 7ef6eecb0..d89fc2ad9 100644 --- a/include/minix.h +++ b/include/minix.h @@ -79,12 +79,6 @@ struct minix3_super_block { #define INODE_SIZE (sizeof(struct minix_inode)) #define INODE2_SIZE (sizeof(struct minix2_inode)) -int fs_version = 1; /* this default value needs to change in a near future */ -char *super_block_buffer, *inode_buffer = NULL; - -static char *inode_map; -static char *zone_map; - #define BITS_PER_BLOCK (MINIX_BLOCK_SIZE<<3) #define UPPER(size,n) ((size+((n)-1))/(n)) @@ -95,97 +89,4 @@ static char *zone_map; #define Super (*(struct minix_super_block *)super_block_buffer) #define Super3 (*(struct minix3_super_block *)super_block_buffer) -static inline unsigned long get_ninodes(void) -{ - switch (fs_version) { - case 3: - return Super3.s_ninodes; - default: - return (unsigned long) Super.s_ninodes; - } -} - -static inline unsigned long get_nzones(void) -{ - switch (fs_version) { - case 3: - return (unsigned long) Super3.s_zones; - case 2: - return (unsigned long) Super.s_zones; - default: - return (unsigned long) Super.s_nzones; - } -} - -static inline unsigned long get_nimaps(void) -{ - switch (fs_version) { - case 3: - return (unsigned long) Super3.s_imap_blocks; - default: - return (unsigned long) Super.s_imap_blocks; - } -} - -static inline unsigned long get_nzmaps(void) -{ - switch (fs_version) { - case 3: - return (unsigned long) Super3.s_zmap_blocks; - default: - return (unsigned long) Super.s_zmap_blocks; - } -} - -static inline unsigned long get_first_zone(void) -{ - switch (fs_version) { - case 3: - return (unsigned long) Super3.s_firstdatazone; - default: - return (unsigned long) Super.s_firstdatazone; - } -} - -static inline unsigned long get_zone_size(void) -{ - switch (fs_version) { - case 3: - return (unsigned long) Super3.s_log_zone_size; - default: - return (unsigned long) Super.s_log_zone_size; - } -} - -static inline unsigned long get_max_size(void) -{ - switch (fs_version) { - case 3: - return (unsigned long) Super3.s_max_size; - default: - return (unsigned long) Super.s_max_size; - } -} - -static unsigned long inode_blocks(void) -{ - switch (fs_version) { - case 3: - case 2: - return UPPER(get_ninodes(), MINIX2_INODES_PER_BLOCK); - default: - return UPPER(get_ninodes(), MINIX_INODES_PER_BLOCK); - } -} - -static inline unsigned long first_zone_data(void) -{ - return 2 + get_nimaps() + get_nzmaps() + inode_blocks(); -} - -static inline unsigned long get_inode_buffer_size(void) -{ - return inode_blocks() * MINIX_BLOCK_SIZE; -} - #endif /* UTIL_LINUX_MINIX_H */ |