From c1d26b19818b0caf2aff06f133a1cfa2d2442c61 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 21 Jul 2011 12:22:46 +0200 Subject: [PATCH] minix: add MINIX_ prefix to some global macros ... and remove some tailing whitespaces. Signed-off-by: Karel Zak --- disk-utils/fsck.minix.c | 12 ++++++------ disk-utils/mkfs.minix.c | 10 +++++----- include/minix.h | 13 +++++++------ 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/disk-utils/fsck.minix.c b/disk-utils/fsck.minix.c index ef474184b3..1bfd9d061d 100644 --- a/disk-utils/fsck.minix.c +++ b/disk-utils/fsck.minix.c @@ -48,7 +48,7 @@ * 01.07.96 - Fixed the v2 fs stuff to use the right #defines and such * for modern libcs (janl@math.uio.no, Nicolai Langfeldt) * - * 02.07.96 - Added C bit fiddling routines from rmk@ecs.soton.ac.uk + * 02.07.96 - Added C bit fiddling routines from rmk@ecs.soton.ac.uk * (Russell King). He made them for ARM. It would seem * that the ARM is powerful enough to do this in C whereas * i386 and m64k must use assembly to get it fast >:-) @@ -56,7 +56,7 @@ * (janl@math.uio.no, Nicolai Langfeldt) * * 04.11.96 - Added minor fixes from Andreas Schwab to avoid compiler - * warnings. Added mc68k bitops from + * warnings. Added mc68k bitops from * Joerg Dorchain . * * 06.11.96 - Added v2 code submitted by Joerg Dorchain, but written by @@ -86,7 +86,7 @@ * -f force filesystem check even if filesystem marked as valid * * The device may be a block device or a image of one, but this isn't - * enforced (but it's not much fun on a character device :-). + * enforced (but it's not much fun on a character device :-). */ #include @@ -144,10 +144,10 @@ static volatile sig_atomic_t termios_set = 0; /* File-name data */ #define MAX_DEPTH 50 static int name_depth = 0; -static char name_list[MAX_DEPTH][NAME_MAX+1]; +static char name_list[MAX_DEPTH][MINIX_NAME_MAX+1]; /* Copy of the previous, just for error reporting - see get_current_name */ /* This is a waste of 12kB or so. */ -static char current_name[MAX_DEPTH*(NAME_MAX+1)+1]; +static char current_name[MAX_DEPTH*(MINIX_NAME_MAX+1)+1]; #define MAGIC (Super.s_magic) @@ -510,7 +510,7 @@ write_super_block(void) { Super.s_state |= MINIX_ERROR_FS; else Super.s_state &= ~MINIX_ERROR_FS; - + if (MINIX_BLOCK_SIZE != lseek(IN, MINIX_BLOCK_SIZE, SEEK_SET)) die(_("seek failed in write_super_block")); if (MINIX_BLOCK_SIZE != write(IN, super_block_buffer, MINIX_BLOCK_SIZE)) diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c index 96e09bf1f9..47b9ed6bd1 100644 --- a/disk-utils/mkfs.minix.c +++ b/disk-utils/mkfs.minix.c @@ -92,7 +92,7 @@ #define TEST_BUFFER_BLOCKS 16 #define MAX_GOOD_BLOCKS 512 -#define MAX_INODES 65535 +#define MINIX_MAX_INODES 65535 /* * Global variables used in minix_programs.h inline fuctions @@ -504,8 +504,8 @@ static void setup_tables(void) { else inodes = ((inodes + MINIX_INODES_PER_BLOCK - 1) & ~(MINIX_INODES_PER_BLOCK - 1)); - if (inodes > MAX_INODES) - inodes = MAX_INODES; + if (inodes > MINIX_MAX_INODES) + inodes = MINIX_MAX_INODES; if (fs_version == 3) Super3.s_ninodes = inodes; else @@ -774,8 +774,8 @@ int main(int argc, char ** argv) { else magic = MINIX2_SUPER_MAGIC2; } else - if (BLOCKS > MAX_INODES) - BLOCKS = MAX_INODES; + if (BLOCKS > MINIX_MAX_INODES) + BLOCKS = MINIX_MAX_INODES; setup_tables(); if (check) check_blocks(); diff --git a/include/minix.h b/include/minix.h index 13b1cf6c68..57be23921c 100644 --- a/include/minix.h +++ b/include/minix.h @@ -58,19 +58,20 @@ struct minix3_super_block { /* * Minix subpartitions are always within primary dos partition. */ -#define MINIX_MAXPARTITIONS 4 +#define MINIX_MAXPARTITIONS 4 #define MINIX_BLOCK_SIZE_BITS 10 -#define MINIX_BLOCK_SIZE (1<