Date: Thu, 9 Mar 2006 05:38:16 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 93013 for review Message-ID: <200603090538.k295cGr6061989@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=93013 Change 93013 by kmacy@kmacy_storage:sun4v_work on 2006/03/09 05:38:08 changes to support running on solaris' UFS Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/ufs/ffs/ffs_vfsops.c#3 edit .. //depot/projects/kmacy_sun4v/src/sys/ufs/ffs/fs.h#3 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/ufs/ffs/ffs_vfsops.c#3 (text+ko) ==== @@ -893,8 +893,10 @@ if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_old_inodefmt < FS_44INODEFMT) { fs->fs_maxfilesize = ((uint64_t)1 << 31) - 1; +#ifndef SIMULATOR fs->fs_qbmask = ~fs->fs_bmask; fs->fs_qfmask = ~fs->fs_fmask; +#endif } if (fs->fs_magic == FS_UFS1_MAGIC) { ump->um_savedmaxfilesize = fs->fs_maxfilesize; ==== //depot/projects/kmacy_sun4v/src/sys/ufs/ffs/fs.h#3 (text+ko) ==== @@ -33,6 +33,8 @@ #ifndef _UFS_FFS_FS_H_ #define _UFS_FFS_FS_H_ +#include "opt_simulator.h" + /* * Each disk drive contains some number of filesystems. * A filesystem consists of a number of cylinder groups. @@ -246,6 +248,11 @@ int64_t cs_spare[3]; /* future expansion */ }; +#ifdef SIMULATOR +typedef struct _quad { int val[2]; } squad_t; +#endif + + /* * Super block for an FFS filesystem. */ @@ -342,11 +349,19 @@ int32_t fs_maxsymlinklen; /* max length of an internal symlink */ int32_t fs_old_inodefmt; /* format of on-disk inodes */ u_int64_t fs_maxfilesize; /* maximum representable file size */ +#ifdef SIMULATOR + uint32_t junk; + squad_t fs_qbmask; /* ~fs_bmask for use with 64-bit size */ + squad_t fs_qfmask; /* ~fs_fmask for use with 64-bit size */ +#else int64_t fs_qbmask; /* ~fs_bmask for use with 64-bit size */ int64_t fs_qfmask; /* ~fs_fmask for use with 64-bit size */ +#endif int32_t fs_state; /* validate fs_clean field */ int32_t fs_old_postblformat; /* format of positional layout tables */ +#ifndef SIMULATOR int32_t fs_old_nrpos; /* number of rotational positions */ +#endif int32_t fs_spare5[2]; /* old fs_postbloff */ /* old fs_rotbloff */ int32_t fs_magic; /* magic number */ @@ -546,10 +561,17 @@ * quantities by using shifts and masks in place of divisions * modulos and multiplications. */ +#ifdef SIMULATOR #define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ + ((loc) & ((fs)->fs_qbmask.val[0] | (fs)->fs_qbmask.val[1])) +#define fragoff(fs, loc) /* calculates (loc % fs->fs_fsize) */ \ + ((loc) & ((fs)->fs_qfmask.val[0] | (fs)->fs_qfmask.val[1])) +#else +#define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ ((loc) & (fs)->fs_qbmask) #define fragoff(fs, loc) /* calculates (loc % fs->fs_fsize) */ \ ((loc) & (fs)->fs_qfmask) +#endif #define lfragtosize(fs, frag) /* calculates ((off_t)frag * fs->fs_fsize) */ \ (((off_t)(frag)) << (fs)->fs_fshift) #define lblktosize(fs, blk) /* calculates ((off_t)blk * fs->fs_bsize) */ \ @@ -561,10 +583,17 @@ ((loc) >> (fs)->fs_bshift) #define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ ((loc) >> (fs)->fs_fshift) +#ifdef SIMULATOR #define blkroundup(fs, size) /* calculates roundup(size, fs->fs_bsize) */ \ + (((size) + ((fs)->fs_qbmask.val[0] | (fs)->fs_qbmask.val[1])) & (fs)->fs_bmask) +#define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ + (((size) + ((fs)->fs_qfmask.val[0] | (fs)->fs_qfmask.val[1])) & (fs)->fs_fmask) +#else +#define blkroundup(fs, size) /* calculates roundup(size, fs->fs_bsize) */ \ (((size) + (fs)->fs_qbmask) & (fs)->fs_bmask) #define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ (((size) + (fs)->fs_qfmask) & (fs)->fs_fmask) +#endif #define fragstoblks(fs, frags) /* calculates (frags / fs->fs_frag) */ \ ((frags) >> (fs)->fs_fragshift) #define blkstofrags(fs, blks) /* calculates (blks * fs->fs_frag) */ \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603090538.k295cGr6061989>