diff options
Diffstat (limited to 'fsck_minix.c')
-rw-r--r-- | fsck_minix.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/fsck_minix.c b/fsck_minix.c index b35e6bb07..18841ec56 100644 --- a/fsck_minix.c +++ b/fsck_minix.c | |||
@@ -104,24 +104,24 @@ typedef unsigned short u16; | |||
104 | typedef unsigned int u32; | 104 | typedef unsigned int u32; |
105 | 105 | ||
106 | 106 | ||
107 | #define MINIX_ROOT_INO 1 | 107 | static const int MINIX_ROOT_INO = 1; |
108 | #define MINIX_LINK_MAX 250 | 108 | static const int MINIX_LINK_MAX = 250; |
109 | #define MINIX2_LINK_MAX 65530 | 109 | static const int MINIX2_LINK_MAX = 65530; |
110 | 110 | ||
111 | #define MINIX_I_MAP_SLOTS 8 | 111 | static const int MINIX_I_MAP_SLOTS = 8; |
112 | #define MINIX_Z_MAP_SLOTS 64 | 112 | static const int MINIX_Z_MAP_SLOTS = 64; |
113 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | 113 | static const int MINIX_SUPER_MAGIC = 0x137F; /* original minix fs */ |
114 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | 114 | static const int MINIX_SUPER_MAGIC2 = 0x138F; /* minix fs, 30 char names */ |
115 | #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ | 115 | static const int MINIX2_SUPER_MAGIC = 0x2468; /* minix V2 fs */ |
116 | #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ | 116 | static const int MINIX2_SUPER_MAGIC2 = 0x2478; /* minix V2 fs, 30 char names */ |
117 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ | 117 | static const int MINIX_VALID_FS = 0x0001; /* Clean fs. */ |
118 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ | 118 | static const int MINIX_ERROR_FS = 0x0002; /* fs has errors. */ |
119 | 119 | ||
120 | #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) | 120 | #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) |
121 | #define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode))) | 121 | #define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode))) |
122 | 122 | ||
123 | #define MINIX_V1 0x0001 /* original minix fs */ | 123 | static const int MINIX_V1 = 0x0001; /* original minix fs */ |
124 | #define MINIX_V2 0x0002 /* minix V2 fs */ | 124 | static const int MINIX_V2 = 0x0002; /* minix V2 fs */ |
125 | 125 | ||
126 | #define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version | 126 | #define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version |
127 | 127 | ||
@@ -185,12 +185,6 @@ struct minix_dir_entry { | |||
185 | 185 | ||
186 | #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) | 186 | #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) |
187 | 187 | ||
188 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ | ||
189 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ | ||
190 | |||
191 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | ||
192 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | ||
193 | |||
194 | #ifndef BLKGETSIZE | 188 | #ifndef BLKGETSIZE |
195 | #define BLKGETSIZE _IO(0x12,96) /* return device size */ | 189 | #define BLKGETSIZE _IO(0x12,96) /* return device size */ |
196 | #endif | 190 | #endif |
@@ -199,7 +193,7 @@ struct minix_dir_entry { | |||
199 | #define volatile | 193 | #define volatile |
200 | #endif | 194 | #endif |
201 | 195 | ||
202 | #define ROOT_INO 1 | 196 | static const int ROOT_INO = 1; |
203 | 197 | ||
204 | #define UPPER(size,n) ((size+((n)-1))/(n)) | 198 | #define UPPER(size,n) ((size+((n)-1))/(n)) |
205 | #define INODE_SIZE (sizeof(struct minix_inode)) | 199 | #define INODE_SIZE (sizeof(struct minix_inode)) |
@@ -231,7 +225,7 @@ static struct termios termios; | |||
231 | static int termios_set = 0; | 225 | static int termios_set = 0; |
232 | 226 | ||
233 | /* File-name data */ | 227 | /* File-name data */ |
234 | #define MAX_DEPTH 32 | 228 | static const int MAX_DEPTH = 32; |
235 | static int name_depth = 0; | 229 | static int name_depth = 0; |
236 | // static char name_list[MAX_DEPTH][BUFSIZ + 1]; | 230 | // static char name_list[MAX_DEPTH][BUFSIZ + 1]; |
237 | static char **name_list = NULL; | 231 | static char **name_list = NULL; |