Use the smaller cgbase() macro in ufsread.c if UFS_SMALL_CGBASE is

defined.  This lets each boot program choose which version of cgbase() it
wants to use rather than forcing ufsread.c to have that knowledge.

MFC after:	1 week
Discussed with:	imp
This commit is contained in:
jhb 2007-10-26 21:02:31 +00:00
parent 6932638821
commit a7b201ee6d
4 changed files with 5 additions and 4 deletions

View File

@ -93,6 +93,7 @@ static int parse(void);
static int xfsread(ino_t, void *, size_t);
static int dskread(void *, unsigned, unsigned);
#define UFS_SMALL_CGBASE
#include "ufsread.c"
static inline int

View File

@ -48,10 +48,10 @@ __FBSDID("$FreeBSD$");
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
#if (defined(__i386__) && !defined(GPTBOOT)) || defined(__arm__)
#ifdef UFS_SMALL_CGBASE
/* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase
(see sys/ufs/ffs/fs.h rev 1.39) so that i386 boot loader (boot2) can
support both UFS1 and UFS2 again. */
(see sys/ufs/ffs/fs.h rev 1.39) so that small boot loaders (e.g. boot2) can
support both UFS1 and UFS2. */
#undef cgbase
#define cgbase(fs, c) ((ufs2_daddr_t)((fs)->fs_fpg * (c)))
#endif

View File

@ -168,6 +168,7 @@ strcmp(const char *s1, const char *s2)
return (unsigned char)*s1 - (unsigned char)*s2;
}
#define UFS_SMALL_CGBASE
#include "ufsread.c"
static inline int

View File

@ -167,7 +167,6 @@ strcmp(const char *s1, const char *s2)
return (unsigned char)*s1 - (unsigned char)*s2;
}
#define GPTBOOT
#include "ufsread.c"
static inline int