From f719c866d82b3805e36445fd93f1509a5a548fd0 Mon Sep 17 00:00:00 2001 From: David Rhodus Date: Sun, 18 Jul 2004 19:43:48 +0000 Subject: [PATCH] Perform some basic cleanups. Change some types over to C99 standard types. Correct some misspellings. Correct some type usages which could possibly resulted in overflows in the filesystem code. --- sys/vfs/ufs/README | 4 +- sys/vfs/ufs/README.softupdates | 4 +- sys/vfs/ufs/dinode.h | 20 ++--- sys/vfs/ufs/dir.h | 32 ++++---- sys/vfs/ufs/dirhash.h | 8 +- sys/vfs/ufs/ffs_alloc.c | 62 ++++++++-------- sys/vfs/ufs/ffs_balloc.c | 4 +- sys/vfs/ufs/ffs_extern.h | 84 ++++++++++----------- sys/vfs/ufs/ffs_inode.c | 12 +-- sys/vfs/ufs/ffs_rawread.c | 6 +- sys/vfs/ufs/ffs_softdep.c | 130 ++++++++++++++++----------------- sys/vfs/ufs/ffs_softdep_stub.c | 6 +- sys/vfs/ufs/ffs_vfsops.c | 56 +++++++------- sys/vfs/ufs/fs.h | 107 +++++++++++++-------------- sys/vfs/ufs/inode.h | 14 ++-- sys/vfs/ufs/quota.h | 50 ++++++------- sys/vfs/ufs/softdep.h | 4 +- sys/vfs/ufs/ufs_dirhash.c | 10 +-- sys/vfs/ufs/ufs_extern.h | 74 +++++++++---------- sys/vfs/ufs/ufs_lookup.c | 12 +-- sys/vfs/ufs/ufs_quota.c | 13 ++-- sys/vfs/ufs/ufs_readwrite.c | 8 +- sys/vfs/ufs/ufs_vfsops.c | 4 +- sys/vfs/ufs/ufs_vnops.c | 14 ++-- sys/vfs/ufs/ufsmount.h | 22 +++--- 25 files changed, 378 insertions(+), 382 deletions(-) diff --git a/sys/vfs/ufs/README b/sys/vfs/ufs/README index 9b170b7964..e49e2f21e3 100644 --- a/sys/vfs/ufs/README +++ b/sys/vfs/ufs/README @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/ufs/ffs/README,v 1.4 1999/12/03 00:34:26 billf Exp $ -# $DragonFly: src/sys/vfs/ufs/README,v 1.3 2003/08/07 21:17:44 dillon Exp $ +# $DragonFly: src/sys/vfs/ufs/README,v 1.4 2004/07/18 19:43:48 drhodus Exp $ Introduction @@ -319,5 +319,3 @@ out of memory panic's, then you have max_softdeps set too high. The max_limit_hit and rush_requests show be reset to zero before each run. The minimum legal value for tickdelay is 2 (if you set it below that, the code will use 2). - - diff --git a/sys/vfs/ufs/README.softupdates b/sys/vfs/ufs/README.softupdates index 0cade1539f..db2a1f5678 100644 --- a/sys/vfs/ufs/README.softupdates +++ b/sys/vfs/ufs/README.softupdates @@ -1,5 +1,5 @@ -$FreeBSD: src/sys/ufs/ffs/README.softupdates,v 1.7.2.1 2000/06/26 14:09:01 sheldonh Exp $ -$DragonFly: src/sys/vfs/ufs/README.softupdates,v 1.2 2003/06/17 04:28:59 dillon Exp $ +# $FreeBSD: src/sys/ufs/ffs/README.softupdates,v 1.7.2.1 2000/06/26 14:09:01 sheldonh Exp $ +# $DragonFly: src/sys/vfs/ufs/README.softupdates,v 1.3 2004/07/18 19:43:48 drhodus Exp $ Add option SOFTUPDATES to your kernel configuration. You should also read the copyrights in the sources and the README file. diff --git a/sys/vfs/ufs/dinode.h b/sys/vfs/ufs/dinode.h index 76ef28ff42..9f44062ca4 100644 --- a/sys/vfs/ufs/dinode.h +++ b/sys/vfs/ufs/dinode.h @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1982, 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. @@ -37,14 +37,14 @@ * * @(#)dinode.h 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/ufs/ufs/dinode.h,v 1.7 1999/08/28 00:52:27 peter Exp $ - * $DragonFly: src/sys/vfs/ufs/dinode.h,v 1.2 2003/06/17 04:28:59 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/dinode.h,v 1.3 2004/07/18 19:43:48 drhodus Exp $ */ #ifndef _UFS_UFS_DINODE_H_ #define _UFS_UFS_DINODE_H_ /* - * The root inode is the root of the file system. Inode 0 can't be used for + * The root inode is the root of the filesystem. Inode 0 can't be used for * normal purposes and historically bad blocks were linked to inode 1, thus * the root inode is 2. (Inode 1 is no longer used for this purpose, however * numerous dump tapes make this assumption, so we are stuck with it). @@ -71,13 +71,13 @@ #define NIADDR 3 /* Indirect addresses in inode. */ struct 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 { - u_int16_t oldids[2]; /* 4: Ffs: old user and group ids. */ + uint16_t oldids[2]; /* 4: Ffs: old user and group ids. */ int32_t inumber; /* 4: Lfs: inode number. */ } di_u; - 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. */ @@ -86,11 +86,11 @@ struct dinode { int32_t di_ctimensec; /* 36: Last inode change time. */ ufs_daddr_t di_db[NDADDR]; /* 40: Direct disk blocks. */ ufs_daddr_t di_ib[NIADDR]; /* 88: Indirect disk blocks. */ - u_int32_t di_flags; /* 100: Status flags (chflags). */ + uint32_t di_flags; /* 100: Status flags (chflags). */ int32_t di_blocks; /* 104: Blocks actually held. */ int32_t di_gen; /* 108: Generation number. */ - u_int32_t di_uid; /* 112: File owner. */ - u_int32_t di_gid; /* 116: File group. */ + uint32_t di_uid; /* 112: File owner. */ + uint32_t di_gid; /* 116: File group. */ int32_t di_spare[2]; /* 120: Reserved; currently unused */ }; @@ -127,4 +127,4 @@ struct dinode { #define IFSOCK 0140000 /* UNIX domain socket. */ #define IFWHT 0160000 /* Whiteout. */ -#endif +#endif /* !_UFS_UFS_DINODE_H_ */ diff --git a/sys/vfs/ufs/dir.h b/sys/vfs/ufs/dir.h index 10311de3d0..1d65afeea7 100644 --- a/sys/vfs/ufs/dir.h +++ b/sys/vfs/ufs/dir.h @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. @@ -37,7 +37,7 @@ * * @(#)dir.h 8.2 (Berkeley) 1/21/94 * $FreeBSD: src/sys/ufs/ufs/dir.h,v 1.9 1999/08/28 00:52:27 peter Exp $ - * $DragonFly: src/sys/vfs/ufs/dir.h,v 1.2 2003/06/17 04:28:59 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/dir.h,v 1.3 2004/07/18 19:43:48 drhodus Exp $ */ #ifndef _UFS_UFS_DIR_H_ @@ -80,10 +80,10 @@ #define 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[MAXNAMLEN + 1];/* name with length <= MAXNAMLEN */ }; @@ -132,15 +132,15 @@ struct direct { * but the name field is 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 */ }; @@ -148,13 +148,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_ */ diff --git a/sys/vfs/ufs/dirhash.h b/sys/vfs/ufs/dirhash.h index 703a7b44e8..562c6e44db 100644 --- a/sys/vfs/ufs/dirhash.h +++ b/sys/vfs/ufs/dirhash.h @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 2001 Ian Dowse. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,12 +23,16 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ufs/ufs/dirhash.h,v 1.2.2.1 2001/08/01 19:33:39 iedowse Exp $ - * $DragonFly: src/sys/vfs/ufs/dirhash.h,v 1.2 2003/06/17 04:28:59 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/dirhash.h,v 1.3 2004/07/18 19:43:48 drhodus Exp $ */ #ifndef _UFS_UFS_DIRHASH_H_ #define _UFS_UFS_DIRHASH_H_ +/* + * XXX DR: On the current directory hashing method; the performance + * on large directories is awful due to the lookup code path. + */ /* * For fast operations on large directories, we maintain a hash * that maps the file name to the offset of the directory entry within diff --git a/sys/vfs/ufs/ffs_alloc.c b/sys/vfs/ufs/ffs_alloc.c index 850a4a606d..57349ccf8b 100644 --- a/sys/vfs/ufs/ffs_alloc.c +++ b/sys/vfs/ufs/ffs_alloc.c @@ -32,7 +32,7 @@ * * @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95 * $FreeBSD: src/sys/ufs/ffs/ffs_alloc.c,v 1.64.2.2 2001/09/21 19:15:21 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_alloc.c,v 1.9 2004/05/18 00:16:46 cpressey Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_alloc.c,v 1.10 2004/07/18 19:43:48 drhodus Exp $ */ #include "opt_quota.h" @@ -71,7 +71,7 @@ static ufs_daddr_t ffs_clusteralloc (struct inode *, int, ufs_daddr_t, int); static ino_t ffs_dirpref (struct inode *); static ufs_daddr_t ffs_fragextend (struct inode *, int, long, int, int); -static void ffs_fserr (struct fs *, u_int, char *); +static void ffs_fserr (struct fs *, uint, char *); static u_long ffs_hashalloc (struct inode *, int, long, int, allocfcn_t *); static ino_t ffs_nodealloccg (struct inode *, int, ufs_daddr_t, int); @@ -79,7 +79,7 @@ static ufs_daddr_t ffs_mapsearch (struct fs *, struct cg *, ufs_daddr_t, int); /* - * Allocate a block in the file system. + * Allocate a block in the filesystem. * * The size of the requested block is given, which must be some * multiple of fs_fsize and <= fs_bsize. @@ -111,7 +111,7 @@ ffs_alloc(struct inode *ip, ufs_daddr_t lbn, ufs_daddr_t bpref, int size, *bnp = 0; fs = ip->i_fs; #ifdef DIAGNOSTIC - if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { + if ((uint)size > fs->fs_bsize || fragoff(fs, size) != 0) { printf("dev = %s, bsize = %ld, size = %d, fs = %s\n", devtoname(ip->i_dev), (long)fs->fs_bsize, size, fs->fs_fsmnt); @@ -151,8 +151,8 @@ ffs_alloc(struct inode *ip, ufs_daddr_t lbn, ufs_daddr_t bpref, int size, (void) chkdq(ip, (long)-btodb(size), cred, FORCE); #endif nospace: - ffs_fserr(fs, cred->cr_uid, "file system full"); - uprintf("\n%s: write failed, file system is full\n", fs->fs_fsmnt); + ffs_fserr(fs, cred->cr_uid, "filesystem full"); + uprintf("\n%s: write failed, filesystem is full\n", fs->fs_fsmnt); return (ENOSPC); } @@ -176,8 +176,8 @@ ffs_realloccg(struct inode *ip, ufs_daddr_t lbprev, ufs_daddr_t bpref, *bpp = 0; fs = ip->i_fs; #ifdef DIAGNOSTIC - if ((u_int)osize > fs->fs_bsize || fragoff(fs, osize) != 0 || - (u_int)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) { + if ((uint)osize > fs->fs_bsize || fragoff(fs, osize) != 0 || + (uint)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) { printf( "dev = %s, bsize = %ld, osize = %d, nsize = %d, fs = %s\n", devtoname(ip->i_dev), (long)fs->fs_bsize, osize, @@ -230,7 +230,7 @@ ffs_realloccg(struct inode *ip, ufs_daddr_t lbprev, ufs_daddr_t bpref, ip->i_flag |= IN_CHANGE | IN_UPDATE; allocbuf(bp, nsize); bp->b_flags |= B_DONE; - bzero((char *)bp->b_data + osize, (u_int)nsize - osize); + bzero((char *)bp->b_data + osize, (uint)nsize - osize); *bpp = bp; return (0); } @@ -295,7 +295,7 @@ ffs_realloccg(struct inode *ip, ufs_daddr_t lbprev, ufs_daddr_t bpref, ip->i_flag |= IN_CHANGE | IN_UPDATE; allocbuf(bp, nsize); bp->b_flags |= B_DONE; - bzero((char *)bp->b_data + osize, (u_int)nsize - osize); + bzero((char *)bp->b_data + osize, (uint)nsize - osize); *bpp = bp; return (0); } @@ -310,8 +310,8 @@ nospace: /* * no space available */ - ffs_fserr(fs, cred->cr_uid, "file system full"); - uprintf("\n%s: write failed, file system is full\n", fs->fs_fsmnt); + ffs_fserr(fs, cred->cr_uid, "filesystem full"); + uprintf("\n%s: write failed, filesystem is full\n", fs->fs_fsmnt); return (ENOSPC); } @@ -544,7 +544,7 @@ fail: } /* - * Allocate an inode in the file system. + * Allocate an inode in the filesystem. * * If allocating a directory, use ffs_dirpref to select the inode. * If allocating in a directory, the following hierarchy is followed: @@ -885,7 +885,7 @@ ffs_fragextend(struct inode *ip, int cg, long bprev, int osize, int nsize) long bno; int frags, bbase; int i, error; - u_int8_t *blksfree; + uint8_t *blksfree; fs = ip->i_fs; if (fs->fs_cs(fs, cg).cs_nffree < numfrags(fs, nsize - osize)) @@ -956,7 +956,7 @@ ffs_alloccg(struct inode *ip, int cg, ufs_daddr_t bpref, int size) int i; ufs_daddr_t bno, blkno; int allocsiz, error, frags; - u_int8_t *blksfree; + uint8_t *blksfree; fs = ip->i_fs; if (fs->fs_cs(fs, cg).cs_nbfree == 0 && size == fs->fs_bsize) @@ -1053,7 +1053,7 @@ ffs_alloccgblk(struct inode *ip, struct buf *bp, ufs_daddr_t bpref) int cylno, pos, delta; short *cylbp; int i; - u_int8_t *blksfree; + uint8_t *blksfree; fs = ip->i_fs; cgp = (struct cg *)bp->b_data; @@ -1170,7 +1170,7 @@ ffs_clusteralloc(struct inode *ip, int cg, ufs_daddr_t bpref, int len) int i, got, run, bno, bit, map; u_char *mapp; int32_t *lp; - u_int8_t *blksfree; + uint8_t *blksfree; fs = ip->i_fs; if (fs->fs_maxcluster[cg] < len) @@ -1277,7 +1277,7 @@ ffs_nodealloccg(struct inode *ip, int cg, ufs_daddr_t ipref, int mode) struct fs *fs; struct cg *cgp; struct buf *bp; - u_int8_t *inosused; + uint8_t *inosused; int error, start, len, loc, map, i; fs = ip->i_fs; @@ -1360,11 +1360,11 @@ ffs_blkfree(struct inode *ip, ufs_daddr_t bno, long size) struct buf *bp; ufs_daddr_t blkno; int i, error, cg, blk, frags, bbase; - u_int8_t *blksfree; + uint8_t *blksfree; fs = ip->i_fs; VOP_FREEBLKS(ip->i_devvp, fsbtodb(fs, bno), size); - if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0 || + if ((uint)size > fs->fs_bsize || fragoff(fs, size) != 0 || fragnum(fs, bno) + numfrags(fs, size) > fs->fs_frag) { printf("dev=%s, bno = %ld, bsize = %ld, size = %ld, fs = %s\n", devtoname(ip->i_dev), (long)bno, (long)fs->fs_bsize, size, @@ -1372,7 +1372,7 @@ ffs_blkfree(struct inode *ip, ufs_daddr_t bno, long size) panic("ffs_blkfree: bad size"); } cg = dtog(fs, bno); - if ((u_int)bno >= fs->fs_size) { + if ((uint)bno >= fs->fs_size) { printf("bad block %ld, ino %lu\n", (long)bno, (u_long)ip->i_number); ffs_fserr(fs, ip->i_uid, "bad block"); @@ -1469,15 +1469,15 @@ ffs_checkblk(struct inode *ip, ufs_daddr_t bno, long size) struct cg *cgp; struct buf *bp; int i, error, frags, free; - u_int8_t *blksfree; + uint8_t *blksfree; fs = ip->i_fs; - if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { + if ((uint)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 ((uint)bno >= fs->fs_size) panic("ffs_checkblk: bad block %d", bno); error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, dtog(fs, bno))), (int)fs->fs_cgsize, &bp); @@ -1529,11 +1529,11 @@ ffs_freefile(struct vnode *pvp, ino_t ino, int mode) struct inode *pip; struct buf *bp; int error, cg; - u_int8_t *inosused; + uint8_t *inosused; pip = VTOI(pvp); fs = pip->i_fs; - if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg) + if ((uint)ino >= fs->fs_ipg * fs->fs_ncg) panic("ffs_vfree: range: dev = (%d,%d), ino = %d, fs = %s", major(pip->i_dev), minor(pip->i_dev), ino, fs->fs_fsmnt); cg = ino_to_cg(fs, ino); @@ -1586,7 +1586,7 @@ ffs_mapsearch(struct fs *fs, struct cg *cgp, ufs_daddr_t bpref, int allocsiz) ufs_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 @@ -1598,13 +1598,13 @@ ffs_mapsearch(struct fs *fs, struct cg *cgp, ufs_daddr_t bpref, int allocsiz) 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((uint)len, (u_char *)&blksfree[start], (u_char *)fragtbl[fs->fs_frag], (u_char)(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((uint)len, (u_char *)&blksfree[0], (u_char *)fragtbl[fs->fs_frag], (u_char)(1 << (allocsiz - 1 + (fs->fs_frag % NBBY)))); if (loc == 0) { @@ -1726,13 +1726,13 @@ ffs_clusteracct(struct fs *fs, struct cg *cgp, ufs_daddr_t blkno, int cnt) } /* - * Fserr prints the name of a file system with an error diagnostic. + * Fserr prints the name of a filesystem with an error diagnostic. * * The form of the error message is: * fs: error message */ static void -ffs_fserr(struct fs *fs, u_int uid, char *cp) +ffs_fserr(struct fs *fs, uint uid, char *cp) { struct thread *td = curthread; struct proc *p; diff --git a/sys/vfs/ufs/ffs_balloc.c b/sys/vfs/ufs/ffs_balloc.c index 95a333877c..324977c84e 100644 --- a/sys/vfs/ufs/ffs_balloc.c +++ b/sys/vfs/ufs/ffs_balloc.c @@ -32,7 +32,7 @@ * * @(#)ffs_balloc.c 8.8 (Berkeley) 6/16/95 * $FreeBSD: src/sys/ufs/ffs/ffs_balloc.c,v 1.26.2.1 2002/10/10 19:48:20 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_balloc.c,v 1.7 2004/05/18 00:16:46 cpressey Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_balloc.c,v 1.8 2004/07/18 19:43:48 drhodus Exp $ */ #include @@ -51,7 +51,7 @@ #include "ffs_extern.h" /* - * Balloc defines the structure of file system storage + * Balloc defines the structure of filesystem storage * by allocating the physical blocks on a device given * the inode and the logical block number in a file. * diff --git a/sys/vfs/ufs/ffs_extern.h b/sys/vfs/ufs/ffs_extern.h index 55bc4a9dea..cea8ce6ce1 100644 --- a/sys/vfs/ufs/ffs_extern.h +++ b/sys/vfs/ufs/ffs_extern.h @@ -32,7 +32,7 @@ * * @(#)ffs_extern.h 8.6 (Berkeley) 3/30/95 * $FreeBSD: src/sys/ufs/ffs/ffs_extern.h,v 1.30 2000/01/09 22:40:02 mckusick Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_extern.h,v 1.5 2003/08/20 09:56:34 rob Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_extern.h,v 1.6 2004/07/18 19:43:48 drhodus Exp $ */ #ifndef _UFS_FFS_EXTERN_H @@ -70,37 +70,37 @@ struct vop_bmap_args; struct vop_fsync_args; struct vop_reallocblks_args; -int ffs_alloc (struct inode *, +int ffs_alloc(struct inode *, ufs_daddr_t, ufs_daddr_t, int, struct ucred *, ufs_daddr_t *); -int ffs_balloc (struct vop_balloc_args *); -int ffs_blkatoff (struct vnode *, off_t, char **, struct buf **); -void ffs_blkfree (struct inode *, ufs_daddr_t, long); -ufs_daddr_t ffs_blkpref (struct inode *, ufs_daddr_t, int, ufs_daddr_t *); -int ffs_bmap (struct vop_bmap_args *); -void ffs_clrblock (struct fs *, u_char *, ufs_daddr_t); -int ffs_fhtovp (struct mount *, struct fid *, struct vnode **); -int ffs_flushfiles (struct mount *, int, struct thread *); -void ffs_fragacct (struct fs *, int, int32_t [], int); -int ffs_freefile ( struct vnode *, ino_t, int ); -int ffs_isblock (struct fs *, u_char *, ufs_daddr_t); -int ffs_isfreeblock (struct fs *, unsigned char *, ufs_daddr_t); -int ffs_mountfs (struct vnode *, struct mount *, struct thread *, +int ffs_balloc(struct vop_balloc_args *); +int ffs_blkatoff(struct vnode *, off_t, char **, struct buf **); +void ffs_blkfree(struct inode *, ufs_daddr_t, long); +ufs_daddr_t ffs_blkpref(struct inode *, ufs_daddr_t, int, ufs_daddr_t *); +int ffs_bmap(struct vop_bmap_args *); +void ffs_clrblock(struct fs *, u_char *, ufs_daddr_t); +int ffs_fhtovp(struct mount *, struct fid *, struct vnode **); +int ffs_flushfiles(struct mount *, int, struct thread *); +void ffs_fragacct(struct fs *, int, int32_t [], int); +int ffs_freefile( struct vnode *, ino_t, int ); +int ffs_isblock(struct fs *, u_char *, ufs_daddr_t); +int ffs_isfreeblock(struct fs *, unsigned char *, ufs_daddr_t); +int ffs_mountfs(struct vnode *, struct mount *, struct thread *, struct malloc_type *); -int ffs_mountroot (void); -int ffs_reallocblks (struct vop_reallocblks_args *); -int ffs_realloccg (struct inode *, +int ffs_mountroot(void); +int ffs_reallocblks(struct vop_reallocblks_args *); +int ffs_realloccg(struct inode *, ufs_daddr_t, ufs_daddr_t, int, int, struct ucred *, struct buf **); -void ffs_setblock (struct fs *, u_char *, ufs_daddr_t); -int ffs_statfs (struct mount *, struct statfs *, struct thread *); -int ffs_sync (struct mount *, int, struct thread *); -int ffs_truncate (struct vnode *, off_t, int, struct ucred *, struct thread *); -int ffs_unmount (struct mount *, int, struct thread *); -int ffs_update (struct vnode *, int); -int ffs_valloc (struct vnode *, int, struct ucred *, struct vnode **); +void ffs_setblock(struct fs *, u_char *, ufs_daddr_t); +int ffs_statfs(struct mount *, struct statfs *, struct thread *); +int ffs_sync(struct mount *, int, struct thread *); +int ffs_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *); +int ffs_unmount(struct mount *, int, struct thread *); +int ffs_update(struct vnode *, int); +int ffs_valloc(struct vnode *, int, struct ucred *, struct vnode **); -int ffs_vfree (struct vnode *, ino_t, int); -int ffs_vget (struct mount *, ino_t, struct vnode **); -int ffs_vptofh (struct vnode *, struct fid *); +int ffs_vfree(struct vnode *, ino_t, int); +int ffs_vget(struct mount *, ino_t, struct vnode **); +int ffs_vptofh(struct vnode *, struct fid *); extern vop_t **ffs_vnodeop_p; extern vop_t **ffs_specop_p; @@ -109,22 +109,22 @@ extern vop_t **ffs_fifoop_p; /* * Soft update function prototypes. */ -void softdep_initialize (void); -int softdep_mount (struct vnode *, struct mount *, struct fs *); -int softdep_flushfiles (struct mount *, int, struct thread *); -void softdep_update_inodeblock (struct inode *, struct buf *, int); -void softdep_load_inodeblock (struct inode *); -void softdep_freefile (struct vnode *, ino_t, int); -void softdep_setup_freeblocks (struct inode *, off_t); -void softdep_setup_inomapdep (struct buf *, struct inode *, ino_t); -void softdep_setup_blkmapdep (struct buf *, struct fs *, ufs_daddr_t); -void softdep_setup_allocdirect (struct inode *, ufs_lbn_t, ufs_daddr_t, +void softdep_initialize(void); +int softdep_mount(struct vnode *, struct mount *, struct fs *); +int softdep_flushfiles(struct mount *, int, struct thread *); +void softdep_update_inodeblock(struct inode *, struct buf *, int); +void softdep_load_inodeblock(struct inode *); +void softdep_freefile(struct vnode *, ino_t, int); +void softdep_setup_freeblocks(struct inode *, off_t); +void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t); +void softdep_setup_blkmapdep(struct buf *, struct fs *, ufs_daddr_t); +void softdep_setup_allocdirect(struct inode *, ufs_lbn_t, ufs_daddr_t, ufs_daddr_t, long, long, struct buf *); -void softdep_setup_allocindir_meta (struct buf *, struct inode *, +void softdep_setup_allocindir_meta(struct buf *, struct inode *, struct buf *, int, ufs_daddr_t); -void softdep_setup_allocindir_page (struct inode *, ufs_lbn_t, +void softdep_setup_allocindir_page(struct inode *, ufs_lbn_t, struct buf *, int, ufs_daddr_t, ufs_daddr_t, struct buf *); -void softdep_fsync_mountdev (struct vnode *); -int softdep_sync_metadata (struct vop_fsync_args *); +void softdep_fsync_mountdev(struct vnode *); +int softdep_sync_metadata(struct vop_fsync_args *); #endif /* !_UFS_FFS_EXTERN_H */ diff --git a/sys/vfs/ufs/ffs_inode.c b/sys/vfs/ufs/ffs_inode.c index 5ebe847402..8219e0c5e6 100644 --- a/sys/vfs/ufs/ffs_inode.c +++ b/sys/vfs/ufs/ffs_inode.c @@ -32,7 +32,7 @@ * * @(#)ffs_inode.c 8.13 (Berkeley) 4/21/95 * $FreeBSD: src/sys/ufs/ffs/ffs_inode.c,v 1.56.2.5 2002/02/05 18:35:03 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_inode.c,v 1.10 2004/05/18 00:16:46 cpressey Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_inode.c,v 1.11 2004/07/18 19:43:48 drhodus Exp $ */ #include "opt_quota.h" @@ -156,8 +156,8 @@ ffs_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred, #ifdef DIAGNOSTIC if (length != 0) panic("ffs_truncate: partial truncate of symlink"); -#endif - bzero((char *)&oip->i_shortlink, (u_int)oip->i_size); +#endif /* DIAGNOSTIC */ + bzero((char *)&oip->i_shortlink, (uint)oip->i_size); oip->i_size = 0; oip->i_flag |= IN_CHANGE | IN_UPDATE; return (UFS_UPDATE(ovp, 1)); @@ -259,7 +259,7 @@ ffs_truncate(struct vnode *vp, off_t length, int flags, struct ucred *cred, size = blksize(fs, oip, lbn); if (ovp->v_type != VDIR) bzero((char *)bp->b_data + offset, - (u_int)(size - offset)); + (uint)(size - offset)); /* Kirk's code has reallocbuf(bp, size, 1) here */ allocbuf(bp, size); if (bp->b_bufsize == fs->fs_bsize) @@ -472,9 +472,9 @@ ffs_indirtrunc(struct inode *ip, ufs_daddr_t lbn, ufs_daddr_t dbn, bap = (ufs_daddr_t *)bp->b_data; if (lastbn != -1) { MALLOC(copy, ufs_daddr_t *, fs->fs_bsize, M_TEMP, M_WAITOK); - bcopy((caddr_t)bap, (caddr_t)copy, (u_int)fs->fs_bsize); + bcopy((caddr_t)bap, (caddr_t)copy, (uint)fs->fs_bsize); bzero((caddr_t)&bap[last + 1], - (u_int)(NINDIR(fs) - (last + 1)) * sizeof (ufs_daddr_t)); + (uint)(NINDIR(fs) - (last + 1)) * sizeof (ufs_daddr_t)); if (DOINGASYNC(vp)) { bawrite(bp); } else { diff --git a/sys/vfs/ufs/ffs_rawread.c b/sys/vfs/ufs/ffs_rawread.c index 330260ca05..9e9eba44e0 100644 --- a/sys/vfs/ufs/ffs_rawread.c +++ b/sys/vfs/ufs/ffs_rawread.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ufs/ffs/ffs_rawread.c,v 1.3.2.2 2003/05/29 06:15:35 alc Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_rawread.c,v 1.7 2004/03/01 06:33:23 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_rawread.c,v 1.8 2004/07/18 19:43:48 drhodus Exp $ */ #include @@ -158,7 +158,7 @@ ffs_rawread_readahead(struct vnode *vp, caddr_t udata, off_t offset, caddr_t sa, int *baseticks) { int error; - u_int iolen; + uint iolen; off_t blockno; int blockoff; int bsize; @@ -236,7 +236,7 @@ ffs_rawread_main(struct vnode *vp, struct uio *uio) int error, nerror; struct buf *bp, *nbp, *tbp; caddr_t sa, nsa, tsa; - u_int iolen; + uint iolen; int spl; int baseticks = ticks; caddr_t udata; diff --git a/sys/vfs/ufs/ffs_softdep.c b/sys/vfs/ufs/ffs_softdep.c index 7d8ea13e2c..2bf7e8ebb0 100644 --- a/sys/vfs/ufs/ffs_softdep.c +++ b/sys/vfs/ufs/ffs_softdep.c @@ -37,7 +37,7 @@ * * from: @(#)ffs_softdep.c 9.59 (McKusick) 6/21/00 * $FreeBSD: src/sys/ufs/ffs/ffs_softdep.c,v 1.57.2.11 2002/02/05 18:46:53 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_softdep.c,v 1.15 2004/05/19 22:53:06 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_softdep.c,v 1.16 2004/07/18 19:43:48 drhodus Exp $ */ /* @@ -142,66 +142,66 @@ static struct malloc_type *memtype[] = { /* * Internal function prototypes. */ -static void softdep_error (char *, int); -static void drain_output (struct vnode *, int); -static int getdirtybuf (struct buf **, int); -static void clear_remove (struct thread *); -static void clear_inodedeps (struct thread *); -static int flush_pagedep_deps (struct vnode *, struct mount *, +static void softdep_error(char *, int); +static void drain_output(struct vnode *, int); +static int getdirtybuf(struct buf **, int); +static void clear_remove(struct thread *); +static void clear_inodedeps(struct thread *); +static int flush_pagedep_deps(struct vnode *, struct mount *, struct diraddhd *); -static int flush_inodedep_deps (struct fs *, ino_t); -static int handle_written_filepage (struct pagedep *, struct buf *); -static void diradd_inode_written (struct diradd *, struct inodedep *); -static int handle_written_inodeblock (struct inodedep *, struct buf *); -static void handle_allocdirect_partdone (struct allocdirect *); -static void handle_allocindir_partdone (struct allocindir *); -static void initiate_write_filepage (struct pagedep *, struct buf *); -static void handle_written_mkdir (struct mkdir *, int); -static void initiate_write_inodeblock (struct inodedep *, struct buf *); -static void handle_workitem_freefile (struct freefile *); -static void handle_workitem_remove (struct dirrem *); -static struct dirrem *newdirrem (struct buf *, struct inode *, +static int flush_inodedep_deps(struct fs *, ino_t); +static int handle_written_filepage(struct pagedep *, struct buf *); +static void diradd_inode_written(struct diradd *, struct inodedep *); +static int handle_written_inodeblock(struct inodedep *, struct buf *); +static void handle_allocdirect_partdone(struct allocdirect *); +static void handle_allocindir_partdone(struct allocindir *); +static void initiate_write_filepage(struct pagedep *, struct buf *); +static void handle_written_mkdir(struct mkdir *, int); +static void initiate_write_inodeblock(struct inodedep *, struct buf *); +static void handle_workitem_freefile(struct freefile *); +static void handle_workitem_remove(struct dirrem *); +static struct dirrem *newdirrem(struct buf *, struct inode *, struct inode *, int, struct dirrem **); -static void free_diradd (struct diradd *); -static void free_allocindir (struct allocindir *, struct inodedep *); +static void free_diradd(struct diradd *); +static void free_allocindir(struct allocindir *, struct inodedep *); static int indir_trunc (struct inode *, ufs_daddr_t, int, ufs_lbn_t, long *); -static void deallocate_dependencies (struct buf *, struct inodedep *); -static void free_allocdirect (struct allocdirectlst *, +static void deallocate_dependencies(struct buf *, struct inodedep *); +static void free_allocdirect(struct allocdirectlst *, struct allocdirect *, int); -static int check_inode_unwritten (struct inodedep *); -static int free_inodedep (struct inodedep *); -static void handle_workitem_freeblocks (struct freeblks *); -static void merge_inode_lists (struct inodedep *); -static void setup_allocindir_phase2 (struct buf *, struct inode *, +static int check_inode_unwritten(struct inodedep *); +static int free_inodedep(struct inodedep *); +static void handle_workitem_freeblocks(struct freeblks *); +static void merge_inode_lists(struct inodedep *); +static void setup_allocindir_phase2(struct buf *, struct inode *, struct allocindir *); -static struct allocindir *newallocindir (struct inode *, int, ufs_daddr_t, +static struct allocindir *newallocindir(struct inode *, int, ufs_daddr_t, ufs_daddr_t); -static void handle_workitem_freefrag (struct freefrag *); -static struct freefrag *newfreefrag (struct inode *, ufs_daddr_t, long); -static void allocdirect_merge (struct allocdirectlst *, +static void handle_workitem_freefrag(struct freefrag *); +static struct freefrag *newfreefrag(struct inode *, ufs_daddr_t, long); +static void allocdirect_merge(struct allocdirectlst *, struct allocdirect *, struct allocdirect *); -static struct bmsafemap *bmsafemap_lookup (struct buf *); -static int newblk_lookup (struct fs *, ufs_daddr_t, int, +static struct bmsafemap *bmsafemap_lookup(struct buf *); +static int newblk_lookup(struct fs *, ufs_daddr_t, int, struct newblk **); -static int inodedep_lookup (struct fs *, ino_t, int, struct inodedep **); -static int pagedep_lookup (struct inode *, ufs_lbn_t, int, +static int inodedep_lookup(struct fs *, ino_t, int, struct inodedep **); +static int pagedep_lookup(struct inode *, ufs_lbn_t, int, struct pagedep **); -static void pause_timer (void *); -static int request_cleanup (int, int); -static int process_worklist_item (struct mount *, int); -static void add_to_worklist (struct worklist *); +static void pause_timer(void *); +static int request_cleanup(int, int); +static int process_worklist_item(struct mount *, int); +static void add_to_worklist(struct worklist *); /* * Exported softdep operations. */ -static void softdep_disk_io_initiation (struct buf *); -static void softdep_disk_write_complete (struct buf *); -static void softdep_deallocate_dependencies (struct buf *); -static int softdep_fsync (struct vnode *); -static int softdep_process_worklist (struct mount *); -static void softdep_move_dependencies (struct buf *, struct buf *); -static int softdep_count_dependencies (struct buf *bp, int); +static void softdep_disk_io_initiation(struct buf *); +static void softdep_disk_write_complete(struct buf *); +static void softdep_deallocate_dependencies(struct buf *); +static int softdep_fsync(struct vnode *); +static int softdep_process_worklist(struct mount *); +static void softdep_move_dependencies(struct buf *, struct buf *); +static int softdep_count_dependencies(struct buf *bp, int); static struct bio_ops softdep_bioops = { softdep_disk_io_initiation, /* io_start */ @@ -244,9 +244,9 @@ static struct lockit { } lk = { 0, NOHOLDER }; static int lockcnt; -static void acquire_lock (struct lockit *); -static void free_lock (struct lockit *); -void softdep_panic (char *); +static void acquire_lock(struct lockit *); +static void free_lock(struct lockit *); +void softdep_panic(char *); #define ACQUIRE_LOCK(lk) acquire_lock(lk) #define FREE_LOCK(lk) free_lock(lk) @@ -295,7 +295,7 @@ softdep_panic(msg) } #endif /* DEBUG */ -static int interlocked_sleep (struct lockit *, int, void *, int, +static int interlocked_sleep(struct lockit *, int, void *, int, const char *, int); /* @@ -363,9 +363,9 @@ struct sema { int prio; int timo; }; -static void sema_init (struct sema *, char *, int, int); -static int sema_get (struct sema *, struct lockit *); -static void sema_release (struct sema *); +static void sema_init(struct sema *, char *, int, int); +static int sema_get(struct sema *, struct lockit *); +static void sema_release(struct sema *); static void sema_init(semap, name, prio, timo) @@ -437,9 +437,9 @@ sema_release(semap) #define WORKITEM_FREE(item, type) FREE(item, DtoM(type)) #else /* DEBUG */ -static void worklist_insert (struct workhead *, struct worklist *); -static void worklist_remove (struct worklist *); -static void workitem_free (struct worklist *, int); +static void worklist_insert(struct workhead *, struct worklist *); +static void worklist_remove(struct worklist *); +static void workitem_free(struct worklist *, int); #define WORKLIST_INSERT(head, item) worklist_insert(head, item) #define WORKLIST_REMOVE(item) worklist_remove(item) @@ -1071,7 +1071,7 @@ top: /* * Executed during filesystem system initialization before - * mounting any file systems. + * mounting any filesystems. */ void softdep_initialize() @@ -1141,7 +1141,7 @@ softdep_mount(devvp, mp, fs) /* * Protecting the freemaps (or bitmaps). * - * To eliminate the need to execute fsck before mounting a file system + * To eliminate the need to execute fsck before mounting a filesystem * after a power failure, one must (conservatively) guarantee that the * on-disk copy of the bitmaps never indicate that a live inode or block is * free. So, when a block or inode is allocated, the bitmap should be @@ -1156,7 +1156,7 @@ softdep_mount(devvp, mp, fs) * that any additional link additions can be made dependent on the inode * allocation. * - * The ufs file system maintains a number of free block counts (e.g., per + * The ufs filesystem maintains a number of free block counts (e.g., per * cylinder group, per cylinder and per pair) * in addition to the bitmaps. These counts are used to improve efficiency * during allocation and therefore must be consistent with the bitmaps. @@ -2279,7 +2279,7 @@ free_allocindir(aip, inodedep) * simply of the inode number. * * As directory entries are added and deleted, the free space within a - * directory block can become fragmented. The ufs file system will compact + * directory block can become fragmented. The ufs filesystem will compact * a fragmented directory block to make space for a new entry. When this * occurs, the offsets of previously added entries change. Any "diradd" * dependency structures corresponding to these entries must be updated with @@ -2296,7 +2296,7 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp) struct buf *bp; /* buffer containing directory block */ struct inode *dp; /* inode for directory */ off_t diroffset; /* offset of new entry in directory */ - long newinum; /* inode referenced by new directory entry */ + ino_t newinum; /* inode referenced by new directory entry */ struct buf *newdirbp; /* non-NULL => contents of new mkdir */ { int offset; /* offset of new entry within directory block */ @@ -2659,7 +2659,7 @@ softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir) struct buf *bp; /* buffer containing directory block */ struct inode *dp; /* inode for the directory being modified */ struct inode *ip; /* inode for directory entry being removed */ - long newinum; /* new inode number for changed entry */ + ino_t newinum; /* new inode number for changed entry */ int isrmdir; /* indicates if doing RMDIR */ { int offset; @@ -3205,7 +3205,7 @@ initiate_write_inodeblock(inodedep, bp) /* * This routine is called during the completion interrupt * service routine for a disk write (from the procedure called - * by the device driver to inform the file system caches of + * by the device driver to inform the filesystem caches of * a request completion). It should be called early in this * procedure, before the block is made available to other * processes or other routines are called. @@ -3750,7 +3750,7 @@ handle_written_filepage(pagedep, bp) /* * Writing back in-core inode structures. * - * The file system only accesses an inode's contents when it occupies an + * The filesystem only accesses an inode's contents when it occupies an * "in-core" inode structure. These "in-core" structures are separate from * the page frames used to cache inode blocks. Only the latter are * transferred to/from the disk. So, when the updated contents of the diff --git a/sys/vfs/ufs/ffs_softdep_stub.c b/sys/vfs/ufs/ffs_softdep_stub.c index 080bbe8f48..ef3e0d0bc0 100644 --- a/sys/vfs/ufs/ffs_softdep_stub.c +++ b/sys/vfs/ufs/ffs_softdep_stub.c @@ -33,7 +33,7 @@ * * from: @(#)ffs_softdep_stub.c 9.1 (McKusick) 7/10/97 * $FreeBSD: src/sys/ufs/ffs/ffs_softdep_stub.c,v 1.7.2.1 2000/12/28 11:01:45 ps Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_softdep_stub.c,v 1.5 2004/05/18 00:16:46 cpressey Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_softdep_stub.c,v 1.6 2004/07/18 19:43:48 drhodus Exp $ */ /* @@ -123,7 +123,7 @@ softdep_freefile(struct vnode *pvp, ino_t ino, int mode) void softdep_setup_directory_add(struct buf *bp, struct inode *dp, off_t diroffset, - long newinum, struct buf *newdirbp) + ino_t newinum, struct buf *newdirbp) { panic("softdep_setup_directory_add called"); } @@ -145,7 +145,7 @@ softdep_setup_remove(struct buf *bp, struct inode *dp, struct inode *ip, void softdep_setup_directory_change(struct buf *bp, struct inode *dp, - struct inode *ip, long newinum, int isrmdir) + struct inode *ip, ino_t newinum, int isrmdir) { panic("softdep_setup_directory_change called"); } diff --git a/sys/vfs/ufs/ffs_vfsops.c b/sys/vfs/ufs/ffs_vfsops.c index ec2711de9b..c26361b493 100644 --- a/sys/vfs/ufs/ffs_vfsops.c +++ b/sys/vfs/ufs/ffs_vfsops.c @@ -32,7 +32,7 @@ * * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95 * $FreeBSD: src/sys/ufs/ffs/ffs_vfsops.c,v 1.117.2.10 2002/06/23 22:34:52 iedowse Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_vfsops.c,v 1.18 2004/05/19 22:53:06 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_vfsops.c,v 1.19 2004/07/18 19:43:48 drhodus Exp $ */ #include "opt_quota.h" @@ -154,7 +154,7 @@ ffs_mount(struct mount *mp, /* mount struct pointer */ if( path == NULL) { /* *** - * Mounting root file system + * Mounting root filesystem *** */ @@ -174,7 +174,7 @@ ffs_mount(struct mount *mp, /* mount struct pointer */ /* *** - * Mounting non-root file system or updating a file system + * Mounting non-root filesystem or updating a filesystem *** */ @@ -498,9 +498,9 @@ ffs_reload(struct mount *mp, struct ucred *cred, struct thread *td) newfs->fs_csp = fs->fs_csp; newfs->fs_maxcluster = fs->fs_maxcluster; newfs->fs_contigdirs = fs->fs_contigdirs; - /* The file system is still read-only. */ + /* The filesystem is still read-only. */ newfs->fs_ronly = 1; - bcopy(newfs, fs, (u_int)fs->fs_sbsize); + bcopy(newfs, fs, (uint)fs->fs_sbsize); if (fs->fs_sbsize < SBSIZE) bp->b_flags |= B_INVAL; brelse(bp); @@ -524,7 +524,7 @@ ffs_reload(struct mount *mp, struct ucred *cred, struct thread *td) error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size, &bp); if (error) return (error); - bcopy(bp->b_data, space, (u_int)size); + bcopy(bp->b_data, space, (uint)size); space = (char *)space + size; brelse(bp); } @@ -549,8 +549,7 @@ ffs_reload(struct mount *mp, struct ucred *cred, struct thread *td) return(error); } -static -int +static int ffs_reload_scan1(struct mount *mp, struct vnode *vp, void *data) { struct scaninfo *info = data; @@ -565,8 +564,7 @@ ffs_reload_scan1(struct mount *mp, struct vnode *vp, void *data) return(0); } -static -int +static int ffs_reload_scan2(struct mount *mp, struct vnode *vp, lwkt_tokref_t vlock, void *data) { struct scaninfo *info = data; @@ -618,7 +616,7 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td, int error, i, blks, size, ronly; lwkt_tokref vlock; int32_t *lp; - u_int64_t maxfilesize; /* XXX */ + uint64_t maxfilesize; /* XXX */ size_t strsize; /* @@ -710,7 +708,7 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td, ump->um_update = ffs_update; ump->um_valloc = ffs_valloc; ump->um_vfree = ffs_vfree; - bcopy(bp->b_data, ump->um_fs, (u_int)fs->fs_sbsize); + bcopy(bp->b_data, ump->um_fs, (uint)fs->fs_sbsize); if (fs->fs_sbsize < SBSIZE) bp->b_flags |= B_INVAL; brelse(bp); @@ -721,7 +719,7 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td, 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); space = malloc((u_long)size, M_UFSMNT, M_WAITOK); fs->fs_csp = space; for (i = 0; i < blks; i += fs->fs_frag) { @@ -733,7 +731,7 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td, free(fs->fs_csp, M_UFSMNT); goto out; } - bcopy(bp->b_data, space, (u_int)size); + bcopy(bp->b_data, space, (uint)size); space = (char *)space + size; brelse(bp); bp = NULL; @@ -744,8 +742,8 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td, *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); /* Compatibility for old filesystems XXX */ if (fs->fs_avgfilesize <= 0) /* XXX */ @@ -790,10 +788,10 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td, } ump->um_savedmaxfilesize = fs->fs_maxfilesize; /* XXX */ - maxfilesize = (u_int64_t)0x40000000 * fs->fs_bsize - 1; /* XXX */ + maxfilesize = (uint64_t)0x40000000 * fs->fs_bsize - 1; /* XXX */ /* Enforce limit caused by vm object backing (32 bits vm_pindex_t). */ - if (maxfilesize > (u_int64_t)0x80000000u * PAGE_SIZE - 1) - maxfilesize = (u_int64_t)0x80000000u * PAGE_SIZE - 1; + if (maxfilesize > (uint64_t)0x80000000u * PAGE_SIZE - 1) + maxfilesize = (uint64_t)0x80000000u * PAGE_SIZE - 1; if (fs->fs_maxfilesize > maxfilesize) /* XXX */ fs->fs_maxfilesize = maxfilesize; /* XXX */ if (ronly == 0) { @@ -821,7 +819,7 @@ out: } /* - * Sanity checks for old file systems. + * Sanity checks for old filesystems. * * XXX - goes away some day. */ @@ -835,7 +833,7 @@ ffs_oldfscompat(struct fs *fs) if (fs->fs_inodefmt < FS_44INODEFMT) { /* XXX */ #if 0 int i; /* XXX */ - u_int64_t sizepb = fs->fs_bsize; /* XXX */ + uint64_t sizepb = fs->fs_bsize; /* XXX */ /* XXX */ fs->fs_maxfilesize = fs->fs_bsize * NDADDR - 1; /* XXX */ for (i = 0; i < NIADDR; i++) { /* XXX */ @@ -938,7 +936,7 @@ ffs_flushfiles(struct mount *mp, int flags, struct thread *td) } /* - * Get file system statistics. + * Get filesystem statistics. */ int ffs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) @@ -1007,7 +1005,7 @@ ffs_sync(struct mount *mp, int waitfor, struct thread *td) } /* - * Force stale file system control information to be flushed. + * Force stale filesystem control information to be flushed. */ if (waitfor != MNT_LAZY) { if (ump->um_mountp->mnt_flag & MNT_SOFTDEP) @@ -1028,8 +1026,7 @@ ffs_sync(struct mount *mp, int waitfor, struct thread *td) return (scaninfo.allerror); } -static -int +static int ffs_sync_scan1(struct mount *mp, struct vnode *vp, void *data) { struct inode *ip; @@ -1049,8 +1046,7 @@ ffs_sync_scan1(struct mount *mp, struct vnode *vp, void *data) return(0); } -static -int +static int ffs_sync_scan2(struct mount *mp, struct vnode *vp, lwkt_tokref_t vlock, void *data) { @@ -1319,7 +1315,7 @@ ffs_sbupdate(struct ufsmount *mp, int waitfor) size = (blks - i) * fs->fs_fsize; bp = getblk(mp->um_devvp, fsbtodb(fs, fs->fs_csaddr + i), size, 0, 0); - bcopy(space, bp->b_data, (u_int)size); + bcopy(space, bp->b_data, (uint)size); space = (char *)space + size; if (waitfor != MNT_WAIT) bawrite(bp); @@ -1336,8 +1332,8 @@ ffs_sbupdate(struct ufsmount *mp, int waitfor) bp = getblk(mp->um_devvp, SBLOCK, (int)fs->fs_sbsize, 0, 0); fs->fs_fmod = 0; fs->fs_time = time_second; - bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize); - /* Restore compatibility to old file systems. XXX */ + bcopy((caddr_t)fs, bp->b_data, (uint)fs->fs_sbsize); + /* Restore compatibility to old filesystems. XXX */ dfs = (struct fs *)bp->b_data; /* XXX */ if (fs->fs_postblformat == FS_42POSTBLFMT) /* XXX */ dfs->fs_nrpos = -1; /* XXX */ diff --git a/sys/vfs/ufs/fs.h b/sys/vfs/ufs/fs.h index e4deb289ef..98d4c0e356 100644 --- a/sys/vfs/ufs/fs.h +++ b/sys/vfs/ufs/fs.h @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * @@ -32,25 +32,25 @@ * * @(#)fs.h 8.13 (Berkeley) 3/21/95 * $FreeBSD: src/sys/ufs/ffs/fs.h,v 1.14.2.3 2001/09/21 19:15:22 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/fs.h,v 1.2 2003/06/17 04:28:59 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/fs.h,v 1.3 2004/07/18 19:43:48 drhodus Exp $ */ #ifndef _UFS_FFS_FS_H_ #define _UFS_FFS_FS_H_ /* - * Each disk drive contains some number of file systems. - * A file system consists of a number of cylinder groups. + * Each disk drive contains some number of filesystems. + * A filesystem consists of a number of cylinder groups. * Each cylinder group has inodes and data. * - * A file system is described by its super-block, which in turn + * A filesystem is described by its super-block, which in turn * describes the cylinder groups. The super-block is critical * data and is replicated in each cylinder group to protect against * catastrophic loss. This is done at `newfs' time and the critical * super-block data does not change, so the copies need not be * referenced further unless disaster strikes. * - * For file system fs, the offsets of the various blocks of interest + * For filesystem fs, the offsets of the various blocks of interest * are given in the super block as: * [fs->fs_sblkno] Super-block * [fs->fs_cblkno] Cylinder group block @@ -71,7 +71,7 @@ /* * Addresses stored in inodes are capable of addressing fragments - * of `blocks'. File system blocks of at most size MAXBSIZE can + * of `blocks'. Filesystem blocks of at most size MAXBSIZE can * be optionally broken into 2, 4, or 8 pieces, each of which is * addressable; these pieces may be DEV_BSIZE, or some multiple of * a DEV_BSIZE unit. @@ -79,12 +79,12 @@ * Large files consist of exclusively large data blocks. To avoid * undue wasted disk space, the last data block of a small file may be * allocated as only as many fragments of a large block as are - * necessary. The file system format retains only a single pointer + * necessary. The filesystem format retains only a single pointer * to such a fragment, which is a piece of a single large block that * has been divided. The size of such a fragment is determinable from * information in the inode, using the ``blksize(fs, ip, lbn)'' macro. * - * The file system records space availability at the fragment level; + * The filesystem records space availability at the fragment level; * to determine block availability, aligned fragments are examined. */ @@ -100,7 +100,7 @@ #define MINBSIZE 4096 /* - * The path name on which the file system is mounted is maintained + * The path name on which the filesystem is mounted is maintained * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in * the super block for this name. */ @@ -130,11 +130,11 @@ #define FS_MAXCONTIG 16 /* - * MINFREE gives the minimum acceptable percentage of file system + * MINFREE gives the minimum acceptable percentage of filesystem * blocks which may be free. If the freelist drops below this level * only the superuser may continue to allocate blocks. This may * be set to 0 if no reserve of free blocks is deemed necessary, - * however throughput drops by fifty percent if the file system + * however throughput drops by fifty percent if the filesystem * is run at between 95% and 100% full; thus the minimum default * value of fs_minfree is 5%. However, to get good clustering * performance, 10% is a better choice. hence we use 10% as our @@ -151,7 +151,7 @@ * which tell the system the average file size and the average number * of files per directory. These defaults are well selected for typical * filesystems, but may need to be tuned for odd cases like filesystems - * being used for sqiud caches or news spools. + * being used for squid caches or news spools. */ #define AVFILESIZ 16384 /* expected average file size */ #define AFPDIR 64 /* expected number of files per directory */ @@ -164,8 +164,9 @@ * maintaining too many will slow the filesystem performance, so * having this limit is a good idea. * - * VALUE NOT IMPLEMENTED IN 4.x YET, RESERVED FROM -CURRENT SO SUPERBLOCKS - * REMAIN COMPATIBLE. + * VALUE NOT IMPLEMENTED IN DragonFly(and very unlikely to ever be as there are + * much better options such as journaling), RESERVED FROM FreeBSD 5.x SO + * SUPERBLOCKS REMAIN COMPATIBLE FOR THE TIME BEING. WHY ARE WE YELLING ? */ #define FSMAXSNAP 20 @@ -183,10 +184,10 @@ struct csum { }; /* - * Super block for an FFS file system. + * Super block for an FFS filesystem. */ struct fs { - int32_t fs_firstfield; /* historic file system linked list, */ + int32_t fs_firstfield; /* historic filesystem linked list, */ int32_t fs_unused_1; /* used for incore super blocks */ ufs_daddr_t fs_sblkno; /* addr of super-block in filesys */ ufs_daddr_t fs_cblkno; /* offset of cyl-block in filesys */ @@ -239,7 +240,7 @@ struct fs { int32_t fs_nsect; /* sectors per track */ int32_t fs_spc; /* sectors per cylinder */ /* this comes from the disk driver partitioning */ - int32_t fs_ncyl; /* cylinders in file system */ + int32_t fs_ncyl; /* cylinders in filesystem */ /* these fields can be computed from the others */ int32_t fs_cpg; /* cylinders per group */ int32_t fs_ipg; /* inodes per group */ @@ -248,14 +249,14 @@ struct fs { struct csum fs_cstotal; /* cylinder summary information */ /* these fields are cleared at mount time */ int8_t fs_fmod; /* super block modified flag */ - int8_t fs_clean; /* file system is clean flag */ + int8_t fs_clean; /* filesystem is clean flag */ int8_t fs_ronly; /* mounted read-only flag */ int8_t fs_flags; /* see FS_ flags below */ u_char fs_fsmnt[MAXMNTLEN]; /* name mounted on */ /* these fields retain the current block allocation info */ int32_t fs_cgrotor; /* last cg searched */ void *fs_ocsp[NOCSPTRS]; /* padding; was list of fs_cs buffers */ - u_int8_t *fs_contigdirs; /* # of contiguously allocated dirs */ + uint8_t *fs_contigdirs; /* # of contiguously allocated dirs */ struct csum *fs_csp; /* cg summary info buffer for fs_cs */ int32_t *fs_maxcluster; /* max cluster in each cyl group */ int32_t fs_cpc; /* cyl per cycle in postbl */ @@ -269,16 +270,16 @@ struct fs { int32_t fs_contigsumsize; /* size of cluster summary array */ int32_t fs_maxsymlinklen; /* max length of an internal symlink */ int32_t fs_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 */ int32_t fs_postblformat; /* format of positional layout tables */ int32_t fs_nrpos; /* number of rotational positions */ - int32_t fs_postbloff; /* (u_int16) rotation block list head */ - int32_t fs_rotbloff; /* (u_int8) blocks for each rotation */ + int32_t fs_postbloff; /* (uint16) rotation block list head */ + int32_t fs_rotbloff; /* (uint8) blocks for each rotation */ int32_t fs_magic; /* magic number */ - u_int8_t fs_space[1]; /* list of blocks for each rotation */ + uint8_t fs_space[1]; /* list of blocks for each rotation */ /* actually longer */ }; @@ -313,12 +314,12 @@ struct fs { #define fs_postbl(fs, cylno) \ (((fs)->fs_postblformat == FS_42POSTBLFMT) \ ? ((fs)->fs_opostbl[cylno]) \ - : ((int16_t *)((u_int8_t *)(fs) + \ + : ((int16_t *)((uint8_t *)(fs) + \ (fs)->fs_postbloff) + (cylno) * (fs)->fs_nrpos)) #define fs_rotbl(fs) \ (((fs)->fs_postblformat == FS_42POSTBLFMT) \ ? ((fs)->fs_space) \ - : ((u_int8_t *)((u_int8_t *)(fs) + (fs)->fs_rotbloff))) + : ((uint8_t *)((uint8_t *)(fs) + (fs)->fs_rotbloff))) /* * The size of a cylinder group is calculated by CGSIZE. The maximum size @@ -342,7 +343,7 @@ struct fs { #define fs_cs(fs, indx) fs_csp[indx] /* - * Cylinder group block for a file system. + * Cylinder group block for a filesystem. */ #define CG_MAGIC 0x090255 struct cg { @@ -359,15 +360,15 @@ struct cg { int32_t cg_irotor; /* position of last used inode */ int32_t cg_frsum[MAXFRAG]; /* counts of available frags */ int32_t cg_btotoff; /* (int32) block totals per cylinder */ - int32_t cg_boff; /* (u_int16) free block positions */ - int32_t cg_iusedoff; /* (u_int8) used inode map */ - int32_t cg_freeoff; /* (u_int8) free block map */ - int32_t cg_nextfreeoff; /* (u_int8) next available space */ - int32_t cg_clustersumoff; /* (u_int32) counts of avail clusters */ - int32_t cg_clusteroff; /* (u_int8) free cluster map */ + int32_t cg_boff; /* (uint16) free block positions */ + int32_t cg_iusedoff; /* (uint8) used inode map */ + int32_t cg_freeoff; /* (uint8) free block map */ + int32_t cg_nextfreeoff; /* (uint8) next available space */ + int32_t cg_clustersumoff; /* (uint32) counts of avail clusters */ + int32_t cg_clusteroff; /* (uint8) free cluster map */ int32_t cg_nclusterblks; /* number of clusters this cg */ int32_t cg_sparecon[13]; /* reserved for future use */ - u_int8_t cg_space[1]; /* space for cylinder group maps */ + uint8_t cg_space[1]; /* space for cylinder group maps */ /* actually longer */ }; @@ -377,30 +378,30 @@ struct cg { #define cg_blktot(cgp) \ (((cgp)->cg_magic != CG_MAGIC) \ ? (((struct ocg *)(cgp))->cg_btot) \ - : ((int32_t *)((u_int8_t *)(cgp) + (cgp)->cg_btotoff))) + : ((int32_t *)((uint8_t *)(cgp) + (cgp)->cg_btotoff))) #define cg_blks(fs, cgp, cylno) \ (((cgp)->cg_magic != CG_MAGIC) \ ? (((struct ocg *)(cgp))->cg_b[cylno]) \ - : ((int16_t *)((u_int8_t *)(cgp) + \ + : ((int16_t *)((uint8_t *)(cgp) + \ (cgp)->cg_boff) + (cylno) * (fs)->fs_nrpos)) #define cg_inosused(cgp) \ (((cgp)->cg_magic != CG_MAGIC) \ ? (((struct ocg *)(cgp))->cg_iused) \ - : ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_iusedoff))) + : ((uint8_t *)((uint8_t *)(cgp) + (cgp)->cg_iusedoff))) #define cg_blksfree(cgp) \ (((cgp)->cg_magic != CG_MAGIC) \ ? (((struct ocg *)(cgp))->cg_free) \ - : ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_freeoff))) + : ((uint8_t *)((uint8_t *)(cgp) + (cgp)->cg_freeoff))) #define cg_chkmagic(cgp) \ ((cgp)->cg_magic == CG_MAGIC || ((struct ocg *)(cgp))->cg_magic == CG_MAGIC) #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 *)((u_int8_t *)(cgp) + (cgp)->cg_clustersumoff)) + ((int32_t *)((uint8_t *)(cgp) + (cgp)->cg_clustersumoff)) /* * The following structure is defined - * for compatibility with old file systems. + * for compatibility with old filesystems. */ struct ocg { int32_t cg_firstfield; /* historic linked list of cyl groups */ @@ -417,22 +418,22 @@ struct ocg { int32_t cg_frsum[8]; /* counts of available frags */ int32_t cg_btot[32]; /* block totals per cylinder */ int16_t cg_b[32][8]; /* positions of free blocks */ - u_int8_t cg_iused[256]; /* used inode map */ + uint8_t cg_iused[256]; /* used inode map */ int32_t cg_magic; /* magic number */ - u_int8_t cg_free[1]; /* free block map */ + uint8_t cg_free[1]; /* free block map */ /* actually longer */ }; /* - * Turn file system block numbers into disk block addresses. - * This maps file system blocks to device size blocks. + * Turn filesystem block numbers into disk block addresses. + * This maps filesystem blocks to device size blocks. */ #define fsbtodb(fs, b) ((b) << (fs)->fs_fsbtodb) #define dbtofsb(fs, b) ((b) >> (fs)->fs_fsbtodb) /* * Cylinder group macros to locate things in cylinder groups. - * They calc file system addresses of cylinder group data structures. + * They calc filesystem addresses of cylinder group data structures. */ #define cgbase(fs, c) ((ufs_daddr_t)((fs)->fs_fpg * (c))) #define cgdmin(fs, c) (cgstart(fs, c) + (fs)->fs_dblkno) /* 1st data */ @@ -444,9 +445,9 @@ struct ocg { /* * Macros for handling inode numbers: - * inode number to file system block offset. + * inode number to filesystem block offset. * inode number to cylinder group number. - * inode number to file system block address. + * inode number to filesystem block address. */ #define ino_to_cg(fs, x) ((x) / (fs)->fs_ipg) #define ino_to_fsba(fs, x) \ @@ -455,8 +456,8 @@ struct ocg { #define ino_to_fsbo(fs, x) ((x) % INOPB(fs)) /* - * Give cylinder group number for a file system block. - * Give cylinder group block number for a file system block. + * Give cylinder group number for a filesystem block. + * Give cylinder group block number for a filesystem block. */ #define dtog(fs, d) ((d) / (fs)->fs_fpg) #define dtogd(fs, d) ((d) % (fs)->fs_fpg) @@ -515,7 +516,7 @@ struct ocg { ((off_t)((fs)->fs_dsize) * (percentreserved) / 100)) /* - * Determining the size of a file block in the file system. + * Determining the size of a file block in the filesystem. */ #define blksize(fs, ip, lbn) \ (((lbn) >= NDADDR || (ip)->i_size >= smalllblktosize(fs, (lbn) + 1)) \ @@ -545,11 +546,11 @@ struct ocg { #define INOPF(fs) ((fs)->fs_inopb >> (fs)->fs_fragshift) /* - * Number of indirects in a file system block. + * Number of indirects in a filesystem block. */ #define NINDIR(fs) ((fs)->fs_nindir) extern int inside[], around[]; extern u_char *fragtbl[]; -#endif +#endif /* !_UFS_FFS_FS_H_ */ diff --git a/sys/vfs/ufs/inode.h b/sys/vfs/ufs/inode.h index 5346081891..b2407e4f5c 100644 --- a/sys/vfs/ufs/inode.h +++ b/sys/vfs/ufs/inode.h @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1982, 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. @@ -37,7 +37,7 @@ * * @(#)inode.h 8.9 (Berkeley) 5/14/95 * $FreeBSD: src/sys/ufs/ufs/inode.h,v 1.28.2.2 2001/09/29 12:52:52 iedowse Exp $ - * $DragonFly: src/sys/vfs/ufs/inode.h,v 1.6 2004/05/03 16:06:27 joerg Exp $ + * $DragonFly: src/sys/vfs/ufs/inode.h,v 1.7 2004/07/18 19:43:48 drhodus Exp $ */ #ifndef _UFS_UFS_INODE_H_ @@ -80,7 +80,7 @@ struct inode { LIST_ENTRY(inode) i_hash;/* Hash chain. */ struct vnode *i_vnode;/* Vnode associated with this inode. */ struct vnode *i_devvp;/* Vnode for block I/O. */ - u_int32_t i_flag; /* flags, see below */ + uint32_t i_flag; /* flags, see below */ dev_t i_dev; /* Device associated with the inode. */ ino_t i_number; /* The identity of the inode. */ int i_effnlink; /* i_nlink when I/O completes */ @@ -102,8 +102,8 @@ struct inode { doff_t i_diroff; /* Offset in dir, where we found last entry. */ doff_t i_offset; /* Offset of free space in directory. */ ino_t i_ino; /* Inode number of found directory. */ - u_int32_t i_reclen; /* Size of found directory entry. */ - u_int32_t i_spare[3]; /* XXX actually non-spare (for ext2fs). */ + uint32_t i_reclen; /* Size of found directory entry. */ + uint32_t i_spare[3]; /* XXX actually non-spare (for ext2fs). */ struct dirhash *i_dirhash; /* Hashing for large directories */ /* @@ -166,8 +166,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. */ ino_t ufid_ino; /* File number (ino). */ int32_t ufid_gen; /* Generation number. */ }; diff --git a/sys/vfs/ufs/quota.h b/sys/vfs/ufs/quota.h index cd85724669..4eff050709 100644 --- a/sys/vfs/ufs/quota.h +++ b/sys/vfs/ufs/quota.h @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * @@ -35,7 +35,7 @@ * * @(#)quota.h 8.3 (Berkeley) 8/19/94 * $FreeBSD: src/sys/ufs/ufs/quota.h,v 1.15.2.1 2003/02/27 12:04:13 das Exp $ - * $DragonFly: src/sys/vfs/ufs/quota.h,v 1.4 2003/08/20 09:56:34 rob Exp $ + * $DragonFly: src/sys/vfs/ufs/quota.h,v 1.5 2004/07/18 19:43:48 drhodus Exp $ */ #ifndef _UFS_UFS_QUOTA_H_ @@ -99,12 +99,12 @@ * structure). */ struct dqblk { - 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 */ time_t dqb_btime; /* time limit for excessive disk use */ time_t dqb_itime; /* time limit for excessive files */ }; @@ -122,10 +122,10 @@ struct dqblk { struct dquot { LIST_ENTRY(dquot) dq_hash; /* hash list */ TAILQ_ENTRY(dquot) dq_freelist; /* free list */ - u_int16_t dq_flags; /* flags, see below */ - u_int16_t dq_type; /* quota type of this dquot */ - u_int32_t dq_cnt; /* 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; /* count of active references */ + uint32_t dq_id; /* identifier this applies to */ struct ufsmount *dq_ump; /* filesystem that this is taken from */ struct dqblk dq_dqb; /* actual usage & quotas */ }; @@ -179,25 +179,25 @@ struct thread; struct ucred; struct vnode; -int chkdq (struct inode *, long, struct ucred *, int); -int chkiq (struct inode *, long, struct ucred *, int); -void dqinit (void); -void dqrele (struct vnode *, struct dquot *); -int getinoquota (struct inode *); -int getquota (struct mount *, u_long, int, caddr_t); -int qsync (struct mount *mp); -int quotaoff (struct thread *, struct mount *, int); -int quotaon (struct thread *, struct mount *, int, caddr_t); -int setquota (struct mount *, u_long, int, caddr_t); -int setuse (struct mount *, u_long, int, caddr_t); -int ufs_quotactl (struct mount *, int, uid_t, caddr_t, struct thread *); +int chkdq(struct inode *, long, struct ucred *, int); +int chkiq(struct inode *, long, struct ucred *, int); +void dqinit(void); +void dqrele(struct vnode *, struct dquot *); +int getinoquota(struct inode *); +int getquota(struct mount *, u_long, int, caddr_t); +int qsync(struct mount *mp); +int quotaoff(struct thread *, struct mount *, int); +int quotaon(struct thread *, struct mount *, int, caddr_t); +int setquota(struct mount *, u_long, int, caddr_t); +int setuse(struct mount *, u_long, int, caddr_t); +int ufs_quotactl(struct mount *, int, uid_t, caddr_t, struct thread *); #else /* !_KERNEL */ #include __BEGIN_DECLS -int quotactl (const char *, int, int, void *); +int quotactl(const char *, int, int, void *); __END_DECLS #endif /* _KERNEL */ diff --git a/sys/vfs/ufs/softdep.h b/sys/vfs/ufs/softdep.h index aab7aaed2d..ab8c8031ae 100644 --- a/sys/vfs/ufs/softdep.h +++ b/sys/vfs/ufs/softdep.h @@ -1,4 +1,4 @@ -/* +/*- * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved. * * The soft updates code is derived from the appendix of a University @@ -37,7 +37,7 @@ * * @(#)softdep.h 9.7 (McKusick) 6/21/00 * $FreeBSD: src/sys/ufs/ffs/softdep.h,v 1.7.2.1 2000/06/22 19:27:42 peter Exp $ - * $DragonFly: src/sys/vfs/ufs/softdep.h,v 1.2 2003/06/17 04:28:59 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/softdep.h,v 1.3 2004/07/18 19:43:48 drhodus Exp $ */ #include diff --git a/sys/vfs/ufs/ufs_dirhash.c b/sys/vfs/ufs/ufs_dirhash.c index 060e3b4760..94ebe9d70d 100644 --- a/sys/vfs/ufs/ufs_dirhash.c +++ b/sys/vfs/ufs/ufs_dirhash.c @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 2001 Ian Dowse. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ufs/ufs/ufs_dirhash.c,v 1.3.2.6 2002/04/10 21:41:14 dwmalone Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_dirhash.c,v 1.4 2004/05/18 00:16:46 cpressey Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_dirhash.c,v 1.5 2004/07/18 19:43:48 drhodus Exp $ */ /* * This implements a hash-based lookup scheme for UFS directories. @@ -159,7 +159,7 @@ ufsdirhash_build(struct inode *ip) return (-1); MALLOC(dh->dh_hash, doff_t **, narrays * sizeof(dh->dh_hash[0]), M_DIRHASH, M_NOWAIT | M_ZERO); - MALLOC(dh->dh_blkfree, u_int8_t *, nblocks * sizeof(dh->dh_blkfree[0]), + MALLOC(dh->dh_blkfree, uint8_t *, nblocks * sizeof(dh->dh_blkfree[0]), M_DIRHASH, M_NOWAIT); if (dh->dh_hash == NULL || dh->dh_blkfree == NULL) goto fail; @@ -788,7 +788,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 ofther bit of data which is @@ -929,7 +929,7 @@ ufsdirhash_recycle(int wanted) { struct dirhash *dh; doff_t **hash; - u_int8_t *blkfree; + uint8_t *blkfree; int i, mem, narrays; while (wanted + ufs_dirhashmem > ufs_dirhashmaxmem) { diff --git a/sys/vfs/ufs/ufs_extern.h b/sys/vfs/ufs/ufs_extern.h index 74afc29cd2..64edff808a 100644 --- a/sys/vfs/ufs/ufs_extern.h +++ b/sys/vfs/ufs/ufs_extern.h @@ -32,7 +32,7 @@ * * @(#)ufs_extern.h 8.10 (Berkeley) 5/14/95 * $FreeBSD: src/sys/ufs/ufs/ufs_extern.h,v 1.27.2.1 2000/12/28 11:01:46 ps Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_extern.h,v 1.5 2003/08/20 09:56:34 rob Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_extern.h,v 1.6 2004/07/18 19:43:48 drhodus Exp $ */ #ifndef _UFS_UFS_EXTERN_H_ @@ -55,55 +55,55 @@ struct vop_generic_args; struct vop_inactive_args; struct vop_reclaim_args; -int ufs_vnoperate (struct vop_generic_args *); -int ufs_vnoperatefifo (struct vop_generic_args *); -int ufs_vnoperatespec (struct vop_generic_args *); +int ufs_vnoperate(struct vop_generic_args *); +int ufs_vnoperatefifo(struct vop_generic_args *); +int ufs_vnoperatespec(struct vop_generic_args *); -int ufs_bmap (struct vop_bmap_args *); -int ufs_bmaparray (struct vnode *, daddr_t, daddr_t *, struct indir *, +int ufs_bmap(struct vop_bmap_args *); +int ufs_bmaparray(struct vnode *, daddr_t, daddr_t *, struct indir *, int *, int *, int *); -int ufs_check_export (struct mount *, struct sockaddr *, +int ufs_check_export(struct mount *, struct sockaddr *, int *, struct ucred **); int ufs_fhtovp(struct mount *, struct ufid *, struct vnode **); -int ufs_checkpath (struct inode *, struct inode *, struct ucred *); -void ufs_dirbad (struct inode *, doff_t, char *); -int ufs_dirbadentry (struct vnode *, struct direct *, int); -int ufs_dirempty (struct inode *, ino_t, struct ucred *); -void ufs_makedirentry (struct inode *, struct componentname *, +int ufs_checkpath(struct inode *, struct inode *, struct ucred *); +void ufs_dirbad(struct inode *, doff_t, char *); +int ufs_dirbadentry(struct vnode *, struct direct *, int); +int ufs_dirempty(struct inode *, ino_t, struct ucred *); +void ufs_makedirentry(struct inode *, struct componentname *, struct direct *); -int ufs_direnter (struct vnode *, struct vnode *, struct direct *, +int ufs_direnter(struct vnode *, struct vnode *, struct direct *, struct componentname *, struct buf *); -int ufs_dirremove (struct vnode *, struct inode *, int, int); -int ufs_dirrewrite (struct inode *, struct inode *, ino_t, int, int); -int ufs_getlbns (struct vnode *, ufs_daddr_t, struct indir *, int *); +int ufs_dirremove(struct vnode *, struct inode *, int, int); +int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, int); +int ufs_getlbns(struct vnode *, ufs_daddr_t, struct indir *, int *); struct vnode * - ufs_ihashget (dev_t, ino_t); -void ufs_ihashinit (void); -void ufs_ihashins (struct inode *); + ufs_ihashget(dev_t, ino_t); +void ufs_ihashinit(void); +void ufs_ihashins(struct inode *); struct vnode * - ufs_ihashlookup (dev_t, ino_t); -void ufs_ihashrem (struct inode *); -int ufs_inactive (struct vop_inactive_args *); -int ufs_init (struct vfsconf *); -void ufs_itimes (struct vnode *vp); -int ufs_lookup (struct vop_cachedlookup_args *); -int ufs_reclaim (struct vop_reclaim_args *); -int ufs_root (struct mount *, struct vnode **); -int ufs_start (struct mount *, int, struct thread *); -int ufs_vinit (struct mount *, vop_t **, vop_t **, struct vnode **); + ufs_ihashlookup(dev_t, ino_t); +void ufs_ihashrem(struct inode *); +int ufs_inactive(struct vop_inactive_args *); +int ufs_init(struct vfsconf *); +void ufs_itimes(struct vnode *vp); +int ufs_lookup(struct vop_cachedlookup_args *); +int ufs_reclaim(struct vop_reclaim_args *); +int ufs_root(struct mount *, struct vnode **); +int ufs_start(struct mount *, int, struct thread *); +int ufs_vinit(struct mount *, vop_t **, vop_t **, struct vnode **); /* * Soft update function prototypes. */ -void softdep_setup_directory_add (struct buf *, struct inode *, off_t, - long, struct buf *); -void softdep_change_directoryentry_offset (struct inode *, caddr_t, +void softdep_setup_directory_add(struct buf *, struct inode *, off_t, + ino_t, struct buf *); +void softdep_change_directoryentry_offset(struct inode *, caddr_t, caddr_t, caddr_t, int); -void softdep_setup_remove (struct buf *,struct inode *, struct inode *, +void softdep_setup_remove(struct buf *,struct inode *, struct inode *, int); -void softdep_setup_directory_change (struct buf *, struct inode *, - struct inode *, long, int); -void softdep_change_linkcnt (struct inode *); -int softdep_slowdown (struct vnode *); +void softdep_setup_directory_change(struct buf *, struct inode *, + struct inode *, ino_t, int); +void softdep_change_linkcnt(struct inode *); +int softdep_slowdown(struct vnode *); #endif /* !_UFS_UFS_EXTERN_H_ */ diff --git a/sys/vfs/ufs/ufs_lookup.c b/sys/vfs/ufs/ufs_lookup.c index cb800c880a..cd65c47e40 100644 --- a/sys/vfs/ufs/ufs_lookup.c +++ b/sys/vfs/ufs/ufs_lookup.c @@ -37,7 +37,7 @@ * * @(#)ufs_lookup.c 8.15 (Berkeley) 6/16/95 * $FreeBSD: src/sys/ufs/ufs/ufs_lookup.c,v 1.33.2.7 2001/09/22 19:22:13 iedowse Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_lookup.c,v 1.12 2004/05/18 00:16:46 cpressey Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_lookup.c,v 1.13 2004/07/18 19:43:48 drhodus Exp $ */ #include "opt_ufs.h" @@ -79,7 +79,7 @@ SYSCTL_INT(_debug, OID_AUTO, dircheck, CTLFLAG_RW, &dirchk, 0, ""); /* * Convert a component of a pathname into a pointer to a locked inode. * This is a very central and rather complicated routine. - * If the file system is not maintained in a strict tree hierarchy, + * If the filesystem is not maintained in a strict tree hierarchy, * this can result in a deadlock situation (see comments in code below). * * The cnp->cn_nameiop argument is LOOKUP, CREATE, RENAME, or DELETE depending @@ -584,7 +584,7 @@ found: * infrequently since we cannot avoid this race condition without * implementing a sophisticated deadlock detection algorithm. * Note also that this simple deadlock detection scheme will not - * work if the file system has any hard links other than ".." + * work if the filesystem has any hard links other than ".." * that point backwards in the directory structure. */ pdp = vdp; @@ -729,7 +729,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, int newentrysize; struct inode *dp; struct buf *bp; - u_int dsize; + uint dsize; struct direct *ep, *nep; int error, ret, blkoff, loc, spacefree, flags; char *dirbuf; @@ -902,7 +902,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, dirp->d_reclen == spacefree)) ufsdirhash_add(dp, dirp, dp->i_offset + ((char *)ep - dirbuf)); #endif - bcopy((caddr_t)dirp, (caddr_t)ep, (u_int)newentrysize); + bcopy((caddr_t)dirp, (caddr_t)ep, (uint)newentrysize); #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) ufsdirhash_checkblock(dp, dirbuf - @@ -937,7 +937,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, if (dp->i_dirhash != NULL) ufsdirhash_dirtrunc(dp, dp->i_endoff); #endif - (void) UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_SYNC, cred, td); + (void)UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, IO_SYNC, cred, td); if (tvp != NULL) vn_lock(tvp, NULL, LK_EXCLUSIVE | LK_RETRY, td); } diff --git a/sys/vfs/ufs/ufs_quota.c b/sys/vfs/ufs/ufs_quota.c index dabbf00408..3c094c4a35 100644 --- a/sys/vfs/ufs/ufs_quota.c +++ b/sys/vfs/ufs/ufs_quota.c @@ -35,7 +35,7 @@ * * @(#)ufs_quota.c 8.5 (Berkeley) 5/20/95 * $FreeBSD: src/sys/ufs/ufs/ufs_quota.c,v 1.27.2.3 2002/01/15 10:33:32 phk Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_quota.c,v 1.13 2004/05/18 00:16:46 cpressey Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_quota.c,v 1.14 2004/07/18 19:43:48 drhodus Exp $ */ #include @@ -369,7 +369,7 @@ struct scaninfo { }; /* - * Q_QUOTAON - set up a quota file for a particular file system. + * Q_QUOTAON - set up a quota file for a particular filesystem. */ static int quotaon_scan(struct mount *mp, struct vnode *vp, lwkt_tokref_t vlock, void *data); @@ -439,8 +439,7 @@ quotaon(struct thread *td, struct mount *mp, int type, caddr_t fname) return (error); } -static -int +static int quotaon_scan(struct mount *mp, struct vnode *vp, lwkt_tokref_t vlock, void *data) { @@ -510,8 +509,7 @@ quotaoff(struct thread *td, struct mount *mp, int type) return (error); } -static -int +static int quotaoff_scan(struct mount *mp, struct vnode *vp, lwkt_tokref_t vlock, void *data) { @@ -689,8 +687,7 @@ qsync(struct mount *mp) return (0); } -static -int +static int qsync_scan(struct mount *mp, struct vnode *vp, lwkt_tokref_t vlock, void *data) { diff --git a/sys/vfs/ufs/ufs_readwrite.c b/sys/vfs/ufs/ufs_readwrite.c index d9ad5e1455..21c923b927 100644 --- a/sys/vfs/ufs/ufs_readwrite.c +++ b/sys/vfs/ufs/ufs_readwrite.c @@ -32,7 +32,7 @@ * * @(#)ufs_readwrite.c 8.11 (Berkeley) 5/8/95 * $FreeBSD: src/sys/ufs/ufs/ufs_readwrite.c,v 1.65.2.14 2003/04/04 22:21:29 tegge Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_readwrite.c,v 1.11 2004/05/18 00:16:46 cpressey Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_readwrite.c,v 1.12 2004/07/18 19:43:48 drhodus Exp $ */ #define BLKSIZE(a, b, c) blksize(a, b, c) @@ -108,7 +108,7 @@ ffs_read(struct vop_read_args *ap) panic("ffs_read: type %d", vp->v_type); #endif fs = ip->I_FS; - if ((u_int64_t)uio->uio_offset > fs->fs_maxfilesize) + if ((uint64_t)uio->uio_offset > fs->fs_maxfilesize) return (EFBIG); orig_resid = uio->uio_resid; @@ -450,7 +450,7 @@ ffs_write(struct vop_write_args *ap) fs = ip->I_FS; if (uio->uio_offset < 0 || - (u_int64_t)uio->uio_offset + uio->uio_resid > fs->fs_maxfilesize) { + (uint64_t)uio->uio_offset + uio->uio_resid > fs->fs_maxfilesize) { if (object) vm_object_vndeallocate(object); return (EFBIG); @@ -474,7 +474,7 @@ ffs_write(struct vop_write_args *ap) /* * NOTE! These B_ flags are actually balloc-only flags, not buffer - * flags. They are similar to the BA_ flags in -current. + * flags. They are similar to the BA_ flags in fbsd. */ if (seqcount > B_SEQMAX) flags = B_SEQMAX << B_SEQSHIFT; diff --git a/sys/vfs/ufs/ufs_vfsops.c b/sys/vfs/ufs/ufs_vfsops.c index 52231c81e0..e73d04ef98 100644 --- a/sys/vfs/ufs/ufs_vfsops.c +++ b/sys/vfs/ufs/ufs_vfsops.c @@ -37,7 +37,7 @@ * * @(#)ufs_vfsops.c 8.8 (Berkeley) 5/20/95 * $FreeBSD: src/sys/ufs/ufs/ufs_vfsops.c,v 1.17.2.3 2001/10/14 19:08:16 iedowse Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_vfsops.c,v 1.8 2004/06/03 15:40:22 hmp Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_vfsops.c,v 1.9 2004/07/18 19:43:48 drhodus Exp $ */ #include "opt_quota.h" @@ -127,7 +127,7 @@ ufs_quotactl(struct mount *mp, int cmds, uid_t uid, caddr_t arg, } type = cmds & SUBCMDMASK; - if ((u_int)type >= MAXQUOTAS) + if ((uint)type >= MAXQUOTAS) return (EINVAL); if (vfs_busy(mp, LK_NOWAIT, NULL, td)) return (0); diff --git a/sys/vfs/ufs/ufs_vnops.c b/sys/vfs/ufs/ufs_vnops.c index 818cf84494..78f73e380a 100644 --- a/sys/vfs/ufs/ufs_vnops.c +++ b/sys/vfs/ufs/ufs_vnops.c @@ -37,7 +37,7 @@ * * @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95 * $FreeBSD: src/sys/ufs/ufs/ufs_vnops.c,v 1.131.2.8 2003/01/02 17:26:19 bde Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_vnops.c,v 1.13 2004/05/18 00:16:46 cpressey Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_vnops.c,v 1.14 2004/07/18 19:43:48 drhodus Exp $ */ #include "opt_quota.h" @@ -306,9 +306,9 @@ ufs_access(struct vop_access_args *ap) #endif /* - * Disallow write attempts on read-only file systems; + * Disallow write attempts on read-only filesystems; * unless the file is a socket, fifo, or a block or - * character device resident on the file system. + * character device resident on the filesystem. */ if (mode & VWRITE) { switch (vp->v_type) { @@ -471,9 +471,9 @@ ufs_setattr(struct vop_setattr_args *ap) } if (vap->va_size != VNOVAL) { /* - * Disallow write attempts on read-only file systems; + * Disallow write attempts on read-only filesystems; * unless the file is a socket, fifo, or a block or - * character device resident on the file system. + * character device resident on the filesystem. */ switch (vp->v_type) { case VDIR: @@ -855,7 +855,7 @@ ufs_rename(struct vop_rename_args *ap) if ((tcnp->cn_flags & CNP_HASBUF) == 0 || (fcnp->cn_flags & CNP_HASBUF) == 0) panic("ufs_rename: no name"); -#endif +#endif /* DIAGNOSTIC */ /* * Check for cross-device rename. */ @@ -1647,7 +1647,7 @@ ufs_readlink(struct vop_readlink_args *ap) isize = ip->i_size; if ((isize < vp->v_mount->mnt_maxsymlinklen) || - (ip->i_din.di_blocks == 0)) { /* XXX - for old fastlink support */ + (ip->i_din.di_blocks == 0)) { /* XXX - for old fastlink support */ uiomove((char *)ip->i_shortlink, isize, ap->a_uio); return (0); } diff --git a/sys/vfs/ufs/ufsmount.h b/sys/vfs/ufs/ufsmount.h index db46dd9bb4..1e9dc6111f 100644 --- a/sys/vfs/ufs/ufsmount.h +++ b/sys/vfs/ufs/ufsmount.h @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * @@ -32,7 +32,7 @@ * * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 * $FreeBSD: src/sys/ufs/ufs/ufsmount.h,v 1.17 1999/12/29 04:55:06 peter Exp $ - * $DragonFly: src/sys/vfs/ufs/ufsmount.h,v 1.4 2003/08/20 09:56:34 rob Exp $ + * $DragonFly: src/sys/vfs/ufs/ufsmount.h,v 1.5 2004/07/18 19:43:48 drhodus Exp $ */ #ifndef _UFS_UFS_UFSMOUNT_H_ @@ -52,8 +52,8 @@ struct ufs_args { struct mfs_args { char *fspec; /* name to export for statfs */ struct export_args export; /* if exported MFSes are supported */ - caddr_t base; /* base of file system in memory */ - u_long size; /* size of file system */ + caddr_t base; /* base of filesystem in memory */ + u_long size; /* size of filesystem */ }; #ifdef _KERNEL @@ -81,10 +81,9 @@ struct ufsmount { struct fs *fs; /* FFS */ struct ext2_sb_info *e2fs; /* EXT2FS */ } ufsmount_u; -#define um_fs ufsmount_u.fs -#define um_e2fs ufsmount_u.e2fs -#define um_e2fsb ufsmount_u.e2fs->s_es - +# define um_fs ufsmount_u.fs +# define um_e2fs ufsmount_u.e2fs +# define um_e2fsb ufsmount_u.e2fs->s_es struct vnode *um_quotas[MAXQUOTAS]; /* pointer to quota files */ struct ucred *um_cred[MAXQUOTAS]; /* quota file access cred */ u_long um_nindir; /* indirect ptrs per block */ @@ -98,7 +97,8 @@ struct ufsmount { struct malloc_type *um_malloctype; /* The inodes malloctype */ int um_i_effnlink_valid; /* i_effnlink valid? */ int (*um_blkatoff) (struct vnode *, off_t, char **, struct buf **); - int (*um_truncate) (struct vnode *, off_t, int, struct ucred *, struct thread *); + int (*um_truncate) (struct vnode *, off_t, int, struct ucred *, + struct thread *); int (*um_update) (struct vnode *, int); int (*um_valloc) (struct vnode *, int, struct ucred *, struct vnode **); int (*um_vfree) (struct vnode *, ino_t, int); @@ -120,7 +120,7 @@ struct ufsmount { #define VFSTOUFS(mp) ((struct ufsmount *)((mp)->mnt_data)) /* - * Macros to access file system parameters in the ufsmount structure. + * Macros to access filesystem parameters in the ufsmount structure. * Used by ufs_bmap. */ #define MNINDIR(ump) ((ump)->um_nindir) @@ -128,4 +128,4 @@ struct ufsmount { #define is_sequential(ump, a, b) ((b) == (a) + ump->um_seqinc) #endif /* _KERNEL */ -#endif +#endif /* !_UFS_UFS_UFSMOUNT_H_ */ -- 2.41.0