mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
UFS/FFS: Migrate to modern uintXX_t from u_intXX_t.
As per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.html move to the modern uintXX_t. While here also migrate u_char to uint8_t. Where other kernel interfaces allow, migrate u_long to uint64_t. No functional changes intended. MFC-after: 1 week Sponsored-by: The FreeBSD Foundation
This commit is contained in:
parent
da6620e495
commit
831b1ff791
|
@ -103,10 +103,11 @@ __FBSDID("$FreeBSD$");
|
|||
#include <ufs/ffs/ffs_extern.h>
|
||||
#include <ufs/ffs/softdep.h>
|
||||
|
||||
typedef ufs2_daddr_t allocfcn_t(struct inode *ip, u_int cg, ufs2_daddr_t bpref,
|
||||
int size, int rsize);
|
||||
typedef ufs2_daddr_t allocfcn_t(struct inode *ip, uint64_t cg,
|
||||
ufs2_daddr_t bpref, int size, int rsize);
|
||||
|
||||
static ufs2_daddr_t ffs_alloccg(struct inode *, u_int, ufs2_daddr_t, int, int);
|
||||
static ufs2_daddr_t ffs_alloccg(struct inode *, uint64_t, ufs2_daddr_t, int,
|
||||
int);
|
||||
static ufs2_daddr_t
|
||||
ffs_alloccgblk(struct inode *, struct buf *, ufs2_daddr_t, int);
|
||||
static void ffs_blkfree_cg(struct ufsmount *, struct fs *,
|
||||
|
@ -115,13 +116,14 @@ static void ffs_blkfree_cg(struct ufsmount *, struct fs *,
|
|||
#ifdef INVARIANTS
|
||||
static int ffs_checkblk(struct inode *, ufs2_daddr_t, long);
|
||||
#endif
|
||||
static ufs2_daddr_t ffs_clusteralloc(struct inode *, u_int, ufs2_daddr_t, int);
|
||||
static ufs2_daddr_t ffs_clusteralloc(struct inode *, uint64_t, ufs2_daddr_t,
|
||||
int);
|
||||
static ino_t ffs_dirpref(struct inode *);
|
||||
static ufs2_daddr_t ffs_fragextend(struct inode *, u_int, ufs2_daddr_t,
|
||||
static ufs2_daddr_t ffs_fragextend(struct inode *, uint64_t, ufs2_daddr_t,
|
||||
int, int);
|
||||
static ufs2_daddr_t ffs_hashalloc
|
||||
(struct inode *, u_int, ufs2_daddr_t, int, int, allocfcn_t *);
|
||||
static ufs2_daddr_t ffs_nodealloccg(struct inode *, u_int, ufs2_daddr_t, int,
|
||||
static ufs2_daddr_t ffs_hashalloc(struct inode *, uint64_t, ufs2_daddr_t,
|
||||
int, int, allocfcn_t *);
|
||||
static ufs2_daddr_t ffs_nodealloccg(struct inode *, uint64_t, ufs2_daddr_t, int,
|
||||
int);
|
||||
static ufs1_daddr_t ffs_mapsearch(struct fs *, struct cg *, ufs2_daddr_t, int);
|
||||
static int ffs_reallocblks_ufs1(struct vop_reallocblks_args *);
|
||||
|
@ -159,7 +161,7 @@ ffs_alloc(struct inode *ip,
|
|||
struct fs *fs;
|
||||
struct ufsmount *ump;
|
||||
ufs2_daddr_t bno;
|
||||
u_int cg, reclaimed;
|
||||
uint64_t cg, reclaimed;
|
||||
int64_t delta;
|
||||
#ifdef QUOTA
|
||||
int error;
|
||||
|
@ -170,7 +172,7 @@ ffs_alloc(struct inode *ip,
|
|||
fs = ump->um_fs;
|
||||
mtx_assert(UFS_MTX(ump), MA_OWNED);
|
||||
#ifdef INVARIANTS
|
||||
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) {
|
||||
if ((uint64_t)size > fs->fs_bsize || fragoff(fs, size) != 0) {
|
||||
printf("dev = %s, bsize = %ld, size = %d, fs = %s\n",
|
||||
devtoname(ump->um_dev), (long)fs->fs_bsize, size,
|
||||
fs->fs_fsmnt);
|
||||
|
@ -263,7 +265,7 @@ ffs_realloccg(struct inode *ip,
|
|||
struct fs *fs;
|
||||
struct buf *bp;
|
||||
struct ufsmount *ump;
|
||||
u_int cg, request, reclaimed;
|
||||
uint64_t cg, request, reclaimed;
|
||||
int error, gbflags;
|
||||
ufs2_daddr_t bno;
|
||||
int64_t delta;
|
||||
|
@ -281,8 +283,8 @@ ffs_realloccg(struct inode *ip,
|
|||
#ifdef INVARIANTS
|
||||
if (vp->v_mount->mnt_kern_flag & MNTK_SUSPENDED)
|
||||
panic("ffs_realloccg: allocation on suspended filesystem");
|
||||
if ((u_int)osize > fs->fs_bsize || fragoff(fs, osize) != 0 ||
|
||||
(u_int)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) {
|
||||
if ((uint64_t)osize > fs->fs_bsize || fragoff(fs, osize) != 0 ||
|
||||
(uint64_t)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) {
|
||||
printf(
|
||||
"dev = %s, bsize = %ld, osize = %d, nsize = %d, fs = %s\n",
|
||||
devtoname(ump->um_dev), (long)fs->fs_bsize, osize,
|
||||
|
@ -1117,7 +1119,7 @@ ffs_valloc(struct vnode *pvp,
|
|||
struct timespec ts;
|
||||
struct ufsmount *ump;
|
||||
ino_t ino, ipref;
|
||||
u_int cg;
|
||||
uint64_t cg;
|
||||
int error, reclaimed;
|
||||
|
||||
*vpp = NULL;
|
||||
|
@ -1173,8 +1175,8 @@ ffs_valloc(struct vnode *pvp,
|
|||
panic("ffs_valloc: dup alloc");
|
||||
}
|
||||
if (DIP(ip, i_blocks) && (fs->fs_flags & FS_UNCLEAN) == 0) { /* XXX */
|
||||
printf("free inode %s/%lu had %ld blocks\n",
|
||||
fs->fs_fsmnt, (u_long)ino, (long)DIP(ip, i_blocks));
|
||||
printf("free inode %s/%ju had %ld blocks\n",
|
||||
fs->fs_fsmnt, (intmax_t)ino, (long)DIP(ip, i_blocks));
|
||||
DIP_SET(ip, i_blocks, 0);
|
||||
}
|
||||
ip->i_flags = 0;
|
||||
|
@ -1242,9 +1244,9 @@ ffs_dirpref(struct inode *pip)
|
|||
struct fs *fs;
|
||||
int cg, prefcg, curcg, dirsize, cgsize;
|
||||
int depth, range, start, end, numdirs, power, numerator, denominator;
|
||||
u_int avgifree, avgbfree, avgndir, curdirsize;
|
||||
u_int minifree, minbfree, maxndir;
|
||||
u_int maxcontigdirs;
|
||||
uint64_t avgifree, avgbfree, avgndir, curdirsize;
|
||||
uint64_t minifree, minbfree, maxndir;
|
||||
uint64_t maxcontigdirs;
|
||||
|
||||
mtx_assert(UFS_MTX(ITOUMP(pip)), MA_OWNED);
|
||||
fs = ITOFS(pip);
|
||||
|
@ -1406,8 +1408,8 @@ ffs_blkpref_ufs1(struct inode *ip,
|
|||
ufs1_daddr_t *bap)
|
||||
{
|
||||
struct fs *fs;
|
||||
u_int cg, inocg;
|
||||
u_int avgbfree, startcg;
|
||||
uint64_t cg, inocg;
|
||||
uint64_t avgbfree, startcg;
|
||||
ufs2_daddr_t pref, prevbn;
|
||||
|
||||
KASSERT(indx <= 0 || bap != NULL, ("need non-NULL bap"));
|
||||
|
@ -1518,8 +1520,8 @@ ffs_blkpref_ufs2(struct inode *ip,
|
|||
ufs2_daddr_t *bap)
|
||||
{
|
||||
struct fs *fs;
|
||||
u_int cg, inocg;
|
||||
u_int avgbfree, startcg;
|
||||
uint64_t cg, inocg;
|
||||
uint64_t avgbfree, startcg;
|
||||
ufs2_daddr_t pref, prevbn;
|
||||
|
||||
KASSERT(indx <= 0 || bap != NULL, ("need non-NULL bap"));
|
||||
|
@ -1634,7 +1636,7 @@ ffs_blkpref_ufs2(struct inode *ip,
|
|||
/*VARARGS5*/
|
||||
static ufs2_daddr_t
|
||||
ffs_hashalloc(struct inode *ip,
|
||||
u_int cg,
|
||||
uint64_t cg,
|
||||
ufs2_daddr_t pref,
|
||||
int size, /* Search size for data blocks, mode for inodes */
|
||||
int rsize, /* Real allocated size. */
|
||||
|
@ -1642,7 +1644,7 @@ ffs_hashalloc(struct inode *ip,
|
|||
{
|
||||
struct fs *fs;
|
||||
ufs2_daddr_t result;
|
||||
u_int i, icg = cg;
|
||||
uint64_t i, icg = cg;
|
||||
|
||||
mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED);
|
||||
#ifdef INVARIANTS
|
||||
|
@ -1692,7 +1694,7 @@ ffs_hashalloc(struct inode *ip,
|
|||
*/
|
||||
static ufs2_daddr_t
|
||||
ffs_fragextend(struct inode *ip,
|
||||
u_int cg,
|
||||
uint64_t cg,
|
||||
ufs2_daddr_t bprev,
|
||||
int osize,
|
||||
int nsize)
|
||||
|
@ -1705,7 +1707,7 @@ ffs_fragextend(struct inode *ip,
|
|||
long bno;
|
||||
int frags, bbase;
|
||||
int i, error;
|
||||
u_int8_t *blksfree;
|
||||
uint8_t *blksfree;
|
||||
|
||||
ump = ITOUMP(ip);
|
||||
fs = ump->um_fs;
|
||||
|
@ -1769,7 +1771,7 @@ ffs_fragextend(struct inode *ip,
|
|||
*/
|
||||
static ufs2_daddr_t
|
||||
ffs_alloccg(struct inode *ip,
|
||||
u_int cg,
|
||||
uint64_t cg,
|
||||
ufs2_daddr_t bpref,
|
||||
int size,
|
||||
int rsize)
|
||||
|
@ -1781,7 +1783,7 @@ ffs_alloccg(struct inode *ip,
|
|||
ufs1_daddr_t bno;
|
||||
ufs2_daddr_t blkno;
|
||||
int i, allocsiz, error, frags;
|
||||
u_int8_t *blksfree;
|
||||
uint8_t *blksfree;
|
||||
|
||||
ump = ITOUMP(ip);
|
||||
fs = ump->um_fs;
|
||||
|
@ -1874,7 +1876,7 @@ ffs_alloccgblk(struct inode *ip,
|
|||
struct ufsmount *ump;
|
||||
ufs1_daddr_t bno;
|
||||
ufs2_daddr_t blkno;
|
||||
u_int8_t *blksfree;
|
||||
uint8_t *blksfree;
|
||||
int i, cgbpref;
|
||||
|
||||
ump = ITOUMP(ip);
|
||||
|
@ -1947,7 +1949,7 @@ ffs_alloccgblk(struct inode *ip,
|
|||
*/
|
||||
static ufs2_daddr_t
|
||||
ffs_clusteralloc(struct inode *ip,
|
||||
u_int cg,
|
||||
uint64_t cg,
|
||||
ufs2_daddr_t bpref,
|
||||
int len)
|
||||
{
|
||||
|
@ -1957,9 +1959,9 @@ ffs_clusteralloc(struct inode *ip,
|
|||
struct ufsmount *ump;
|
||||
int i, run, bit, map, got, error;
|
||||
ufs2_daddr_t bno;
|
||||
u_char *mapp;
|
||||
uint8_t *mapp;
|
||||
int32_t *lp;
|
||||
u_int8_t *blksfree;
|
||||
uint8_t *blksfree;
|
||||
|
||||
ump = ITOUMP(ip);
|
||||
fs = ump->um_fs;
|
||||
|
@ -2057,8 +2059,8 @@ ffs_clusteralloc(struct inode *ip,
|
|||
|
||||
static inline struct buf *
|
||||
getinobuf(struct inode *ip,
|
||||
u_int cg,
|
||||
u_int32_t cginoblk,
|
||||
uint64_t cg,
|
||||
uint32_t cginoblk,
|
||||
int gbflags)
|
||||
{
|
||||
struct fs *fs;
|
||||
|
@ -2090,7 +2092,7 @@ SYSCTL_INT(_vfs_ffs, OID_AUTO, doasyncinodeinit, CTLFLAG_RWTUN,
|
|||
*/
|
||||
static ufs2_daddr_t
|
||||
ffs_nodealloccg(struct inode *ip,
|
||||
u_int cg,
|
||||
uint64_t cg,
|
||||
ufs2_daddr_t ipref,
|
||||
int mode,
|
||||
int unused)
|
||||
|
@ -2099,10 +2101,10 @@ ffs_nodealloccg(struct inode *ip,
|
|||
struct cg *cgp;
|
||||
struct buf *bp, *ibp;
|
||||
struct ufsmount *ump;
|
||||
u_int8_t *inosused, *loc;
|
||||
uint8_t *inosused, *loc;
|
||||
struct ufs2_dinode *dp2;
|
||||
int error, start, len, i;
|
||||
u_int32_t old_initediblk;
|
||||
uint32_t old_initediblk;
|
||||
|
||||
ump = ITOUMP(ip);
|
||||
fs = ump->um_fs;
|
||||
|
@ -2134,8 +2136,8 @@ ffs_nodealloccg(struct inode *ip,
|
|||
start = 0;
|
||||
loc = memcchr(&inosused[start], 0xff, len);
|
||||
if (loc == NULL) {
|
||||
printf("cg = %d, irotor = %ld, fs = %s\n",
|
||||
cg, (long)cgp->cg_irotor, fs->fs_fsmnt);
|
||||
printf("cg = %ju, irotor = %ld, fs = %s\n",
|
||||
(intmax_t)cg, (long)cgp->cg_irotor, fs->fs_fsmnt);
|
||||
panic("ffs_nodealloccg: map corrupted");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
@ -2259,8 +2261,8 @@ ffs_blkfree_cg(struct ufsmount *ump,
|
|||
daddr_t dbn;
|
||||
ufs1_daddr_t fragno, cgbno;
|
||||
int i, blk, frags, bbase, error;
|
||||
u_int cg;
|
||||
u_int8_t *blksfree;
|
||||
uint64_t cg;
|
||||
uint8_t *blksfree;
|
||||
struct cdev *dev;
|
||||
|
||||
cg = dtog(fs, bno);
|
||||
|
@ -2278,7 +2280,7 @@ ffs_blkfree_cg(struct ufsmount *ump,
|
|||
} else
|
||||
return;
|
||||
#ifdef INVARIANTS
|
||||
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0 ||
|
||||
if ((uint64_t)size > fs->fs_bsize || fragoff(fs, size) != 0 ||
|
||||
fragnum(fs, bno) + numfrags(fs, size) > fs->fs_frag) {
|
||||
printf("dev=%s, bno = %jd, bsize = %ld, size = %ld, fs = %s\n",
|
||||
devtoname(dev), (intmax_t)bno, (long)fs->fs_bsize,
|
||||
|
@ -2286,9 +2288,9 @@ ffs_blkfree_cg(struct ufsmount *ump,
|
|||
panic("ffs_blkfree_cg: bad size");
|
||||
}
|
||||
#endif
|
||||
if ((u_int)bno >= fs->fs_size) {
|
||||
printf("bad block %jd, ino %lu\n", (intmax_t)bno,
|
||||
(u_long)inum);
|
||||
if ((uint64_t)bno >= fs->fs_size) {
|
||||
printf("bad block %jd, ino %ju\n", (intmax_t)bno,
|
||||
(intmax_t)inum);
|
||||
ffs_fserr(fs, inum, "bad block");
|
||||
return;
|
||||
}
|
||||
|
@ -2429,7 +2431,7 @@ struct ffs_blkfree_trim_params {
|
|||
static void ffs_blkfree_trim_completed(struct buf *);
|
||||
static void ffs_blkfree_trim_task(void *ctx, int pending __unused);
|
||||
static struct ffs_blkfree_trim_params *trim_lookup(struct ufsmount *,
|
||||
struct vnode *, ufs2_daddr_t, long, ino_t, u_long, int);
|
||||
struct vnode *, ufs2_daddr_t, long, ino_t, uint64_t, int);
|
||||
static void ffs_blkfree_sendtrim(struct ffs_blkfree_trim_params *);
|
||||
|
||||
/*
|
||||
|
@ -2482,7 +2484,7 @@ trim_lookup(struct ufsmount *ump,
|
|||
ufs2_daddr_t bno,
|
||||
long size,
|
||||
ino_t inum,
|
||||
u_long key,
|
||||
uint64_t key,
|
||||
int alloctype)
|
||||
{
|
||||
struct trimlist_hashhead *tphashhead;
|
||||
|
@ -2571,13 +2573,13 @@ ffs_blkfree_sendtrim(struct ffs_blkfree_trim_params *tp)
|
|||
/*
|
||||
* Allocate a new key to use to identify a range of blocks.
|
||||
*/
|
||||
u_long
|
||||
uint64_t
|
||||
ffs_blkrelease_start(struct ufsmount *ump,
|
||||
struct vnode *devvp,
|
||||
ino_t inum)
|
||||
{
|
||||
static u_long masterkey;
|
||||
u_long key;
|
||||
uint64_t key;
|
||||
|
||||
if (((ump->um_flags & UM_CANDELETE) == 0) || dotrimcons == 0)
|
||||
return (SINGLETON_KEY);
|
||||
|
@ -2592,7 +2594,7 @@ ffs_blkrelease_start(struct ufsmount *ump,
|
|||
* Deallocate a key that has been used to identify a range of blocks.
|
||||
*/
|
||||
void
|
||||
ffs_blkrelease_finish(struct ufsmount *ump, u_long key)
|
||||
ffs_blkrelease_finish(struct ufsmount *ump, uint64_t key)
|
||||
{
|
||||
struct ffs_blkfree_trim_params *tp;
|
||||
|
||||
|
@ -2646,7 +2648,7 @@ ffs_blkfree(struct ufsmount *ump,
|
|||
ino_t inum,
|
||||
__enum_uint8(vtype) vtype,
|
||||
struct workhead *dephd,
|
||||
u_long key)
|
||||
uint64_t key)
|
||||
{
|
||||
struct ffs_blkfree_trim_params *tp, *ntp;
|
||||
struct trim_blkreq *blkelm;
|
||||
|
@ -2754,15 +2756,15 @@ ffs_checkblk(struct inode *ip,
|
|||
struct buf *bp;
|
||||
ufs1_daddr_t cgbno;
|
||||
int i, error, frags, free;
|
||||
u_int8_t *blksfree;
|
||||
uint8_t *blksfree;
|
||||
|
||||
fs = ITOFS(ip);
|
||||
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) {
|
||||
if ((uint64_t)size > fs->fs_bsize || fragoff(fs, size) != 0) {
|
||||
printf("bsize = %ld, size = %ld, fs = %s\n",
|
||||
(long)fs->fs_bsize, size, fs->fs_fsmnt);
|
||||
panic("ffs_checkblk: bad size");
|
||||
}
|
||||
if ((u_int)bno >= fs->fs_size)
|
||||
if ((uint64_t)bno >= fs->fs_size)
|
||||
panic("ffs_checkblk: bad block %jd", (intmax_t)bno);
|
||||
error = ffs_getcg(fs, ITODEVVP(ip), dtog(fs, bno), 0, &bp, &cgp);
|
||||
if (error)
|
||||
|
@ -2818,8 +2820,8 @@ ffs_freefile(struct ufsmount *ump,
|
|||
struct buf *bp;
|
||||
daddr_t dbn;
|
||||
int error;
|
||||
u_int cg;
|
||||
u_int8_t *inosused;
|
||||
uint64_t cg;
|
||||
uint8_t *inosused;
|
||||
struct cdev *dev;
|
||||
ino_t cgino;
|
||||
|
||||
|
@ -2895,8 +2897,8 @@ ffs_checkfreefile(struct fs *fs,
|
|||
struct cg *cgp;
|
||||
struct buf *bp;
|
||||
int ret, error;
|
||||
u_int cg;
|
||||
u_int8_t *inosused;
|
||||
uint64_t cg;
|
||||
uint8_t *inosused;
|
||||
|
||||
cg = ino_to_cg(fs, ino);
|
||||
if ((devvp->v_type != VREG) && (devvp->v_type != VCHR))
|
||||
|
@ -2927,7 +2929,7 @@ ffs_mapsearch(struct fs *fs,
|
|||
ufs1_daddr_t bno;
|
||||
int start, len, loc, i;
|
||||
int blk, field, subfield, pos;
|
||||
u_int8_t *blksfree;
|
||||
uint8_t *blksfree;
|
||||
|
||||
/*
|
||||
* find the fragment by searching through the free block
|
||||
|
@ -2939,15 +2941,15 @@ ffs_mapsearch(struct fs *fs,
|
|||
start = cgp->cg_frotor / NBBY;
|
||||
blksfree = cg_blksfree(cgp);
|
||||
len = howmany(fs->fs_fpg, NBBY) - start;
|
||||
loc = scanc((u_int)len, (u_char *)&blksfree[start],
|
||||
loc = scanc((uint64_t)len, (uint8_t *)&blksfree[start],
|
||||
fragtbl[fs->fs_frag],
|
||||
(u_char)(1 << (allocsiz - 1 + (fs->fs_frag % NBBY))));
|
||||
(uint8_t)(1 << (allocsiz - 1 + (fs->fs_frag % NBBY))));
|
||||
if (loc == 0) {
|
||||
len = start + 1;
|
||||
start = 0;
|
||||
loc = scanc((u_int)len, (u_char *)&blksfree[0],
|
||||
loc = scanc((uint64_t)len, (uint8_t *)&blksfree[0],
|
||||
fragtbl[fs->fs_frag],
|
||||
(u_char)(1 << (allocsiz - 1 + (fs->fs_frag % NBBY))));
|
||||
(uint8_t)(1 << (allocsiz - 1 + (fs->fs_frag % NBBY))));
|
||||
if (loc == 0) {
|
||||
printf("start = %d, len = %d, fs = %s\n",
|
||||
start, len, fs->fs_fsmnt);
|
||||
|
@ -2973,7 +2975,7 @@ ffs_mapsearch(struct fs *fs,
|
|||
subfield <<= 1;
|
||||
}
|
||||
}
|
||||
printf("bno = %lu, fs = %s\n", (u_long)bno, fs->fs_fsmnt);
|
||||
printf("bno = %ju, fs = %s\n", (intmax_t)bno, fs->fs_fsmnt);
|
||||
panic("ffs_alloccg: block not in map");
|
||||
return (-1);
|
||||
}
|
||||
|
@ -2993,7 +2995,7 @@ ffs_getmntstat(struct vnode *devvp)
|
|||
int
|
||||
ffs_getcg(struct fs *fs,
|
||||
struct vnode *devvp,
|
||||
u_int cg,
|
||||
uint64_t cg,
|
||||
int flags,
|
||||
struct buf **bpp,
|
||||
struct cg **cgpp)
|
||||
|
@ -3021,11 +3023,11 @@ ffs_getcg(struct fs *fs,
|
|||
(bp->b_flags & B_CKHASH) != 0 &&
|
||||
cgp->cg_ckhash != bp->b_ckhash) {
|
||||
sfs = ffs_getmntstat(devvp);
|
||||
printf("UFS %s%s (%s) cylinder checksum failed: cg %u, cgp: "
|
||||
printf("UFS %s%s (%s) cylinder checksum failed: cg %ju, cgp: "
|
||||
"0x%x != bp: 0x%jx\n",
|
||||
devvp->v_type == VCHR ? "" : "snapshot of ",
|
||||
sfs->f_mntfromname, sfs->f_mntonname,
|
||||
cg, cgp->cg_ckhash, (uintmax_t)bp->b_ckhash);
|
||||
(intmax_t)cg, cgp->cg_ckhash, (uintmax_t)bp->b_ckhash);
|
||||
bp->b_flags &= ~B_CKHASH;
|
||||
bp->b_flags |= B_INVAL | B_NOCACHE;
|
||||
brelse(bp);
|
||||
|
@ -3037,11 +3039,11 @@ ffs_getcg(struct fs *fs,
|
|||
devvp->v_type == VCHR ? "" : "snapshot of ",
|
||||
sfs->f_mntfromname, sfs->f_mntonname);
|
||||
if (!cg_chkmagic(cgp))
|
||||
printf(" cg %u: bad magic number 0x%x should be 0x%x\n",
|
||||
cg, cgp->cg_magic, CG_MAGIC);
|
||||
printf(" cg %ju: bad magic number 0x%x should be "
|
||||
"0x%x\n", (intmax_t)cg, cgp->cg_magic, CG_MAGIC);
|
||||
else
|
||||
printf(": wrong cylinder group cg %u != cgx %u\n", cg,
|
||||
cgp->cg_cgx);
|
||||
printf(": wrong cylinder group cg %ju != cgx %u\n",
|
||||
(intmax_t)cg, cgp->cg_cgx);
|
||||
bp->b_flags &= ~B_CKHASH;
|
||||
bp->b_flags |= B_INVAL | B_NOCACHE;
|
||||
brelse(bp);
|
||||
|
@ -3219,7 +3221,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS)
|
|||
struct pwd *pwd;
|
||||
ufs2_daddr_t blkno;
|
||||
long blkcnt, blksize;
|
||||
u_long key;
|
||||
uint64_t key;
|
||||
struct file *fp;
|
||||
cap_rights_t rights;
|
||||
int filetype, error;
|
||||
|
|
|
@ -62,14 +62,15 @@ int ffs_balloc_ufs1(struct vnode *a_vp, off_t a_startoffset, int a_size,
|
|||
int ffs_balloc_ufs2(struct vnode *a_vp, off_t a_startoffset, int a_size,
|
||||
struct ucred *a_cred, int a_flags, struct buf **a_bpp);
|
||||
void ffs_blkfree(struct ufsmount *, struct fs *, struct vnode *,
|
||||
ufs2_daddr_t, long, ino_t, __enum_uint8(vtype), struct workhead *, u_long);
|
||||
ufs2_daddr_t, long, ino_t, __enum_uint8(vtype), struct workhead *,
|
||||
uint64_t);
|
||||
ufs2_daddr_t ffs_blkpref_ufs1(struct inode *, ufs_lbn_t, int, ufs1_daddr_t *);
|
||||
ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_t, int, ufs2_daddr_t *);
|
||||
void ffs_blkrelease_finish(struct ufsmount *, u_long);
|
||||
u_long ffs_blkrelease_start(struct ufsmount *, struct vnode *, ino_t);
|
||||
void ffs_blkrelease_finish(struct ufsmount *, uint64_t);
|
||||
uint64_t ffs_blkrelease_start(struct ufsmount *, struct vnode *, ino_t);
|
||||
uint32_t ffs_calc_sbhash(struct fs *);
|
||||
int ffs_checkfreefile(struct fs *, struct vnode *, ino_t);
|
||||
void ffs_clrblock(struct fs *, u_char *, ufs1_daddr_t);
|
||||
void ffs_clrblock(struct fs *, uint8_t *, ufs1_daddr_t);
|
||||
void ffs_clusteracct(struct fs *, struct cg *, ufs1_daddr_t, int);
|
||||
void ffs_bdflush(struct bufobj *, struct buf *);
|
||||
int ffs_copyonwrite(struct vnode *, struct buf *);
|
||||
|
@ -78,12 +79,12 @@ void ffs_fragacct(struct fs *, int, int32_t [], int);
|
|||
int ffs_freefile(struct ufsmount *, struct fs *, struct vnode *, ino_t,
|
||||
int, struct workhead *);
|
||||
void ffs_fserr(struct fs *, ino_t, char *);
|
||||
int ffs_getcg(struct fs *, struct vnode *, u_int, int, struct buf **,
|
||||
int ffs_getcg(struct fs *, struct vnode *, uint64_t, int, struct buf **,
|
||||
struct cg **);
|
||||
int ffs_inotovp(struct mount *, ino_t, u_int64_t, int, struct vnode **,
|
||||
int ffs_inotovp(struct mount *, ino_t, uint64_t, int, struct vnode **,
|
||||
int);
|
||||
int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t);
|
||||
int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t);
|
||||
int ffs_isblock(struct fs *, uint8_t *, ufs1_daddr_t);
|
||||
int ffs_isfreeblock(struct fs *, uint8_t *, ufs1_daddr_t);
|
||||
void ffs_oldfscompat_write(struct fs *, struct ufsmount *);
|
||||
int ffs_own_mount(const struct mount *mp);
|
||||
int ffs_sbsearch(void *, struct fs **, int, struct malloc_type *,
|
||||
|
@ -97,7 +98,7 @@ int ffs_sbget(void *, struct fs **, off_t, int, struct malloc_type *,
|
|||
int ffs_sbput(void *, struct fs *, off_t, int (*)(void *, off_t, void *,
|
||||
int));
|
||||
int ffs_sbupdate(struct ufsmount *, int, int);
|
||||
void ffs_setblock(struct fs *, u_char *, ufs1_daddr_t);
|
||||
void ffs_setblock(struct fs *, uint8_t *, ufs1_daddr_t);
|
||||
int ffs_snapblkfree(struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t,
|
||||
__enum_uint8(vtype), struct workhead *);
|
||||
void ffs_snapremove(struct vnode *vp);
|
||||
|
|
|
@ -250,7 +250,7 @@ ffs_truncate(struct vnode *vp,
|
|||
int needextclean, extblocks;
|
||||
int offset, size, level, nblocks;
|
||||
int i, error, allerror, indiroff, waitforupdate;
|
||||
u_long key;
|
||||
uint64_t key;
|
||||
off_t osize;
|
||||
|
||||
ip = VTOI(vp);
|
||||
|
@ -339,7 +339,7 @@ ffs_truncate(struct vnode *vp,
|
|||
if (length != 0)
|
||||
panic("ffs_truncate: partial truncate of symlink");
|
||||
#endif
|
||||
bzero(DIP(ip, i_shortlink), (u_int)ip->i_size);
|
||||
bzero(DIP(ip, i_shortlink), (uint64_t)ip->i_size);
|
||||
ip->i_size = 0;
|
||||
DIP_SET(ip, i_size, 0);
|
||||
UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE);
|
||||
|
@ -501,7 +501,7 @@ ffs_truncate(struct vnode *vp,
|
|||
size = blksize(fs, ip, lbn);
|
||||
if (vp->v_type != VDIR && offset != 0)
|
||||
bzero((char *)bp->b_data + offset,
|
||||
(u_int)(size - offset));
|
||||
(uint64_t)(size - offset));
|
||||
/* Kirk's code has reallocbuf(bp, size, 1) here */
|
||||
allocbuf(bp, size);
|
||||
if (bp->b_bufsize == fs->fs_bsize)
|
||||
|
@ -704,7 +704,7 @@ ffs_indirtrunc(struct inode *ip,
|
|||
struct ufsmount *ump;
|
||||
struct vnode *vp;
|
||||
caddr_t copy = NULL;
|
||||
u_long key;
|
||||
uint64_t key;
|
||||
int i, nblocks, error = 0, allerror = 0;
|
||||
ufs2_daddr_t nb, nlbn, last;
|
||||
ufs2_daddr_t blkcount, factor, blocksreleased = 0;
|
||||
|
@ -747,7 +747,7 @@ ffs_indirtrunc(struct inode *ip,
|
|||
bap2 = (ufs2_daddr_t *)bp->b_data;
|
||||
if (lastbn != -1) {
|
||||
copy = malloc(fs->fs_bsize, M_TEMP, M_WAITOK);
|
||||
bcopy((caddr_t)bp->b_data, copy, (u_int)fs->fs_bsize);
|
||||
bcopy((caddr_t)bp->b_data, copy, (uint64_t)fs->fs_bsize);
|
||||
for (i = last + 1; i < NINDIR(fs); i++)
|
||||
if (I_IS_UFS1(ip))
|
||||
bap1[i] = 0;
|
||||
|
|
|
@ -192,7 +192,7 @@ ffs_rawread_readahead(struct vnode *vp,
|
|||
struct buf *bp)
|
||||
{
|
||||
int error;
|
||||
u_int iolen;
|
||||
uint64_t iolen;
|
||||
off_t blockno;
|
||||
int blockoff;
|
||||
int bsize;
|
||||
|
@ -264,7 +264,7 @@ ffs_rawread_main(struct vnode *vp,
|
|||
{
|
||||
int error, nerror;
|
||||
struct buf *bp, *nbp, *tbp;
|
||||
u_int iolen;
|
||||
uint64_t iolen;
|
||||
caddr_t udata;
|
||||
long resid;
|
||||
off_t offset;
|
||||
|
|
|
@ -376,7 +376,7 @@ ffs_snapshot(struct mount *mp, char *snapfile)
|
|||
* touch up the few cylinder groups that changed during
|
||||
* the suspension period.
|
||||
*/
|
||||
len = roundup2(howmany(fs->fs_ncg, NBBY), sizeof(int));
|
||||
len = roundup2(howmany(fs->fs_ncg, NBBY), sizeof(uint64_t));
|
||||
space = malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
UFS_LOCK(ump);
|
||||
fs->fs_active = space;
|
||||
|
@ -467,7 +467,7 @@ ffs_snapshot(struct mount *mp, char *snapfile)
|
|||
* Grab a copy of the superblock and its summary information.
|
||||
* We delay writing it until the suspension is released below.
|
||||
*/
|
||||
copy_fs = malloc((u_long)fs->fs_bsize, M_UFSMNT, M_WAITOK);
|
||||
copy_fs = malloc((uint64_t)fs->fs_bsize, M_UFSMNT, M_WAITOK);
|
||||
bcopy(fs, copy_fs, fs->fs_sbsize);
|
||||
copy_fs->fs_si = malloc(sizeof(struct fs_summary_info), M_UFSMNT,
|
||||
M_ZERO | M_WAITOK);
|
||||
|
@ -480,7 +480,7 @@ ffs_snapshot(struct mount *mp, char *snapfile)
|
|||
size = blkroundup(fs, fs->fs_cssize);
|
||||
if (fs->fs_contigsumsize > 0)
|
||||
size += fs->fs_ncg * sizeof(int32_t);
|
||||
space = malloc((u_long)size, M_UFSMNT, M_WAITOK);
|
||||
space = malloc((uint64_t)size, M_UFSMNT, M_WAITOK);
|
||||
copy_fs->fs_csp = space;
|
||||
bcopy(fs->fs_csp, copy_fs->fs_csp, fs->fs_cssize);
|
||||
space = (char *)space + fs->fs_cssize;
|
||||
|
@ -493,7 +493,7 @@ ffs_snapshot(struct mount *mp, char *snapfile)
|
|||
brelse(bp);
|
||||
goto resumefs;
|
||||
}
|
||||
bcopy(bp->b_data, space, (u_int)len);
|
||||
bcopy(bp->b_data, space, (uint64_t)len);
|
||||
space = (char *)space + len;
|
||||
bp->b_flags |= B_INVAL | B_NOCACHE;
|
||||
brelse(bp);
|
||||
|
@ -829,7 +829,7 @@ ffs_snapshot(struct mount *mp, char *snapfile)
|
|||
loc = blkoff(fs, fs->fs_sblockloc);
|
||||
copy_fs->fs_fmod = 0;
|
||||
bpfs = (struct fs *)&nbp->b_data[loc];
|
||||
bcopy((caddr_t)copy_fs, (caddr_t)bpfs, (u_int)fs->fs_sbsize);
|
||||
bcopy((caddr_t)copy_fs, (caddr_t)bpfs, (uint64_t)fs->fs_sbsize);
|
||||
ffs_oldfscompat_write(bpfs, ump);
|
||||
bpfs->fs_ckhash = ffs_calc_sbhash(bpfs);
|
||||
bawrite(nbp);
|
||||
|
|
|
@ -831,7 +831,7 @@ static void cancel_allocdirect(struct allocdirectlst *,
|
|||
struct allocdirect *, struct freeblks *);
|
||||
static int check_inode_unwritten(struct inodedep *);
|
||||
static int free_inodedep(struct inodedep *);
|
||||
static void freework_freeblock(struct freework *, u_long);
|
||||
static void freework_freeblock(struct freework *, uint64_t);
|
||||
static void freework_enqueue(struct freework *);
|
||||
static int handle_workitem_freeblocks(struct freeblks *, int);
|
||||
static int handle_complete_freeblocks(struct freeblks *, int);
|
||||
|
@ -846,7 +846,7 @@ static struct allocindir *newallocindir(struct inode *, int, ufs2_daddr_t,
|
|||
ufs2_daddr_t, ufs_lbn_t);
|
||||
static void handle_workitem_freefrag(struct freefrag *);
|
||||
static struct freefrag *newfreefrag(struct inode *, ufs2_daddr_t, long,
|
||||
ufs_lbn_t, u_long);
|
||||
ufs_lbn_t, uint64_t);
|
||||
static void allocdirect_merge(struct allocdirectlst *,
|
||||
struct allocdirect *, struct allocdirect *);
|
||||
static struct freefrag *allocindir_merge(struct allocindir *,
|
||||
|
@ -1568,7 +1568,7 @@ worklist_speedup(struct mount *mp)
|
|||
static void
|
||||
softdep_send_speedup(struct ufsmount *ump,
|
||||
off_t shortage,
|
||||
u_int flags)
|
||||
uint64_t flags)
|
||||
{
|
||||
struct buf *bp;
|
||||
|
||||
|
@ -2586,7 +2586,7 @@ softdep_mount(struct vnode *devvp,
|
|||
struct ufsmount *ump;
|
||||
struct cg *cgp;
|
||||
struct buf *bp;
|
||||
u_int cyl, i;
|
||||
uint64_t cyl, i;
|
||||
int error;
|
||||
|
||||
ump = VFSTOUFS(mp);
|
||||
|
@ -2751,8 +2751,8 @@ softdep_unmount(struct mount *mp)
|
|||
#ifdef INVARIANTS
|
||||
for (int i = 0; i <= D_LAST; i++) {
|
||||
KASSERT(ums->sd_curdeps[i] == 0,
|
||||
("Unmount %s: Dep type %s != 0 (%ld)", ump->um_fs->fs_fsmnt,
|
||||
TYPENAME(i), ums->sd_curdeps[i]));
|
||||
("Unmount %s: Dep type %s != 0 (%jd)", ump->um_fs->fs_fsmnt,
|
||||
TYPENAME(i), (intmax_t)ums->sd_curdeps[i]));
|
||||
KASSERT(LIST_EMPTY(&ums->sd_alldeps[i]),
|
||||
("Unmount %s: Dep type %s not empty (%p)",
|
||||
ump->um_fs->fs_fsmnt,
|
||||
|
@ -5795,7 +5795,7 @@ newfreefrag(struct inode *ip,
|
|||
ufs2_daddr_t blkno,
|
||||
long size,
|
||||
ufs_lbn_t lbn,
|
||||
u_long key)
|
||||
uint64_t key)
|
||||
{
|
||||
struct freefrag *freefrag;
|
||||
struct ufsmount *ump;
|
||||
|
@ -7954,7 +7954,7 @@ free_inodedep(struct inodedep *inodedep)
|
|||
* in memory immediately.
|
||||
*/
|
||||
static void
|
||||
freework_freeblock(struct freework *freework, u_long key)
|
||||
freework_freeblock(struct freework *freework, uint64_t key)
|
||||
{
|
||||
struct freeblks *freeblks;
|
||||
struct jnewblk *jnewblk;
|
||||
|
@ -8118,7 +8118,7 @@ handle_workitem_freeblocks(struct freeblks *freeblks, int flags)
|
|||
struct allocindir *aip;
|
||||
struct ufsmount *ump;
|
||||
struct worklist *wk;
|
||||
u_long key;
|
||||
uint64_t key;
|
||||
|
||||
KASSERT(LIST_EMPTY(&freeblks->fb_jblkdephd),
|
||||
("handle_workitem_freeblocks: Journal entries not written."));
|
||||
|
@ -8306,7 +8306,7 @@ indir_trunc(struct freework *freework,
|
|||
ufs1_daddr_t *bap1;
|
||||
ufs2_daddr_t nb, nnb, *bap2;
|
||||
ufs_lbn_t lbnadd, nlbn;
|
||||
u_long key;
|
||||
uint64_t key;
|
||||
int nblocks, ufs1fmt, freedblocks;
|
||||
int goingaway, freedeps, needj, level, cnt, i, error;
|
||||
|
||||
|
@ -9924,7 +9924,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep)
|
|||
* that is in the list.
|
||||
*/
|
||||
if (pino == 0) {
|
||||
bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize);
|
||||
bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize);
|
||||
bpfs = (struct fs *)bp->b_data;
|
||||
ffs_oldfscompat_write(bpfs, ump);
|
||||
softdep_setup_sbupdate(ump, bpfs, bp);
|
||||
|
@ -9956,7 +9956,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep)
|
|||
FREE_LOCK(ump);
|
||||
bp = getblk(ump->um_devvp, btodb(fs->fs_sblockloc),
|
||||
(int)fs->fs_sbsize, 0, 0, 0);
|
||||
bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize);
|
||||
bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize);
|
||||
bpfs = (struct fs *)bp->b_data;
|
||||
ffs_oldfscompat_write(bpfs, ump);
|
||||
softdep_setup_sbupdate(ump, bpfs, bp);
|
||||
|
@ -14779,11 +14779,11 @@ worklist_print(struct worklist *wk, int verbose)
|
|||
|
||||
if (!verbose) {
|
||||
db_printf("%s: %p state 0x%b\n", TYPENAME(wk->wk_type), wk,
|
||||
(u_int)wk->wk_state, PRINT_SOFTDEP_FLAGS);
|
||||
wk->wk_state, PRINT_SOFTDEP_FLAGS);
|
||||
return;
|
||||
}
|
||||
db_printf("worklist: %p type %s state 0x%b next %p\n ", wk,
|
||||
TYPENAME(wk->wk_type), (u_int)wk->wk_state, PRINT_SOFTDEP_FLAGS,
|
||||
TYPENAME(wk->wk_type), wk->wk_state, PRINT_SOFTDEP_FLAGS,
|
||||
LIST_NEXT(wk, wk_list));
|
||||
db_print_ffs(VFSTOUFS(wk->wk_mp));
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t sblock, int flags,
|
|||
blks = howmany(size, fs->fs_fsize);
|
||||
if (fs->fs_contigsumsize > 0)
|
||||
size += fs->fs_ncg * sizeof(int32_t);
|
||||
size += fs->fs_ncg * sizeof(u_int8_t);
|
||||
size += fs->fs_ncg * sizeof(uint8_t);
|
||||
if ((fs_si = UFS_MALLOC(sizeof(*fs_si), filltype, M_NOWAIT)) == NULL) {
|
||||
UFS_FREE(fs, filltype);
|
||||
return (ENOMEM);
|
||||
|
@ -238,8 +238,8 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t sblock, int flags,
|
|||
*lp++ = fs->fs_contigsumsize;
|
||||
space = (uint8_t *)lp;
|
||||
}
|
||||
size = fs->fs_ncg * sizeof(u_int8_t);
|
||||
fs->fs_contigdirs = (u_int8_t *)space;
|
||||
size = fs->fs_ncg * sizeof(uint8_t);
|
||||
fs->fs_contigdirs = (uint8_t *)space;
|
||||
bzero(fs->fs_contigdirs, size);
|
||||
*fsp = fs;
|
||||
return (0);
|
||||
|
@ -366,8 +366,8 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int flags,
|
|||
static int
|
||||
validate_sblock(struct fs *fs, int flags)
|
||||
{
|
||||
u_long i, sectorsize;
|
||||
u_int64_t maxfilesize, sizepb;
|
||||
uint64_t i, sectorsize;
|
||||
uint64_t maxfilesize, sizepb;
|
||||
int error, prtmsg, warnerr;
|
||||
char *wmsg;
|
||||
|
||||
|
@ -428,13 +428,13 @@ validate_sblock(struct fs *fs, int flags)
|
|||
/* Only need to validate these if reading in csum data */
|
||||
if ((flags & UFS_NOCSUM) != 0)
|
||||
return (error);
|
||||
FCHK((u_int64_t)fs->fs_ipg * fs->fs_ncg, >,
|
||||
FCHK((uint64_t)fs->fs_ipg * fs->fs_ncg, >,
|
||||
(((int64_t)(1)) << 32) - INOPB(fs), %jd);
|
||||
FCHK(fs->fs_cstotal.cs_nifree, <, 0, %jd);
|
||||
FCHK(fs->fs_cstotal.cs_nifree, >,
|
||||
(u_int64_t)fs->fs_ipg * fs->fs_ncg, %jd);
|
||||
(uint64_t)fs->fs_ipg * fs->fs_ncg, %jd);
|
||||
FCHK(fs->fs_cstotal.cs_ndir, >,
|
||||
((u_int64_t)fs->fs_ipg * fs->fs_ncg) -
|
||||
((uint64_t)fs->fs_ipg * fs->fs_ncg) -
|
||||
fs->fs_cstotal.cs_nifree, %jd);
|
||||
FCHK(fs->fs_size, <, 8 * fs->fs_frag, %jd);
|
||||
FCHK(fs->fs_size, <=, ((int64_t)fs->fs_ncg - 1) * fs->fs_fpg,
|
||||
|
@ -504,14 +504,14 @@ validate_sblock(struct fs *fs, int flags)
|
|||
FCHK(fs->fs_fpg, <, 3 * fs->fs_frag, %jd);
|
||||
FCHK(fs->fs_ncg, <, 1, %jd);
|
||||
FCHK(fs->fs_ipg, <, fs->fs_inopb, %jd);
|
||||
FCHK((u_int64_t)fs->fs_ipg * fs->fs_ncg, >,
|
||||
FCHK((uint64_t)fs->fs_ipg * fs->fs_ncg, >,
|
||||
(((int64_t)(1)) << 32) - INOPB(fs), %jd);
|
||||
FCHK(fs->fs_cstotal.cs_nifree, <, 0, %jd);
|
||||
FCHK(fs->fs_cstotal.cs_nifree, >, (u_int64_t)fs->fs_ipg * fs->fs_ncg,
|
||||
FCHK(fs->fs_cstotal.cs_nifree, >, (uint64_t)fs->fs_ipg * fs->fs_ncg,
|
||||
%jd);
|
||||
FCHK(fs->fs_cstotal.cs_ndir, <, 0, %jd);
|
||||
FCHK(fs->fs_cstotal.cs_ndir, >,
|
||||
((u_int64_t)fs->fs_ipg * fs->fs_ncg) - fs->fs_cstotal.cs_nifree,
|
||||
((uint64_t)fs->fs_ipg * fs->fs_ncg) - fs->fs_cstotal.cs_nifree,
|
||||
%jd);
|
||||
FCHK(fs->fs_sbsize, >, SBLOCKSIZE, %jd);
|
||||
FCHK(fs->fs_sbsize, <, (signed)sizeof(struct fs), %jd);
|
||||
|
@ -944,7 +944,7 @@ ffs_isblock(struct fs *fs, unsigned char *cp, ufs1_daddr_t h)
|
|||
* check if a block is free
|
||||
*/
|
||||
int
|
||||
ffs_isfreeblock(struct fs *fs, u_char *cp, ufs1_daddr_t h)
|
||||
ffs_isfreeblock(struct fs *fs, uint8_t *cp, ufs1_daddr_t h)
|
||||
{
|
||||
|
||||
switch ((int)fs->fs_frag) {
|
||||
|
@ -969,7 +969,7 @@ ffs_isfreeblock(struct fs *fs, u_char *cp, ufs1_daddr_t h)
|
|||
* take a block out of the map
|
||||
*/
|
||||
void
|
||||
ffs_clrblock(struct fs *fs, u_char *cp, ufs1_daddr_t h)
|
||||
ffs_clrblock(struct fs *fs, uint8_t *cp, ufs1_daddr_t h)
|
||||
{
|
||||
|
||||
switch ((int)fs->fs_frag) {
|
||||
|
@ -1031,9 +1031,9 @@ ffs_clusteracct(struct fs *fs, struct cg *cgp, ufs1_daddr_t blkno, int cnt)
|
|||
{
|
||||
int32_t *sump;
|
||||
int32_t *lp;
|
||||
u_char *freemapp, *mapp;
|
||||
uint8_t *freemapp, *mapp;
|
||||
int i, start, end, forw, back, map;
|
||||
u_int bit;
|
||||
uint64_t bit;
|
||||
|
||||
if (fs->fs_contigsumsize <= 0)
|
||||
return;
|
||||
|
|
|
@ -62,7 +62,7 @@ int inside[9] = {
|
|||
* These tables are used by the scanc instruction on the VAX to
|
||||
* quickly find an appropriate fragment.
|
||||
*/
|
||||
static u_char fragtbl124[256] = {
|
||||
static uint8_t fragtbl124[256] = {
|
||||
0x00, 0x16, 0x16, 0x2a, 0x16, 0x16, 0x26, 0x4e,
|
||||
0x16, 0x16, 0x16, 0x3e, 0x2a, 0x3e, 0x4e, 0x8a,
|
||||
0x16, 0x16, 0x16, 0x3e, 0x16, 0x16, 0x36, 0x5e,
|
||||
|
@ -97,7 +97,7 @@ static u_char fragtbl124[256] = {
|
|||
0x9e, 0x9e, 0x9e, 0xbe, 0xaa, 0xbe, 0xce, 0x8a,
|
||||
};
|
||||
|
||||
static u_char fragtbl8[256] = {
|
||||
static uint8_t fragtbl8[256] = {
|
||||
0x00, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x04,
|
||||
0x01, 0x01, 0x01, 0x03, 0x02, 0x03, 0x04, 0x08,
|
||||
0x01, 0x01, 0x01, 0x03, 0x01, 0x01, 0x03, 0x05,
|
||||
|
@ -135,6 +135,6 @@ static u_char fragtbl8[256] = {
|
|||
/*
|
||||
* The actual fragtbl array.
|
||||
*/
|
||||
u_char *fragtbl[MAXFRAG + 1] = {
|
||||
uint8_t *fragtbl[MAXFRAG + 1] = {
|
||||
0, fragtbl124, fragtbl124, 0, fragtbl124, 0, 0, 0, fragtbl8,
|
||||
};
|
||||
|
|
|
@ -759,7 +759,7 @@ ffs_reload(struct mount *mp, int flags)
|
|||
struct ufsmount *ump;
|
||||
ufs2_daddr_t sblockloc;
|
||||
int i, blks, error;
|
||||
u_long size;
|
||||
uint64_t size;
|
||||
int32_t *lp;
|
||||
|
||||
ump = VFSTOUFS(mp);
|
||||
|
@ -803,7 +803,7 @@ ffs_reload(struct mount *mp, int flags)
|
|||
newfs->fs_si = fs->fs_si;
|
||||
newfs->fs_ronly = fs->fs_ronly;
|
||||
sblockloc = fs->fs_sblockloc;
|
||||
bcopy(newfs, fs, (u_int)fs->fs_sbsize);
|
||||
bcopy(newfs, fs, (uint64_t)fs->fs_sbsize);
|
||||
brelse(bp);
|
||||
ump->um_bsize = fs->fs_bsize;
|
||||
ump->um_maxsymlinklen = fs->fs_maxsymlinklen;
|
||||
|
@ -825,7 +825,7 @@ ffs_reload(struct mount *mp, int flags)
|
|||
blks = howmany(size, fs->fs_fsize);
|
||||
if (fs->fs_contigsumsize > 0)
|
||||
size += fs->fs_ncg * sizeof(int32_t);
|
||||
size += fs->fs_ncg * sizeof(u_int8_t);
|
||||
size += fs->fs_ncg * sizeof(uint8_t);
|
||||
free(fs->fs_csp, M_UFSMNT);
|
||||
space = malloc(size, M_UFSMNT, M_WAITOK);
|
||||
fs->fs_csp = space;
|
||||
|
@ -837,7 +837,7 @@ ffs_reload(struct mount *mp, int flags)
|
|||
NOCRED, &bp);
|
||||
if (error)
|
||||
return (error);
|
||||
bcopy(bp->b_data, space, (u_int)size);
|
||||
bcopy(bp->b_data, space, (uint64_t)size);
|
||||
space = (char *)space + size;
|
||||
brelse(bp);
|
||||
}
|
||||
|
@ -850,8 +850,8 @@ ffs_reload(struct mount *mp, int flags)
|
|||
*lp++ = fs->fs_contigsumsize;
|
||||
space = lp;
|
||||
}
|
||||
size = fs->fs_ncg * sizeof(u_int8_t);
|
||||
fs->fs_contigdirs = (u_int8_t *)space;
|
||||
size = fs->fs_ncg * sizeof(uint8_t);
|
||||
fs->fs_contigdirs = (uint8_t *)space;
|
||||
bzero(fs->fs_contigdirs, size);
|
||||
if ((flags & FFSR_UNSUSPEND) != 0) {
|
||||
MNT_ILOCK(mp);
|
||||
|
@ -1006,7 +1006,7 @@ ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td)
|
|||
* Get journal provider name.
|
||||
*/
|
||||
len = 1024;
|
||||
mp->mnt_gjprovider = malloc((u_long)len, M_UFSMNT, M_WAITOK);
|
||||
mp->mnt_gjprovider = malloc((uint64_t)len, M_UFSMNT, M_WAITOK);
|
||||
if (g_io_getattr("GJOURNAL::provider", cp, &len,
|
||||
mp->mnt_gjprovider) == 0) {
|
||||
mp->mnt_gjprovider = realloc(mp->mnt_gjprovider, len,
|
||||
|
@ -2052,7 +2052,7 @@ ffs_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp)
|
|||
int
|
||||
ffs_inotovp(struct mount *mp,
|
||||
ino_t ino,
|
||||
u_int64_t gen,
|
||||
uint64_t gen,
|
||||
int lflags,
|
||||
struct vnode **vpp,
|
||||
int ffs_flags)
|
||||
|
@ -2063,7 +2063,7 @@ ffs_inotovp(struct mount *mp,
|
|||
struct fs *fs;
|
||||
struct cg *cgp;
|
||||
struct buf *bp;
|
||||
u_int cg;
|
||||
uint64_t cg;
|
||||
int error;
|
||||
|
||||
ump = VFSTOUFS(mp);
|
||||
|
@ -2196,7 +2196,7 @@ ffs_use_bwrite(void *devfd, off_t loc, void *buf, int size)
|
|||
*/
|
||||
if (loc != fs->fs_sblockloc) {
|
||||
bp = getblk(ump->um_devvp, btodb(loc), size, 0, 0, 0);
|
||||
bcopy(buf, bp->b_data, (u_int)size);
|
||||
bcopy(buf, bp->b_data, (uint64_t)size);
|
||||
if (devfdp->suspended)
|
||||
bp->b_flags |= B_VALIDSUSPWRT;
|
||||
if (devfdp->waitfor != MNT_WAIT)
|
||||
|
@ -2230,7 +2230,7 @@ ffs_use_bwrite(void *devfd, off_t loc, void *buf, int size)
|
|||
if (MOUNTEDSOFTDEP(ump->um_mountp))
|
||||
softdep_setup_sbupdate(ump, (struct fs *)bp->b_data, bp);
|
||||
UFS_LOCK(ump);
|
||||
bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize);
|
||||
bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize);
|
||||
UFS_UNLOCK(ump);
|
||||
fs = (struct fs *)bp->b_data;
|
||||
fs->fs_fmod = 0;
|
||||
|
@ -2565,8 +2565,7 @@ ffs_geom_strategy(struct bufobj *bo, struct buf *bp)
|
|||
|
||||
default:
|
||||
printf("multiple buffer types 0x%b\n",
|
||||
(u_int)(bp->b_xflags & BX_FSPRIV),
|
||||
PRINT_UFS_BUF_XFLAGS);
|
||||
(bp->b_xflags & BX_FSPRIV), PRINT_UFS_BUF_XFLAGS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -763,7 +763,7 @@ ffs_read(
|
|||
* arguments point to arrays of the size specified in
|
||||
* the 6th argument.
|
||||
*/
|
||||
u_int nextsize = blksize(fs, ip, nextlbn);
|
||||
int nextsize = blksize(fs, ip, nextlbn);
|
||||
error = breadn_flags(vp, lbn, lbn, size, &nextlbn,
|
||||
&nextsize, 1, NOCRED, bflag, NULL, &bp);
|
||||
} else {
|
||||
|
@ -1127,8 +1127,7 @@ ffs_extread(struct vnode *vp, struct uio *uio, int ioflag)
|
|||
* arguments point to arrays of the size specified in
|
||||
* the 6th argument.
|
||||
*/
|
||||
u_int nextsize = sblksize(fs, dp->di_extsize, nextlbn);
|
||||
|
||||
int nextsize = sblksize(fs, dp->di_extsize, nextlbn);
|
||||
nextlbn = -1 - nextlbn;
|
||||
error = breadn(vp, -1 - lbn,
|
||||
size, &nextlbn, &nextsize, 1, NOCRED, &bp);
|
||||
|
@ -1304,8 +1303,8 @@ ffs_extwrite(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *ucred)
|
|||
* the length of the EA, and possibly the pointer to the entry and to the data.
|
||||
*/
|
||||
static int
|
||||
ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name,
|
||||
struct extattr **eapp, u_char **eac)
|
||||
ffs_findextattr(uint8_t *ptr, uint64_t length, int nspace, const char *name,
|
||||
struct extattr **eapp, uint8_t **eac)
|
||||
{
|
||||
struct extattr *eap, *eaend;
|
||||
size_t nlen;
|
||||
|
@ -1330,7 +1329,7 @@ ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name,
|
|||
}
|
||||
|
||||
static int
|
||||
ffs_rdextattr(u_char **p, struct vnode *vp, struct thread *td)
|
||||
ffs_rdextattr(uint8_t **p, struct vnode *vp, struct thread *td)
|
||||
{
|
||||
const struct extattr *eap, *eaend, *eapnext;
|
||||
struct inode *ip;
|
||||
|
@ -1338,9 +1337,9 @@ ffs_rdextattr(u_char **p, struct vnode *vp, struct thread *td)
|
|||
struct fs *fs;
|
||||
struct uio luio;
|
||||
struct iovec liovec;
|
||||
u_int easize;
|
||||
uint64_t easize;
|
||||
int error;
|
||||
u_char *eae;
|
||||
uint8_t *eae;
|
||||
|
||||
ip = VTOI(vp);
|
||||
fs = ITOFS(ip);
|
||||
|
@ -1371,7 +1370,7 @@ ffs_rdextattr(u_char **p, struct vnode *vp, struct thread *td)
|
|||
eap = eapnext) {
|
||||
/* Detect zeroed out tail */
|
||||
if (eap->ea_length < sizeof(*eap) || eap->ea_length == 0) {
|
||||
easize = (const u_char *)eap - eae;
|
||||
easize = (const uint8_t *)eap - eae;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1604,7 +1603,7 @@ ffs_deleteextattr(
|
|||
struct extattr *eap;
|
||||
uint32_t ul;
|
||||
int olen, error, i, easize;
|
||||
u_char *eae;
|
||||
uint8_t *eae;
|
||||
void *tmp;
|
||||
|
||||
vp = ap->a_vp;
|
||||
|
@ -1654,7 +1653,7 @@ ffs_deleteextattr(
|
|||
return (ENOATTR);
|
||||
}
|
||||
ul = eap->ea_length;
|
||||
i = (u_char *)EXTATTR_NEXT(eap) - eae;
|
||||
i = (uint8_t *)EXTATTR_NEXT(eap) - eae;
|
||||
bcopy(EXTATTR_NEXT(eap), eap, easize - i);
|
||||
easize -= ul;
|
||||
|
||||
|
@ -1682,7 +1681,7 @@ ffs_getextattr(
|
|||
} */ *ap)
|
||||
{
|
||||
struct inode *ip;
|
||||
u_char *eae, *p;
|
||||
uint8_t *eae, *p;
|
||||
unsigned easize;
|
||||
int error, ealen;
|
||||
|
||||
|
@ -1796,7 +1795,7 @@ ffs_setextattr(
|
|||
uint32_t ealength, ul;
|
||||
ssize_t ealen;
|
||||
int olen, eapad1, eapad2, error, i, easize;
|
||||
u_char *eae;
|
||||
uint8_t *eae;
|
||||
void *tmp;
|
||||
|
||||
vp = ap->a_vp;
|
||||
|
@ -1866,9 +1865,9 @@ ffs_setextattr(
|
|||
easize += ealength;
|
||||
} else {
|
||||
ul = eap->ea_length;
|
||||
i = (u_char *)EXTATTR_NEXT(eap) - eae;
|
||||
i = (uint8_t *)EXTATTR_NEXT(eap) - eae;
|
||||
if (ul != ealength) {
|
||||
bcopy(EXTATTR_NEXT(eap), (u_char *)eap + ealength,
|
||||
bcopy(EXTATTR_NEXT(eap), (uint8_t *)eap + ealength,
|
||||
easize - i);
|
||||
easize += (ealength - ul);
|
||||
}
|
||||
|
@ -1894,7 +1893,7 @@ ffs_setextattr(
|
|||
ip->i_ea_error = error;
|
||||
return (error);
|
||||
}
|
||||
bzero((u_char *)EXTATTR_CONTENT(eap) + ealen, eapad2);
|
||||
bzero((uint8_t *)EXTATTR_CONTENT(eap) + ealen, eapad2);
|
||||
|
||||
tmp = ip->i_ea_area;
|
||||
ip->i_ea_area = eae;
|
||||
|
@ -1996,7 +1995,7 @@ ffs_vput_pair(struct vop_vput_pair_args *ap)
|
|||
struct vnode *dvp, *vp, *vp1, **vpp;
|
||||
struct inode *dp, *ip;
|
||||
ino_t ip_ino;
|
||||
u_int64_t ip_gen;
|
||||
uint64_t ip_gen;
|
||||
int error, vp_locked;
|
||||
|
||||
dvp = ap->a_dvp;
|
||||
|
|
|
@ -287,7 +287,7 @@ struct fsrecovery {
|
|||
int32_t fsr_fsbtodb; /* fsbtodb and dbtofsb shift constant */
|
||||
int32_t fsr_sblkno; /* offset of super-block in filesys */
|
||||
int32_t fsr_fpg; /* blocks per group * fs_frag */
|
||||
u_int32_t fsr_ncg; /* number of cylinder groups */
|
||||
uint32_t fsr_ncg; /* number of cylinder groups */
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -330,7 +330,7 @@ struct fs_summary_info {
|
|||
uint8_t *si_contigdirs; /* (u) # of contig. allocated dirs */
|
||||
struct csum *si_csp; /* (u) cg summary info buffer */
|
||||
int32_t *si_maxcluster; /* (u) max cluster in each cyl group */
|
||||
u_int *si_active; /* (u) used by snapshots to track fs */
|
||||
uint64_t *si_active; /* (u) used by snapshots to track fs */
|
||||
};
|
||||
#define fs_contigdirs fs_si->si_contigdirs
|
||||
#define fs_csp fs_si->si_csp
|
||||
|
@ -352,7 +352,7 @@ struct fs {
|
|||
int32_t fs_old_time; /* last time written */
|
||||
int32_t fs_old_size; /* number of blocks in fs */
|
||||
int32_t fs_old_dsize; /* number of data blocks in fs */
|
||||
u_int32_t fs_ncg; /* number of cylinder groups */
|
||||
uint32_t fs_ncg; /* number of cylinder groups */
|
||||
int32_t fs_bsize; /* size of basic blocks in fs */
|
||||
int32_t fs_fsize; /* size of frag blocks in fs */
|
||||
int32_t fs_frag; /* number of frags in a block in fs */
|
||||
|
@ -375,7 +375,7 @@ struct fs {
|
|||
int32_t fs_spare1[2]; /* old fs_csmask */
|
||||
/* old fs_csshift */
|
||||
int32_t fs_nindir; /* value of NINDIR */
|
||||
u_int32_t fs_inopb; /* value of INOPB */
|
||||
uint32_t fs_inopb; /* value of INOPB */
|
||||
int32_t fs_old_nspf; /* value of NSPF */
|
||||
/* yet another configuration parameter */
|
||||
int32_t fs_optim; /* optimization preference, see below */
|
||||
|
@ -392,7 +392,7 @@ struct fs {
|
|||
int32_t fs_old_spc; /* sectors per cylinder */
|
||||
int32_t fs_old_ncyl; /* cylinders in filesystem */
|
||||
int32_t fs_old_cpg; /* cylinders per group */
|
||||
u_int32_t fs_ipg; /* inodes per group */
|
||||
uint32_t fs_ipg; /* inodes per group */
|
||||
int32_t fs_fpg; /* blocks per group * fs_frag */
|
||||
/* this data must be re-computed after crashes */
|
||||
struct csum fs_old_cstotal; /* cylinder summary information */
|
||||
|
@ -401,9 +401,9 @@ struct fs {
|
|||
int8_t fs_clean; /* filesystem is clean flag */
|
||||
int8_t fs_ronly; /* mounted read-only flag */
|
||||
int8_t fs_old_flags; /* old FS_ flags */
|
||||
u_char fs_fsmnt[MAXMNTLEN]; /* name mounted on */
|
||||
u_char fs_volname[MAXVOLLEN]; /* volume name */
|
||||
u_int64_t fs_swuid; /* system-wide uid */
|
||||
uint8_t fs_fsmnt[MAXMNTLEN]; /* name mounted on */
|
||||
uint8_t fs_volname[MAXVOLLEN]; /* volume name */
|
||||
uint64_t fs_swuid; /* system-wide uid */
|
||||
int32_t fs_pad; /* due to alignment of fs_swuid */
|
||||
/* these fields retain the current block allocation info */
|
||||
int32_t fs_cgrotor; /* last cg searched */
|
||||
|
@ -423,21 +423,21 @@ struct fs {
|
|||
int64_t fs_dsize; /* number of data blocks in fs */
|
||||
ufs2_daddr_t fs_csaddr; /* blk addr of cyl grp summary area */
|
||||
int64_t fs_pendingblocks; /* (u) blocks being freed */
|
||||
u_int32_t fs_pendinginodes; /* (u) inodes being freed */
|
||||
uint32_t fs_pendinginodes; /* (u) inodes being freed */
|
||||
uint32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */
|
||||
u_int32_t fs_avgfilesize; /* expected average file size */
|
||||
u_int32_t fs_avgfpdir; /* expected # of files per directory */
|
||||
uint32_t fs_avgfilesize; /* expected average file size */
|
||||
uint32_t fs_avgfpdir; /* expected # of files per directory */
|
||||
int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */
|
||||
ufs_time_t fs_mtime; /* Last mount or fsck time. */
|
||||
int32_t fs_sujfree; /* SUJ free list */
|
||||
int32_t fs_sparecon32[21]; /* reserved for future constants */
|
||||
u_int32_t fs_ckhash; /* if CK_SUPERBLOCK, its check-hash */
|
||||
u_int32_t fs_metackhash; /* metadata check-hash, see CK_ below */
|
||||
uint32_t fs_ckhash; /* if CK_SUPERBLOCK, its check-hash */
|
||||
uint32_t fs_metackhash; /* metadata check-hash, see CK_ below */
|
||||
int32_t fs_flags; /* see FS_ flags below */
|
||||
int32_t fs_contigsumsize; /* size of cluster summary array */
|
||||
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 */
|
||||
uint64_t fs_maxfilesize; /* maximum representable file size */
|
||||
int64_t fs_qbmask; /* ~fs_bmask for use with 64-bit size */
|
||||
int64_t fs_qfmask; /* ~fs_fmask for use with 64-bit size */
|
||||
int32_t fs_state; /* validate fs_clean field */
|
||||
|
@ -556,9 +556,9 @@ CTASSERT(sizeof(struct fs) == 1376);
|
|||
/*
|
||||
* Macros to access bits in the fs_active array.
|
||||
*/
|
||||
#define ACTIVECGNUM(fs, cg) ((fs)->fs_active[(cg) / (NBBY * sizeof(int))])
|
||||
#define ACTIVECGOFF(cg) (1 << ((cg) % (NBBY * sizeof(int))))
|
||||
#define ACTIVESET(fs, cg) do { \
|
||||
#define ACTIVECGNUM(fs, cg) ((fs)->fs_active[(cg) / (NBBY * sizeof(uint64_t))])
|
||||
#define ACTIVECGOFF(cg) (1 << ((cg) % (NBBY * sizeof(uint64_t))))
|
||||
#define ACTIVESET(fs, cg) do { \
|
||||
if ((fs)->fs_active) \
|
||||
ACTIVECGNUM((fs), (cg)) |= ACTIVECGOFF((cg)); \
|
||||
} while (0)
|
||||
|
@ -576,7 +576,7 @@ CTASSERT(sizeof(struct fs) == 1376);
|
|||
#define CGSIZE(fs) \
|
||||
/* base cg */ (sizeof(struct cg) + \
|
||||
/* old btotoff */ (fs)->fs_old_cpg * sizeof(int32_t) + \
|
||||
/* old boff */ (fs)->fs_old_cpg * sizeof(u_int16_t) + \
|
||||
/* old boff */ (fs)->fs_old_cpg * sizeof(uint16_t) + \
|
||||
/* inode map */ howmany((fs)->fs_ipg, NBBY) + \
|
||||
/* block map */ howmany((fs)->fs_fpg, NBBY) + sizeof(int32_t) + \
|
||||
/* if present */ ((fs)->fs_contigsumsize <= 0 ? 0 : \
|
||||
|
@ -601,28 +601,28 @@ struct cg {
|
|||
int32_t cg_firstfield; /* historic cyl groups linked list */
|
||||
int32_t cg_magic; /* magic number */
|
||||
int32_t cg_old_time; /* time last written */
|
||||
u_int32_t cg_cgx; /* we are the cgx'th cylinder group */
|
||||
uint32_t cg_cgx; /* we are the cgx'th cylinder group */
|
||||
int16_t cg_old_ncyl; /* number of cyl's this cg */
|
||||
int16_t cg_old_niblk; /* number of inode blocks this cg */
|
||||
u_int32_t cg_ndblk; /* number of data blocks this cg */
|
||||
uint32_t cg_ndblk; /* number of data blocks this cg */
|
||||
struct csum cg_cs; /* cylinder summary information */
|
||||
u_int32_t cg_rotor; /* position of last used block */
|
||||
u_int32_t cg_frotor; /* position of last used frag */
|
||||
u_int32_t cg_irotor; /* position of last used inode */
|
||||
u_int32_t cg_frsum[MAXFRAG]; /* counts of available frags */
|
||||
uint32_t cg_rotor; /* position of last used block */
|
||||
uint32_t cg_frotor; /* position of last used frag */
|
||||
uint32_t cg_irotor; /* position of last used inode */
|
||||
uint32_t cg_frsum[MAXFRAG]; /* counts of available frags */
|
||||
int32_t cg_old_btotoff; /* (int32) block totals per cylinder */
|
||||
int32_t cg_old_boff; /* (u_int16) free block positions */
|
||||
u_int32_t cg_iusedoff; /* (u_int8) used inode map */
|
||||
u_int32_t cg_freeoff; /* (u_int8) free block map */
|
||||
u_int32_t cg_nextfreeoff; /* (u_int8) next available space */
|
||||
u_int32_t cg_clustersumoff; /* (u_int32) counts of avail clusters */
|
||||
u_int32_t cg_clusteroff; /* (u_int8) free cluster map */
|
||||
u_int32_t cg_nclusterblks; /* number of clusters this cg */
|
||||
u_int32_t cg_niblk; /* number of inode blocks this cg */
|
||||
u_int32_t cg_initediblk; /* last initialized inode */
|
||||
u_int32_t cg_unrefs; /* number of unreferenced inodes */
|
||||
int32_t cg_old_boff; /* (uint16) free block positions */
|
||||
uint32_t cg_iusedoff; /* (uint8) used inode map */
|
||||
uint32_t cg_freeoff; /* (uint8) free block map */
|
||||
uint32_t cg_nextfreeoff; /* (uint8) next available space */
|
||||
uint32_t cg_clustersumoff; /* (uint32) counts of avail clusters */
|
||||
uint32_t cg_clusteroff; /* (uint8) free cluster map */
|
||||
uint32_t cg_nclusterblks; /* number of clusters this cg */
|
||||
uint32_t cg_niblk; /* number of inode blocks this cg */
|
||||
uint32_t cg_initediblk; /* last initialized inode */
|
||||
uint32_t cg_unrefs; /* number of unreferenced inodes */
|
||||
int32_t cg_sparecon32[1]; /* reserved for future use */
|
||||
u_int32_t cg_ckhash; /* check-hash of this cg */
|
||||
uint32_t cg_ckhash; /* check-hash of this cg */
|
||||
ufs_time_t cg_time; /* time last written */
|
||||
int64_t cg_sparecon64[3]; /* reserved for future use */
|
||||
/* actually longer - space used for cylinder group maps */
|
||||
|
@ -633,11 +633,11 @@ struct cg {
|
|||
*/
|
||||
#define cg_chkmagic(cgp) ((cgp)->cg_magic == CG_MAGIC)
|
||||
#define cg_inosused(cgp) \
|
||||
((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_iusedoff))
|
||||
((uint8_t *)((uint8_t *)(cgp) + (cgp)->cg_iusedoff))
|
||||
#define cg_blksfree(cgp) \
|
||||
((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_freeoff))
|
||||
((uint8_t *)((uint8_t *)(cgp) + (cgp)->cg_freeoff))
|
||||
#define cg_clustersfree(cgp) \
|
||||
((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_clusteroff))
|
||||
((uint8_t *)((uint8_t *)(cgp) + (cgp)->cg_clusteroff))
|
||||
#define cg_clustersum(cgp) \
|
||||
((int32_t *)((uintptr_t)(cgp) + (cgp)->cg_clustersumoff))
|
||||
|
||||
|
@ -906,7 +906,7 @@ CTASSERT(sizeof(union jrec) == JREC_SIZE);
|
|||
#endif
|
||||
|
||||
extern int inside[], around[];
|
||||
extern u_char *fragtbl[];
|
||||
extern uint8_t *fragtbl[];
|
||||
|
||||
/*
|
||||
* IOCTLs used for filesystem write suspension.
|
||||
|
|
|
@ -1063,7 +1063,7 @@ struct mount_softdeps {
|
|||
struct bmsafemap_hashhead *sd_bmhash; /* bmsafemap hash table */
|
||||
u_long sd_bmhashsize; /* bmsafemap hash table size-1*/
|
||||
struct indir_hashhead *sd_indirhash; /* indir hash table */
|
||||
u_long sd_indirhashsize; /* indir hash table size-1 */
|
||||
uint64_t sd_indirhashsize; /* indir hash table size-1 */
|
||||
int sd_on_journal; /* Items on the journal list */
|
||||
int sd_on_worklist; /* Items on the worklist */
|
||||
int sd_deps; /* Total dependency count */
|
||||
|
@ -1074,7 +1074,7 @@ struct mount_softdeps {
|
|||
struct thread *sd_flushtd; /* thread handling flushing */
|
||||
TAILQ_ENTRY(mount_softdeps) sd_next; /* List of softdep filesystem */
|
||||
struct ufsmount *sd_ump; /* our ufsmount structure */
|
||||
u_long sd_curdeps[D_LAST + 1]; /* count of current deps */
|
||||
uint64_t sd_curdeps[D_LAST + 1]; /* count of current deps */
|
||||
struct workhead sd_alldeps[D_LAST + 1];/* Lists of all deps */
|
||||
};
|
||||
/*
|
||||
|
|
|
@ -125,13 +125,13 @@ typedef int64_t ufs_time_t;
|
|||
#define UFS_NIADDR 3 /* Indirect addresses in inode. */
|
||||
|
||||
struct ufs2_dinode {
|
||||
u_int16_t di_mode; /* 0: IFMT, permissions; see below. */
|
||||
uint16_t di_mode; /* 0: IFMT, permissions; see below. */
|
||||
int16_t di_nlink; /* 2: File link count. */
|
||||
u_int32_t di_uid; /* 4: File owner. */
|
||||
u_int32_t di_gid; /* 8: File group. */
|
||||
u_int32_t di_blksize; /* 12: Inode blocksize. */
|
||||
u_int64_t di_size; /* 16: File byte count. */
|
||||
u_int64_t di_blocks; /* 24: Blocks actually held. */
|
||||
uint32_t di_uid; /* 4: File owner. */
|
||||
uint32_t di_gid; /* 8: File group. */
|
||||
uint32_t di_blksize; /* 12: Inode blocksize. */
|
||||
uint64_t di_size; /* 16: File byte count. */
|
||||
uint64_t di_blocks; /* 24: Blocks actually held. */
|
||||
ufs_time_t di_atime; /* 32: Last access time. */
|
||||
ufs_time_t di_mtime; /* 40: Last modified time. */
|
||||
ufs_time_t di_ctime; /* 48: Last inode change time. */
|
||||
|
@ -140,10 +140,10 @@ struct ufs2_dinode {
|
|||
int32_t di_atimensec; /* 68: Last access time. */
|
||||
int32_t di_ctimensec; /* 72: Last inode change time. */
|
||||
int32_t di_birthnsec; /* 76: Inode creation time. */
|
||||
u_int32_t di_gen; /* 80: Generation number. */
|
||||
u_int32_t di_kernflags; /* 84: Kernel flags. */
|
||||
u_int32_t di_flags; /* 88: Status flags (chflags). */
|
||||
u_int32_t di_extsize; /* 92: External attributes size. */
|
||||
uint32_t di_gen; /* 80: Generation number. */
|
||||
uint32_t di_kernflags; /* 84: Kernel flags. */
|
||||
uint32_t di_flags; /* 88: Status flags (chflags). */
|
||||
uint32_t di_extsize; /* 92: External attributes size. */
|
||||
ufs2_daddr_t di_extb[UFS_NXADDR];/* 96: External attributes block. */
|
||||
union {
|
||||
struct {
|
||||
|
@ -155,7 +155,7 @@ struct ufs2_dinode {
|
|||
char di_shortlink /* 112: Embedded symbolic link. */
|
||||
[(UFS_NDADDR + UFS_NIADDR) * sizeof(ufs2_daddr_t)];
|
||||
};
|
||||
u_int64_t di_modrev; /* 232: i_modrev for NFSv4 */
|
||||
uint64_t di_modrev; /* 232: i_modrev for NFSv4 */
|
||||
union {
|
||||
uint32_t di_freelink; /* 240: SUJ: Next unlinked inode. */
|
||||
uint32_t di_dirdepth; /* 240: IFDIR: depth from root dir */
|
||||
|
@ -180,13 +180,13 @@ struct ufs2_dinode {
|
|||
* are defined by types with precise widths.
|
||||
*/
|
||||
struct ufs1_dinode {
|
||||
u_int16_t di_mode; /* 0: IFMT, permissions; see below. */
|
||||
uint16_t di_mode; /* 0: IFMT, permissions; see below. */
|
||||
int16_t di_nlink; /* 2: File link count. */
|
||||
union {
|
||||
uint32_t di_freelink; /* 4: SUJ: Next unlinked inode. */
|
||||
uint32_t di_dirdepth; /* 4: IFDIR: depth from root dir */
|
||||
};
|
||||
u_int64_t di_size; /* 8: File byte count. */
|
||||
uint64_t di_size; /* 8: File byte count. */
|
||||
int32_t di_atime; /* 16: Last access time. */
|
||||
int32_t di_atimensec; /* 20: Last access time. */
|
||||
int32_t di_mtime; /* 24: Last modified time. */
|
||||
|
@ -203,12 +203,12 @@ struct ufs1_dinode {
|
|||
char di_shortlink /* 40: Embedded symbolic link. */
|
||||
[(UFS_NDADDR + UFS_NIADDR) * sizeof(ufs1_daddr_t)];
|
||||
};
|
||||
u_int32_t di_flags; /* 100: Status flags (chflags). */
|
||||
u_int32_t di_blocks; /* 104: Blocks actually held. */
|
||||
u_int32_t di_gen; /* 108: Generation number. */
|
||||
u_int32_t di_uid; /* 112: File owner. */
|
||||
u_int32_t di_gid; /* 116: File group. */
|
||||
u_int64_t di_modrev; /* 120: i_modrev for NFSv4 */
|
||||
uint32_t di_flags; /* 100: Status flags (chflags). */
|
||||
uint32_t di_blocks; /* 104: Blocks actually held. */
|
||||
uint32_t di_gen; /* 108: Generation number. */
|
||||
uint32_t di_uid; /* 112: File owner. */
|
||||
uint32_t di_gid; /* 116: File group. */
|
||||
uint64_t di_modrev; /* 120: i_modrev for NFSv4 */
|
||||
};
|
||||
|
||||
#define UFS_LINK_MAX 32767
|
||||
|
|
|
@ -77,10 +77,10 @@
|
|||
#define UFS_MAXNAMLEN 255
|
||||
|
||||
struct direct {
|
||||
u_int32_t d_ino; /* inode number of entry */
|
||||
u_int16_t d_reclen; /* length of this record */
|
||||
u_int8_t d_type; /* file type, see below */
|
||||
u_int8_t d_namlen; /* length of string in d_name */
|
||||
uint32_t d_ino; /* inode number of entry */
|
||||
uint16_t d_reclen; /* length of this record */
|
||||
uint8_t d_type; /* file type, see below */
|
||||
uint8_t d_namlen; /* length of string in d_name */
|
||||
char d_name[UFS_MAXNAMLEN + 1];
|
||||
/* name with length <= UFS_MAXNAMLEN */
|
||||
};
|
||||
|
@ -128,15 +128,15 @@ struct direct {
|
|||
* but the name field is UFS_MAXNAMLEN - 1, and this just won't do.
|
||||
*/
|
||||
struct dirtemplate {
|
||||
u_int32_t dot_ino;
|
||||
uint32_t dot_ino;
|
||||
int16_t dot_reclen;
|
||||
u_int8_t dot_type;
|
||||
u_int8_t dot_namlen;
|
||||
uint8_t dot_type;
|
||||
uint8_t dot_namlen;
|
||||
char dot_name[4]; /* must be multiple of 4 */
|
||||
u_int32_t dotdot_ino;
|
||||
uint32_t dotdot_ino;
|
||||
int16_t dotdot_reclen;
|
||||
u_int8_t dotdot_type;
|
||||
u_int8_t dotdot_namlen;
|
||||
uint8_t dotdot_type;
|
||||
uint8_t dotdot_namlen;
|
||||
char dotdot_name[4]; /* ditto */
|
||||
};
|
||||
|
||||
|
@ -144,13 +144,13 @@ struct dirtemplate {
|
|||
* This is the old format of directories, sanz type element.
|
||||
*/
|
||||
struct odirtemplate {
|
||||
u_int32_t dot_ino;
|
||||
uint32_t dot_ino;
|
||||
int16_t dot_reclen;
|
||||
u_int16_t dot_namlen;
|
||||
uint16_t dot_namlen;
|
||||
char dot_name[4]; /* must be multiple of 4 */
|
||||
u_int32_t dotdot_ino;
|
||||
uint32_t dotdot_ino;
|
||||
int16_t dotdot_reclen;
|
||||
u_int16_t dotdot_namlen;
|
||||
uint16_t dotdot_namlen;
|
||||
char dotdot_name[4]; /* ditto */
|
||||
};
|
||||
#endif /* !_DIR_H_ */
|
||||
|
|
|
@ -95,7 +95,7 @@ struct dirhash {
|
|||
int dh_memreq; /* Memory used. */
|
||||
|
||||
/* Free space statistics. XXX assumes DIRBLKSIZ is 512. */
|
||||
u_int8_t *dh_blkfree; /* free DIRALIGN words in each dir block */
|
||||
uint8_t *dh_blkfree; /* free DIRALIGN words in each dir block */
|
||||
int dh_nblk; /* size of dh_blkfree array */
|
||||
int dh_dirblks; /* number of DIRBLKSIZ blocks in dir */
|
||||
int dh_firstfree[DH_NFSTATS + 1]; /* first blk with N words free */
|
||||
|
|
|
@ -67,7 +67,7 @@ struct ufs_extattr_fileheader {
|
|||
struct ufs_extattr_header {
|
||||
u_int ueh_flags; /* flags for attribute */
|
||||
u_int ueh_len; /* local defined length; <= uef_size */
|
||||
u_int32_t ueh_i_gen; /* generation number for sanity */
|
||||
uint32_t ueh_i_gen; /* generation number for sanity */
|
||||
/* data follows the header */
|
||||
};
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ struct inode {
|
|||
} dinode_u;
|
||||
|
||||
ino_t i_number; /* The identity of the inode. */
|
||||
u_int32_t i_flag; /* flags, see below */
|
||||
uint32_t i_flag; /* flags, see below */
|
||||
int i_effnlink; /* i_nlink when I/O completes */
|
||||
|
||||
/*
|
||||
|
@ -121,7 +121,7 @@ struct inode {
|
|||
/*
|
||||
* Data for extended attribute modification.
|
||||
*/
|
||||
u_char *i_ea_area; /* Pointer to malloced copy of EA area */
|
||||
uint8_t *i_ea_area; /* Pointer to malloced copy of EA area */
|
||||
unsigned i_ea_len; /* Length of i_ea_area */
|
||||
int i_ea_error; /* First errno in transaction */
|
||||
int i_ea_refs; /* Number of users of EA area */
|
||||
|
@ -129,12 +129,12 @@ struct inode {
|
|||
/*
|
||||
* Copies from the on-disk dinode itself.
|
||||
*/
|
||||
u_int64_t i_size; /* File byte count. */
|
||||
u_int64_t i_gen; /* Generation number. */
|
||||
u_int32_t i_flags; /* Status flags (chflags). */
|
||||
u_int32_t i_uid; /* File owner. */
|
||||
u_int32_t i_gid; /* File group. */
|
||||
u_int16_t i_mode; /* IFMT, permissions; see below. */
|
||||
uint64_t i_size; /* File byte count. */
|
||||
uint64_t i_gen; /* Generation number. */
|
||||
uint32_t i_flags; /* Status flags (chflags). */
|
||||
uint32_t i_uid; /* File owner. */
|
||||
uint32_t i_gid; /* File group. */
|
||||
uint16_t i_mode; /* IFMT, permissions; see below. */
|
||||
int16_t i_nlink; /* File link count. */
|
||||
};
|
||||
/*
|
||||
|
@ -272,8 +272,8 @@ struct indir {
|
|||
|
||||
/* This overlays the fid structure (see mount.h). */
|
||||
struct ufid {
|
||||
u_int16_t ufid_len; /* Length of structure. */
|
||||
u_int16_t ufid_pad; /* Force 32-bit alignment. */
|
||||
uint16_t ufid_len; /* Length of structure. */
|
||||
uint16_t ufid_pad; /* Force 32-bit alignment. */
|
||||
uint32_t ufid_ino; /* File number (ino). */
|
||||
uint32_t ufid_gen; /* Generation number. */
|
||||
};
|
||||
|
|
|
@ -100,23 +100,23 @@
|
|||
* structure).
|
||||
*/
|
||||
struct dqblk32 {
|
||||
u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
|
||||
u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */
|
||||
u_int32_t dqb_curblocks; /* current block count */
|
||||
u_int32_t dqb_ihardlimit; /* maximum # allocated inodes + 1 */
|
||||
u_int32_t dqb_isoftlimit; /* preferred inode limit */
|
||||
u_int32_t dqb_curinodes; /* current # allocated inodes */
|
||||
uint32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
|
||||
uint32_t dqb_bsoftlimit; /* preferred limit on disk blks */
|
||||
uint32_t dqb_curblocks; /* current block count */
|
||||
uint32_t dqb_ihardlimit; /* maximum # allocated inodes + 1 */
|
||||
uint32_t dqb_isoftlimit; /* preferred inode limit */
|
||||
uint32_t dqb_curinodes; /* current # allocated inodes */
|
||||
int32_t dqb_btime; /* time limit for excessive disk use */
|
||||
int32_t dqb_itime; /* time limit for excessive files */
|
||||
};
|
||||
|
||||
struct dqblk64 {
|
||||
u_int64_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
|
||||
u_int64_t dqb_bsoftlimit; /* preferred limit on disk blks */
|
||||
u_int64_t dqb_curblocks; /* current block count */
|
||||
u_int64_t dqb_ihardlimit; /* maximum # allocated inodes + 1 */
|
||||
u_int64_t dqb_isoftlimit; /* preferred inode limit */
|
||||
u_int64_t dqb_curinodes; /* current # allocated inodes */
|
||||
uint64_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
|
||||
uint64_t dqb_bsoftlimit; /* preferred limit on disk blks */
|
||||
uint64_t dqb_curblocks; /* current block count */
|
||||
uint64_t dqb_ihardlimit; /* maximum # allocated inodes + 1 */
|
||||
uint64_t dqb_isoftlimit; /* preferred inode limit */
|
||||
uint64_t dqb_curinodes; /* current # allocated inodes */
|
||||
int64_t dqb_btime; /* time limit for excessive disk use */
|
||||
int64_t dqb_itime; /* time limit for excessive files */
|
||||
};
|
||||
|
@ -149,10 +149,10 @@ struct dquot {
|
|||
LIST_ENTRY(dquot) dq_hash; /* (h) hash list */
|
||||
TAILQ_ENTRY(dquot) dq_freelist; /* (h) free list */
|
||||
struct mtx dq_lock; /* lock for concurrency */
|
||||
u_int16_t dq_flags; /* flags, see below */
|
||||
u_int16_t dq_type; /* quota type of this dquot */
|
||||
u_int32_t dq_cnt; /* (h) count of active references */
|
||||
u_int32_t dq_id; /* identifier this applies to */
|
||||
uint16_t dq_flags; /* flags, see below */
|
||||
uint16_t dq_type; /* quota type of this dquot */
|
||||
uint32_t dq_cnt; /* (h) count of active references */
|
||||
uint32_t dq_id; /* identifier this applies to */
|
||||
struct ufsmount *dq_ump; /* (h) filesystem that this is
|
||||
taken from */
|
||||
struct dqblk64 dq_dqb; /* actual usage & quotas */
|
||||
|
@ -233,13 +233,13 @@ int qsync(struct mount *);
|
|||
int qsyncvp(struct vnode *);
|
||||
int quotaoff(struct thread *, struct mount *, int);
|
||||
int quotaon(struct thread *, struct mount *, int, void *, bool *);
|
||||
int getquota32(struct thread *, struct mount *, u_long, int, void *);
|
||||
int setquota32(struct thread *, struct mount *, u_long, int, void *);
|
||||
int setuse32(struct thread *, struct mount *, u_long, int, void *);
|
||||
int getquota(struct thread *, struct mount *, u_long, int, void *);
|
||||
int setquota(struct thread *, struct mount *, u_long, int, void *);
|
||||
int setuse(struct thread *, struct mount *, u_long, int, void *);
|
||||
int getquotasize(struct thread *, struct mount *, u_long, int, void *);
|
||||
int getquota32(struct thread *, struct mount *, uint64_t, int, void *);
|
||||
int setquota32(struct thread *, struct mount *, uint64_t, int, void *);
|
||||
int setuse32(struct thread *, struct mount *, uint64_t, int, void *);
|
||||
int getquota(struct thread *, struct mount *, uint64_t, int, void *);
|
||||
int setquota(struct thread *, struct mount *, uint64_t, int, void *);
|
||||
int setuse(struct thread *, struct mount *, uint64_t, int, void *);
|
||||
int getquotasize(struct thread *, struct mount *, uint64_t, int, void *);
|
||||
vfs_quotactl_t ufs_quotactl;
|
||||
|
||||
#ifdef SOFTUPDATES
|
||||
|
|
|
@ -348,7 +348,7 @@ ufsdirhash_build(struct inode *ip)
|
|||
struct direct *ep;
|
||||
struct vnode *vp;
|
||||
doff_t bmask, pos;
|
||||
u_int dirblocks, i, narrays, nblocks, nslots;
|
||||
uint64_t dirblocks, i, narrays, nblocks, nslots;
|
||||
int j, memreqd, slot;
|
||||
|
||||
/* Take care of a decreased sysctl value. */
|
||||
|
@ -1034,7 +1034,7 @@ ufsdirhash_checkblock(struct inode *ip, char *buf, doff_t offset)
|
|||
static int
|
||||
ufsdirhash_hash(struct dirhash *dh, char *name, int namelen)
|
||||
{
|
||||
u_int32_t hash;
|
||||
uint32_t hash;
|
||||
|
||||
/*
|
||||
* We hash the name and then some other bit of data that is
|
||||
|
@ -1181,7 +1181,7 @@ static int
|
|||
ufsdirhash_destroy(struct dirhash *dh)
|
||||
{
|
||||
doff_t **hash;
|
||||
u_int8_t *blkfree;
|
||||
uint8_t *blkfree;
|
||||
int i, mem, narrays;
|
||||
|
||||
KASSERT(dh->dh_hash != NULL, ("dirhash: NULL hash on list"));
|
||||
|
|
|
@ -82,9 +82,9 @@ ufs_gjournal_modref(struct vnode *vp, int count)
|
|||
bp = NULL;
|
||||
return (EIO);
|
||||
}
|
||||
if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg)
|
||||
panic("ufs_gjournal_modref: range: dev = %s, ino = %lu, fs = %s",
|
||||
devtoname(dev), (u_long)ino, fs->fs_fsmnt);
|
||||
if ((uint64_t)ino >= fs->fs_ipg * fs->fs_ncg)
|
||||
panic("ufs_gjournal_modref: range: dev = %s, ino = %ju, "
|
||||
"fs = %s", devtoname(dev), (intmax_t)ino, fs->fs_fsmnt);
|
||||
if ((error = ffs_getcg(fs, devvp, cg, 0, &bp, &cgp)) != 0)
|
||||
return (error);
|
||||
cgp->cg_unrefs += count;
|
||||
|
|
|
@ -209,7 +209,7 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp,
|
|||
struct vnode *pdp; /* saved dp during symlink work */
|
||||
struct vnode *tdp; /* returned by VFS_VGET */
|
||||
doff_t enduseful; /* pointer past last used dir slot */
|
||||
u_long bmask; /* block offset mask */
|
||||
uint64_t bmask; /* block offset mask */
|
||||
int namlen, error;
|
||||
struct ucred *cred = cnp->cn_cred;
|
||||
int flags = cnp->cn_flags;
|
||||
|
@ -815,7 +815,7 @@ void
|
|||
ufs_makedirentry(struct inode *ip, struct componentname *cnp,
|
||||
struct direct *newdirp)
|
||||
{
|
||||
u_int namelen;
|
||||
uint64_t namelen;
|
||||
|
||||
namelen = (unsigned)cnp->cn_namelen;
|
||||
KASSERT(namelen <= UFS_MAXNAMLEN,
|
||||
|
@ -824,7 +824,7 @@ ufs_makedirentry(struct inode *ip, struct componentname *cnp,
|
|||
newdirp->d_namlen = namelen;
|
||||
|
||||
/* Zero out after-name padding */
|
||||
*(u_int32_t *)(&newdirp->d_name[namelen & ~(DIR_ROUNDUP - 1)]) = 0;
|
||||
*(uint32_t *)(&newdirp->d_name[namelen & ~(DIR_ROUNDUP - 1)]) = 0;
|
||||
|
||||
bcopy(cnp->cn_nameptr, newdirp->d_name, namelen);
|
||||
|
||||
|
@ -833,7 +833,7 @@ ufs_makedirentry(struct inode *ip, struct componentname *cnp,
|
|||
else {
|
||||
newdirp->d_type = 0;
|
||||
# if (BYTE_ORDER == LITTLE_ENDIAN)
|
||||
{ u_char tmp = newdirp->d_namlen;
|
||||
{ uint8_t tmp = newdirp->d_namlen;
|
||||
newdirp->d_namlen = newdirp->d_type;
|
||||
newdirp->d_type = tmp; }
|
||||
# endif
|
||||
|
@ -858,9 +858,9 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp,
|
|||
int newentrysize;
|
||||
struct inode *dp;
|
||||
struct buf *bp;
|
||||
u_int dsize;
|
||||
uint64_t dsize;
|
||||
struct direct *ep, *nep;
|
||||
u_int64_t old_isize;
|
||||
uint64_t old_isize;
|
||||
int error, ret, blkoff, loc, spacefree, flags, namlen;
|
||||
char *dirbuf;
|
||||
|
||||
|
@ -890,12 +890,13 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp,
|
|||
}
|
||||
#endif
|
||||
old_isize = dp->i_size;
|
||||
vnode_pager_setsize(dvp, (u_long)I_OFFSET(dp) + DIRBLKSIZ);
|
||||
vnode_pager_setsize(dvp,
|
||||
(vm_ooffset_t)I_OFFSET(dp) + DIRBLKSIZ);
|
||||
if ((error = UFS_BALLOC(dvp, (off_t)I_OFFSET(dp), DIRBLKSIZ,
|
||||
cr, flags, &bp)) != 0) {
|
||||
if (DOINGSOFTDEP(dvp) && newdirbp != NULL)
|
||||
bdwrite(newdirbp);
|
||||
vnode_pager_setsize(dvp, (u_long)old_isize);
|
||||
vnode_pager_setsize(dvp, (vm_ooffset_t)old_isize);
|
||||
return (error);
|
||||
}
|
||||
dp->i_size = I_OFFSET(dp) + DIRBLKSIZ;
|
||||
|
@ -1057,7 +1058,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp,
|
|||
dirp->d_reclen == spacefree))
|
||||
ufsdirhash_add(dp, dirp, I_OFFSET(dp) + ((char *)ep - dirbuf));
|
||||
#endif
|
||||
bcopy((caddr_t)dirp, (caddr_t)ep, (u_int)newentrysize);
|
||||
bcopy((caddr_t)dirp, (caddr_t)ep, (uint64_t)newentrysize);
|
||||
#ifdef UFS_DIRHASH
|
||||
if (dp->i_dirhash != NULL)
|
||||
ufsdirhash_checkblock(dp, dirbuf -
|
||||
|
|
|
@ -80,7 +80,7 @@ static int chkdqchg(struct inode *, ufs2_daddr_t, struct ucred *, int, int *);
|
|||
static int chkiqchg(struct inode *, int, struct ucred *, int, int *);
|
||||
static int dqopen(struct vnode *, struct ufsmount *, int);
|
||||
static int dqget(struct vnode *,
|
||||
u_long, struct ufsmount *, int, struct dquot **);
|
||||
uint64_t, struct ufsmount *, int, struct dquot **);
|
||||
static int dqsync(struct vnode *, struct dquot *);
|
||||
static int dqflush(struct vnode *);
|
||||
static int quotaoff1(struct thread *td, struct mount *mp, int type);
|
||||
|
@ -793,7 +793,7 @@ quotaoff(struct thread *td, struct mount *mp, int type)
|
|||
* Q_GETQUOTA - return current values in a dqblk structure.
|
||||
*/
|
||||
static int
|
||||
_getquota(struct thread *td, struct mount *mp, u_long id, int type,
|
||||
_getquota(struct thread *td, struct mount *mp, uint64_t id, int type,
|
||||
struct dqblk64 *dqb)
|
||||
{
|
||||
struct dquot *dq;
|
||||
|
@ -834,7 +834,7 @@ _getquota(struct thread *td, struct mount *mp, u_long id, int type,
|
|||
* Q_SETQUOTA - assign an entire dqblk structure.
|
||||
*/
|
||||
static int
|
||||
_setquota(struct thread *td, struct mount *mp, u_long id, int type,
|
||||
_setquota(struct thread *td, struct mount *mp, uint64_t id, int type,
|
||||
struct dqblk64 *dqb)
|
||||
{
|
||||
struct dquot *dq;
|
||||
|
@ -897,7 +897,7 @@ _setquota(struct thread *td, struct mount *mp, u_long id, int type,
|
|||
* Q_SETUSE - set current inode and block usage.
|
||||
*/
|
||||
static int
|
||||
_setuse(struct thread *td, struct mount *mp, u_long id, int type,
|
||||
_setuse(struct thread *td, struct mount *mp, uint64_t id, int type,
|
||||
struct dqblk64 *dqb)
|
||||
{
|
||||
struct dquot *dq;
|
||||
|
@ -944,7 +944,8 @@ _setuse(struct thread *td, struct mount *mp, u_long id, int type,
|
|||
}
|
||||
|
||||
int
|
||||
getquota32(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
||||
getquota32(struct thread *td, struct mount *mp, uint64_t id, int type,
|
||||
void *addr)
|
||||
{
|
||||
struct dqblk32 dqb32;
|
||||
struct dqblk64 dqb64;
|
||||
|
@ -959,7 +960,8 @@ getquota32(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
|||
}
|
||||
|
||||
int
|
||||
setquota32(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
||||
setquota32(struct thread *td, struct mount *mp, uint64_t id, int type,
|
||||
void *addr)
|
||||
{
|
||||
struct dqblk32 dqb32;
|
||||
struct dqblk64 dqb64;
|
||||
|
@ -974,7 +976,7 @@ setquota32(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
|||
}
|
||||
|
||||
int
|
||||
setuse32(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
||||
setuse32(struct thread *td, struct mount *mp, uint64_t id, int type, void *addr)
|
||||
{
|
||||
struct dqblk32 dqb32;
|
||||
struct dqblk64 dqb64;
|
||||
|
@ -989,7 +991,7 @@ setuse32(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
|||
}
|
||||
|
||||
int
|
||||
getquota(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
||||
getquota(struct thread *td, struct mount *mp, uint64_t id, int type, void *addr)
|
||||
{
|
||||
struct dqblk64 dqb64;
|
||||
int error;
|
||||
|
@ -1002,7 +1004,7 @@ getquota(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
|||
}
|
||||
|
||||
int
|
||||
setquota(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
||||
setquota(struct thread *td, struct mount *mp, uint64_t id, int type, void *addr)
|
||||
{
|
||||
struct dqblk64 dqb64;
|
||||
int error;
|
||||
|
@ -1015,7 +1017,7 @@ setquota(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
|||
}
|
||||
|
||||
int
|
||||
setuse(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
||||
setuse(struct thread *td, struct mount *mp, uint64_t id, int type, void *addr)
|
||||
{
|
||||
struct dqblk64 dqb64;
|
||||
int error;
|
||||
|
@ -1031,7 +1033,7 @@ setuse(struct thread *td, struct mount *mp, u_long id, int type, void *addr)
|
|||
* Q_GETQUOTASIZE - get bit-size of quota file fields
|
||||
*/
|
||||
int
|
||||
getquotasize(struct thread *td, struct mount *mp, u_long id, int type,
|
||||
getquotasize(struct thread *td, struct mount *mp, uint64_t id, int type,
|
||||
void *sizep)
|
||||
{
|
||||
struct ufsmount *ump = VFSTOUFS(mp);
|
||||
|
@ -1154,7 +1156,7 @@ struct mtx dqhlock;
|
|||
#define DQH_LOCK() mtx_lock(&dqhlock)
|
||||
#define DQH_UNLOCK() mtx_unlock(&dqhlock)
|
||||
|
||||
static struct dquot *dqhashfind(struct dqhash *dqh, u_long id,
|
||||
static struct dquot *dqhashfind(struct dqhash *dqh, uint64_t id,
|
||||
struct vnode *dqvp);
|
||||
|
||||
/*
|
||||
|
@ -1187,7 +1189,7 @@ dquninit(void)
|
|||
}
|
||||
|
||||
static struct dquot *
|
||||
dqhashfind(struct dqhash *dqh, u_long id, struct vnode *dqvp)
|
||||
dqhashfind(struct dqhash *dqh, uint64_t id, struct vnode *dqvp)
|
||||
{
|
||||
struct dquot *dq;
|
||||
|
||||
|
@ -1266,7 +1268,7 @@ dqopen(struct vnode *vp, struct ufsmount *ump, int type)
|
|||
* reading the information from the file if necessary.
|
||||
*/
|
||||
static int
|
||||
dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type,
|
||||
dqget(struct vnode *vp, uint64_t id, struct ufsmount *ump, int type,
|
||||
struct dquot **dqp)
|
||||
{
|
||||
uint8_t buf[sizeof(struct dqblk64)];
|
||||
|
|
|
@ -109,7 +109,7 @@ ufs_quotactl(struct mount *mp, int cmds, uid_t id, void *arg, bool *mp_busy)
|
|||
return (EINVAL);
|
||||
}
|
||||
}
|
||||
if ((u_int)type >= MAXQUOTAS)
|
||||
if ((uint64_t)type >= MAXQUOTAS)
|
||||
return (EINVAL);
|
||||
|
||||
switch (cmd) {
|
||||
|
|
|
@ -552,7 +552,7 @@ ufs_stat(struct vop_stat_args *ap)
|
|||
sb->st_ctim.tv_nsec = ip->i_din1->di_ctimensec;
|
||||
sb->st_birthtim.tv_sec = -1;
|
||||
sb->st_birthtim.tv_nsec = 0;
|
||||
sb->st_blocks = dbtob((u_quad_t)ip->i_din1->di_blocks) / S_BLKSIZE;
|
||||
sb->st_blocks = dbtob((uint64_t)ip->i_din1->di_blocks) / S_BLKSIZE;
|
||||
} else {
|
||||
sb->st_rdev = ip->i_din2->di_rdev;
|
||||
sb->st_size = ip->i_din2->di_size;
|
||||
|
@ -562,7 +562,7 @@ ufs_stat(struct vop_stat_args *ap)
|
|||
sb->st_ctim.tv_nsec = ip->i_din2->di_ctimensec;
|
||||
sb->st_birthtim.tv_sec = ip->i_din2->di_birthtime;
|
||||
sb->st_birthtim.tv_nsec = ip->i_din2->di_birthnsec;
|
||||
sb->st_blocks = dbtob((u_quad_t)ip->i_din2->di_blocks) / S_BLKSIZE;
|
||||
sb->st_blocks = dbtob((uint64_t)ip->i_din2->di_blocks) / S_BLKSIZE;
|
||||
}
|
||||
|
||||
sb->st_blksize = max(PAGE_SIZE, vp->v_mount->mnt_stat.f_iosize);
|
||||
|
@ -611,7 +611,7 @@ ufs_getattr(
|
|||
vap->va_mtime.tv_nsec = ip->i_din1->di_mtimensec;
|
||||
vap->va_ctime.tv_sec = ip->i_din1->di_ctime;
|
||||
vap->va_ctime.tv_nsec = ip->i_din1->di_ctimensec;
|
||||
vap->va_bytes = dbtob((u_quad_t)ip->i_din1->di_blocks);
|
||||
vap->va_bytes = dbtob((uint64_t)ip->i_din1->di_blocks);
|
||||
vap->va_filerev = ip->i_din1->di_modrev;
|
||||
} else {
|
||||
vap->va_rdev = ip->i_din2->di_rdev;
|
||||
|
@ -622,7 +622,7 @@ ufs_getattr(
|
|||
vap->va_ctime.tv_nsec = ip->i_din2->di_ctimensec;
|
||||
vap->va_birthtime.tv_sec = ip->i_din2->di_birthtime;
|
||||
vap->va_birthtime.tv_nsec = ip->i_din2->di_birthnsec;
|
||||
vap->va_bytes = dbtob((u_quad_t)ip->i_din2->di_blocks);
|
||||
vap->va_bytes = dbtob((uint64_t)ip->i_din2->di_blocks);
|
||||
vap->va_filerev = ip->i_din2->di_modrev;
|
||||
}
|
||||
vap->va_flags = ip->i_flags;
|
||||
|
@ -2415,7 +2415,7 @@ ufs_readdir(
|
|||
off_t offset, startoffset;
|
||||
size_t readcnt, skipcnt;
|
||||
ssize_t startresid;
|
||||
u_int ncookies;
|
||||
uint64_t ncookies;
|
||||
int error;
|
||||
|
||||
if (uio->uio_offset < 0)
|
||||
|
@ -2609,8 +2609,8 @@ ufs_print(
|
|||
printf(", extsize %d", ip->i_din2->di_extsize);
|
||||
printf("\n\tgeneration=%jx, uid=%d, gid=%d, flags=0x%b\n",
|
||||
(uintmax_t)ip->i_gen, ip->i_uid, ip->i_gid,
|
||||
(u_int)ip->i_flags, PRINT_INODE_FLAGS);
|
||||
printf("\tino %lu, on dev %s", (u_long)ip->i_number,
|
||||
(uint32_t)ip->i_flags, PRINT_INODE_FLAGS);
|
||||
printf("\tino %ju, on dev %s", (intmax_t)ip->i_number,
|
||||
devtoname(ITODEV(ip)));
|
||||
if (vp->v_type == VFIFO)
|
||||
fifo_printinfo(vp);
|
||||
|
|
|
@ -90,13 +90,13 @@ struct ufsmount {
|
|||
struct bufobj *um_bo; /* (r) Buffer cache object */
|
||||
struct vnode *um_odevvp; /* (r) devfs dev vnode */
|
||||
struct vnode *um_devvp; /* (r) mntfs private vnode */
|
||||
u_long um_fstype; /* (c) type of filesystem */
|
||||
uint64_t um_fstype; /* (c) type of filesystem */
|
||||
struct fs *um_fs; /* (r) pointer to superblock */
|
||||
struct ufs_extattr_per_mount um_extattr; /* (c) extended attrs */
|
||||
u_long um_nindir; /* (c) indirect ptrs per blk */
|
||||
u_long um_bptrtodb; /* (c) indir disk block ptr */
|
||||
u_long um_seqinc; /* (c) inc between seq blocks */
|
||||
u_long um_bsize; /* (c) fs block size */
|
||||
uint64_t um_nindir; /* (c) indirect ptrs per blk */
|
||||
uint64_t um_bptrtodb; /* (c) indir disk block ptr */
|
||||
uint64_t um_seqinc; /* (c) inc between seq blocks */
|
||||
uint64_t um_bsize; /* (c) fs block size */
|
||||
uint64_t um_maxsymlinklen; /* (c) max size of short
|
||||
symlink */
|
||||
struct mtx um_lock; /* (c) Protects ufsmount & fs */
|
||||
|
@ -109,15 +109,15 @@ struct ufsmount {
|
|||
time_t um_itime[MAXQUOTAS]; /* (q) inode quota time limit */
|
||||
char um_qflags[MAXQUOTAS]; /* (i) quota specific flags */
|
||||
int64_t um_savedmaxfilesize; /* (c) track maxfilesize */
|
||||
u_int um_flags; /* (i) filesystem flags */
|
||||
uint64_t um_flags; /* (i) filesystem flags */
|
||||
struct timeval um_last_fullmsg; /* (i) last full msg time */
|
||||
int um_secs_fullmsg; /* (i) seconds since full msg */
|
||||
struct timeval um_last_integritymsg; /* (i) last integrity msg */
|
||||
int um_secs_integritymsg; /* (i) secs since integ msg */
|
||||
u_int um_trim_inflight; /* (i) outstanding trim count */
|
||||
u_int um_trim_inflight_blks; /* (i) outstanding trim blks */
|
||||
u_long um_trim_total; /* (i) total trim count */
|
||||
u_long um_trim_total_blks; /* (i) total trim block count */
|
||||
uint64_t um_trim_inflight; /* (i) outstanding trim count */
|
||||
uint64_t um_trim_inflight_blks; /* (i) outstanding trim blks */
|
||||
uint64_t um_trim_total; /* (i) total trim count */
|
||||
uint64_t um_trim_total_blks; /* (i) total trim block count */
|
||||
struct taskqueue *um_trim_tq; /* (c) trim request queue */
|
||||
struct trimlist_hashhead *um_trimhash; /* (i) trimlist hash table */
|
||||
u_long um_trimlisthashsize; /* (i) trim hash table size-1 */
|
||||
|
|
Loading…
Reference in a new issue