diff options
Diffstat (limited to 'sys/ufs/ext2fs')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs.h | 6 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_alloc.c | 42 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_balloc.c | 16 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_bmap.c | 14 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_extern.h | 12 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_inode.c | 26 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_readwrite.c | 4 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_subr.c | 6 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vfsops.c | 4 |
9 files changed, 65 insertions, 65 deletions
diff --git a/sys/ufs/ext2fs/ext2fs.h b/sys/ufs/ext2fs/ext2fs.h index 3a8ff439417..caf38041a30 100644 --- a/sys/ufs/ext2fs/ext2fs.h +++ b/sys/ufs/ext2fs/ext2fs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs.h,v 1.11 2005/10/04 22:46:22 pedro Exp $ */ +/* $OpenBSD: ext2fs.h,v 1.12 2007/06/02 00:45:50 pedro Exp $ */ /* $NetBSD: ext2fs.h,v 1.10 2000/01/28 16:00:23 bouyer Exp $ */ /* @@ -55,8 +55,8 @@ #define SBSIZE 1024 #define BBOFF ((off_t)(0)) #define SBOFF ((off_t)(BBOFF + BBSIZE)) -#define BBLOCK ((ufs1_daddr_t)(0)) -#define SBLOCK ((ufs1_daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE)) +#define BBLOCK ((daddr_t)(0)) +#define SBLOCK ((daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE)) /* * Addresses stored in inodes are capable of addressing blocks diff --git a/sys/ufs/ext2fs/ext2fs_alloc.c b/sys/ufs/ext2fs/ext2fs_alloc.c index 25e41ea6fba..e1a8a12e4e8 100644 --- a/sys/ufs/ext2fs/ext2fs_alloc.c +++ b/sys/ufs/ext2fs/ext2fs_alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_alloc.c,v 1.21 2007/03/14 13:56:42 pedro Exp $ */ +/* $OpenBSD: ext2fs_alloc.c,v 1.22 2007/06/02 00:45:50 pedro Exp $ */ /* $NetBSD: ext2fs_alloc.c,v 1.10 2001/07/05 08:38:27 toshii Exp $ */ /* @@ -53,13 +53,13 @@ u_long ext2gennumber; -static ufs1_daddr_t ext2fs_alloccg(struct inode *, int, ufs1_daddr_t, int); +static int32_t ext2fs_alloccg(struct inode *, int, int32_t, int); static u_long ext2fs_dirpref(struct m_ext2fs *); static void ext2fs_fserr(struct m_ext2fs *, u_int, char *); static u_long ext2fs_hashalloc(struct inode *, int, long, int, - ufs1_daddr_t (*)(struct inode *, int, ufs1_daddr_t, int)); -static ufs1_daddr_t ext2fs_nodealloccg(struct inode *, int, ufs1_daddr_t, int); -static ufs1_daddr_t ext2fs_mapsearch(struct m_ext2fs *, char *, ufs1_daddr_t); + int32_t (*)(struct inode *, int, int32_t, int)); +static int32_t ext2fs_nodealloccg(struct inode *, int, int32_t, int); +static int32_t ext2fs_mapsearch(struct m_ext2fs *, char *, int32_t); /* * Allocate a block in the file system. @@ -81,12 +81,12 @@ static ufs1_daddr_t ext2fs_mapsearch(struct m_ext2fs *, char *, ufs1_daddr_t); int ext2fs_alloc(ip, lbn, bpref, cred, bnp) struct inode *ip; - ufs1_daddr_t lbn, bpref; + int32_t lbn, bpref; struct ucred *cred; - ufs1_daddr_t *bnp; + int32_t *bnp; { struct m_ext2fs *fs; - ufs1_daddr_t bno; + int32_t bno; int cg; *bnp = 0; @@ -105,7 +105,7 @@ ext2fs_alloc(ip, lbn, bpref, cred, bnp) cg = ino_to_cg(fs, ip->i_number); else cg = dtog(fs, bpref); - bno = (ufs1_daddr_t)ext2fs_hashalloc(ip, cg, bpref, fs->e2fs_bsize, + bno = (int32_t)ext2fs_hashalloc(ip, cg, bpref, fs->e2fs_bsize, ext2fs_alloccg); if (bno > 0) { ip->i_e2fs_nblock += btodb(fs->e2fs_bsize); @@ -222,12 +222,12 @@ ext2fs_dirpref(fs) * contigously. The two fields of the ext2 inode extension (see * ufs/ufs/inode.h) help this. */ -ufs1_daddr_t +int32_t ext2fs_blkpref(ip, lbn, indx, bap) struct inode *ip; - ufs1_daddr_t lbn; + int32_t lbn; int indx; - ufs1_daddr_t *bap; + int32_t *bap; { struct m_ext2fs *fs; int cg, i; @@ -275,7 +275,7 @@ ext2fs_hashalloc(ip, cg, pref, size, allocator) int cg; long pref; int size; /* size for data blocks, mode for inodes */ - ufs1_daddr_t (*allocator)(struct inode *, int, ufs1_daddr_t, int); + int32_t (*allocator)(struct inode *, int, int32_t, int); { struct m_ext2fs *fs; long result; @@ -323,11 +323,11 @@ ext2fs_hashalloc(ip, cg, pref, size, allocator) * and if it is, allocate it. */ -static ufs1_daddr_t +static int32_t ext2fs_alloccg(ip, cg, bpref, size) struct inode *ip; int cg; - ufs1_daddr_t bpref; + int32_t bpref; int size; { struct m_ext2fs *fs; @@ -411,11 +411,11 @@ gotit: * 2) allocate the next available inode after the requested * inode in the specified cylinder group. */ -static ufs1_daddr_t +static int32_t ext2fs_nodealloccg(ip, cg, ipref, mode) struct inode *ip; int cg; - ufs1_daddr_t ipref; + int32_t ipref; int mode; { struct m_ext2fs *fs; @@ -486,7 +486,7 @@ gotit: void ext2fs_blkfree(ip, bno) struct inode *ip; - ufs1_daddr_t bno; + int32_t bno; { struct m_ext2fs *fs; char *bbp; @@ -573,13 +573,13 @@ ext2fs_inode_free(struct inode *pip, ino_t ino, mode_t mode) * available. */ -static ufs1_daddr_t +static int32_t ext2fs_mapsearch(fs, bbp, bpref) struct m_ext2fs *fs; char *bbp; - ufs1_daddr_t bpref; + int32_t bpref; { - ufs1_daddr_t bno; + int32_t bno; int start, len, loc, i, map; /* diff --git a/sys/ufs/ext2fs/ext2fs_balloc.c b/sys/ufs/ext2fs/ext2fs_balloc.c index d08b2a67daa..957b6038777 100644 --- a/sys/ufs/ext2fs/ext2fs_balloc.c +++ b/sys/ufs/ext2fs/ext2fs_balloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_balloc.c,v 1.13 2003/06/02 23:28:22 millert Exp $ */ +/* $OpenBSD: ext2fs_balloc.c,v 1.14 2007/06/02 00:45:50 pedro Exp $ */ /* $NetBSD: ext2fs_balloc.c,v 1.10 2001/07/04 21:16:01 chs Exp $ */ /* @@ -60,14 +60,14 @@ ext2fs_buf_alloc(struct inode *ip, daddr_t bn, int size, struct ucred *cred, struct buf **bpp, int flags) { struct m_ext2fs *fs; - ufs1_daddr_t nb; + int32_t nb; struct buf *bp, *nbp; struct vnode *vp = ITOV(ip); struct indir indirs[NIADDR + 2]; - ufs1_daddr_t newb, lbn, *bap, pref; + int32_t newb, lbn, *bap, pref; int num, i, error; u_int deallocated; - ufs1_daddr_t *allocib, *blkp, *allocblk, allociblk[NIADDR + 1]; + int32_t *allocib, *blkp, *allocblk, allociblk[NIADDR + 1]; int unwindidx = -1; *bpp = NULL; @@ -128,7 +128,7 @@ ext2fs_buf_alloc(struct inode *ip, daddr_t bn, int size, struct ucred *cred, allocib = NULL; allocblk = allociblk; if (nb == 0) { - pref = ext2fs_blkpref(ip, lbn, 0, (ufs1_daddr_t *)0); + pref = ext2fs_blkpref(ip, lbn, 0, (int32_t *)0); error = ext2fs_alloc(ip, lbn, pref, cred, &newb); if (error) return (error); @@ -159,7 +159,7 @@ ext2fs_buf_alloc(struct inode *ip, daddr_t bn, int size, struct ucred *cred, brelse(bp); goto fail; } - bap = (ufs1_daddr_t *)bp->b_data; + bap = (int32_t *)bp->b_data; nb = fs2h32(bap[indirs[i].in_off]); if (i == num) break; @@ -168,7 +168,7 @@ ext2fs_buf_alloc(struct inode *ip, daddr_t bn, int size, struct ucred *cred, brelse(bp); continue; } - pref = ext2fs_blkpref(ip, lbn, 0, (ufs1_daddr_t *)0); + pref = ext2fs_blkpref(ip, lbn, 0, (int32_t *)0); error = ext2fs_alloc(ip, lbn, pref, cred, &newb); if (error) { brelse(bp); @@ -267,7 +267,7 @@ fail: panic("Could not unwind indirect block, error %d", r); brelse(bp); } else { - bap = (ufs1_daddr_t *)bp->b_data; + bap = (int32_t *)bp->b_data; bap[indirs[unwindidx].in_off] = 0; if (flags & B_SYNC) bwrite(bp); diff --git a/sys/ufs/ext2fs/ext2fs_bmap.c b/sys/ufs/ext2fs/ext2fs_bmap.c index 543aa609003..62a9fd6833f 100644 --- a/sys/ufs/ext2fs/ext2fs_bmap.c +++ b/sys/ufs/ext2fs/ext2fs_bmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_bmap.c,v 1.13 2007/06/01 23:47:57 deraadt Exp $ */ +/* $OpenBSD: ext2fs_bmap.c,v 1.14 2007/06/02 00:45:50 pedro Exp $ */ /* $NetBSD: ext2fs_bmap.c,v 1.5 2000/03/30 12:41:11 augustss Exp $ */ /* @@ -56,7 +56,7 @@ #include <ufs/ext2fs/ext2fs.h> #include <ufs/ext2fs/ext2fs_extern.h> -static int ext2fs_bmaparray(struct vnode *, ufs1_daddr_t, daddr64_t *, +static int ext2fs_bmaparray(struct vnode *, int32_t, daddr64_t *, struct indir *, int *, int *); /* @@ -99,7 +99,7 @@ ext2fs_bmap(v) int ext2fs_bmaparray(vp, bn, bnp, ap, nump, runp) struct vnode *vp; - ufs1_daddr_t bn; + int32_t bn; daddr64_t *bnp; struct indir *ap; int *nump; @@ -111,7 +111,7 @@ ext2fs_bmaparray(vp, bn, bnp, ap, nump, runp) struct mount *mp; struct vnode *devvp; struct indir a[NIADDR+1], *xap; - ufs1_daddr_t daddr; + int32_t daddr; long metalbn; int error, maxrun = 0, num; @@ -202,12 +202,12 @@ ext2fs_bmaparray(vp, bn, bnp, ap, nump, runp) } } - daddr = fs2h32(((ufs1_daddr_t *)bp->b_data)[xap->in_off]); + daddr = fs2h32(((int32_t *)bp->b_data)[xap->in_off]); if (num == 1 && daddr && runp) for (bn = xap->in_off + 1; bn < MNINDIR(ump) && *runp < maxrun && - is_sequential(ump, ((ufs1_daddr_t *)bp->b_data)[bn - 1], - ((ufs1_daddr_t *)bp->b_data)[bn]); + is_sequential(ump, ((int32_t *)bp->b_data)[bn - 1], + ((int32_t *)bp->b_data)[bn]); ++bn, ++*runp); } if (bp) diff --git a/sys/ufs/ext2fs/ext2fs_extern.h b/sys/ufs/ext2fs/ext2fs_extern.h index 9f603a293b7..ec587a9f02f 100644 --- a/sys/ufs/ext2fs/ext2fs_extern.h +++ b/sys/ufs/ext2fs/ext2fs_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_extern.h,v 1.24 2005/12/14 22:03:01 pedro Exp $ */ +/* $OpenBSD: ext2fs_extern.h,v 1.25 2007/06/02 00:45:50 pedro Exp $ */ /* $NetBSD: ext2fs_extern.h,v 1.1 1997/06/11 09:33:55 bouyer Exp $ */ /*- @@ -57,15 +57,15 @@ extern struct pool ext2fs_dinode_pool; /* memory pool for dinodes */ __BEGIN_DECLS /* ext2fs_alloc.c */ -int ext2fs_alloc(struct inode *, ufs1_daddr_t, ufs1_daddr_t , struct ucred *, - ufs1_daddr_t *); -int ext2fs_realloccg(struct inode *, ufs1_daddr_t, ufs1_daddr_t, int, int, +int ext2fs_alloc(struct inode *, int32_t, int32_t , struct ucred *, + int32_t *); +int ext2fs_realloccg(struct inode *, int32_t, int32_t, int, int, struct ucred *, struct buf **); int ext2fs_reallocblks(void *); int ext2fs_inode_alloc(struct inode *pip, mode_t mode, struct ucred *, struct vnode **); -daddr_t ext2fs_blkpref(struct inode *, ufs1_daddr_t, int, ufs1_daddr_t *); -void ext2fs_blkfree(struct inode *, ufs1_daddr_t); +daddr_t ext2fs_blkpref(struct inode *, int32_t, int, int32_t *); +void ext2fs_blkfree(struct inode *, int32_t); int ext2fs_inode_free(struct inode *pip, ino_t ino, mode_t mode); /* ext2fs_balloc.c */ diff --git a/sys/ufs/ext2fs/ext2fs_inode.c b/sys/ufs/ext2fs/ext2fs_inode.c index bd0b79408a0..bc6b1378c74 100644 --- a/sys/ufs/ext2fs/ext2fs_inode.c +++ b/sys/ufs/ext2fs/ext2fs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_inode.c,v 1.36 2007/06/01 23:47:57 deraadt Exp $ */ +/* $OpenBSD: ext2fs_inode.c,v 1.37 2007/06/02 00:45:50 pedro Exp $ */ /* $NetBSD: ext2fs_inode.c,v 1.24 2001/06/19 12:59:18 wiz Exp $ */ /* @@ -55,8 +55,8 @@ #include <ufs/ext2fs/ext2fs.h> #include <ufs/ext2fs/ext2fs_extern.h> -static int ext2fs_indirtrunc(struct inode *, ufs1_daddr_t, ufs1_daddr_t, - ufs1_daddr_t, int, long *); +static int ext2fs_indirtrunc(struct inode *, int32_t, int32_t, + int32_t, int, long *); /* * Get the size of an inode. @@ -220,9 +220,9 @@ int ext2fs_truncate(struct inode *oip, off_t length, int flags, struct ucred *cred) { struct vnode *ovp = ITOV(oip); - ufs1_daddr_t lastblock; - ufs1_daddr_t bn, lbn, lastiblock[NIADDR], indir_lbn[NIADDR]; - ufs1_daddr_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; + int32_t lastblock; + int32_t bn, lbn, lastiblock[NIADDR], indir_lbn[NIADDR]; + int32_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; struct m_ext2fs *fs; struct buf *bp; int offset, size, level; @@ -433,17 +433,17 @@ done: static int ext2fs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) struct inode *ip; - ufs1_daddr_t lbn, lastbn; - ufs1_daddr_t dbn; + int32_t lbn, lastbn; + int32_t dbn; int level; long *countp; { int i; struct buf *bp; struct m_ext2fs *fs = ip->i_e2fs; - ufs1_daddr_t *bap; + int32_t *bap; struct vnode *vp; - ufs1_daddr_t *copy = NULL, nb, nlbn, last; + int32_t *copy = NULL, nb, nlbn, last; long blkcount, factor; int nblocks, blocksreleased = 0; int error = 0, allerror = 0; @@ -485,9 +485,9 @@ ext2fs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) return (error); } - bap = (ufs1_daddr_t *)bp->b_data; + bap = (int32_t *)bp->b_data; if (lastbn >= 0) { - MALLOC(copy, ufs1_daddr_t *, fs->e2fs_bsize, M_TEMP, M_WAITOK); + MALLOC(copy, int32_t *, fs->e2fs_bsize, M_TEMP, M_WAITOK); memcpy((caddr_t)copy, (caddr_t)bap, (u_int)fs->e2fs_bsize); memset((caddr_t)&bap[last + 1], 0, (u_int)(NINDIR(fs) - (last + 1)) * sizeof (u_int32_t)); @@ -508,7 +508,7 @@ ext2fs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) continue; if (level > SINGLE) { error = ext2fs_indirtrunc(ip, nlbn, fsbtodb(fs, nb), - (ufs1_daddr_t)-1, level - 1, + (int32_t)-1, level - 1, &blkcount); if (error) allerror = error; diff --git a/sys/ufs/ext2fs/ext2fs_readwrite.c b/sys/ufs/ext2fs/ext2fs_readwrite.c index d1b70e6cc57..63b5dd3c75d 100644 --- a/sys/ufs/ext2fs/ext2fs_readwrite.c +++ b/sys/ufs/ext2fs/ext2fs_readwrite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_readwrite.c,v 1.20 2007/06/01 23:47:57 deraadt Exp $ */ +/* $OpenBSD: ext2fs_readwrite.c,v 1.21 2007/06/02 00:45:50 pedro Exp $ */ /* $NetBSD: ext2fs_readwrite.c,v 1.16 2001/02/27 04:37:47 chs Exp $ */ /*- @@ -165,7 +165,7 @@ ext2fs_write(v) struct m_ext2fs *fs; struct buf *bp; struct proc *p; - ufs1_daddr_t lbn; + int32_t lbn; off_t osize; int blkoffset, error, flags, ioflag, resid, size, xfersize; diff --git a/sys/ufs/ext2fs/ext2fs_subr.c b/sys/ufs/ext2fs/ext2fs_subr.c index ed057d42bc1..87bcf5f7c33 100644 --- a/sys/ufs/ext2fs/ext2fs_subr.c +++ b/sys/ufs/ext2fs/ext2fs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_subr.c,v 1.15 2007/05/26 20:26:51 pedro Exp $ */ +/* $OpenBSD: ext2fs_subr.c,v 1.16 2007/06/02 00:45:50 pedro Exp $ */ /* $NetBSD: ext2fs_subr.c,v 1.1 1997/06/11 09:34:03 bouyer Exp $ */ /* @@ -82,7 +82,7 @@ ext2fs_bufatoff(struct inode *ip, off_t offset, char **res, struct buf **bpp) struct vnode *vp; struct m_ext2fs *fs; struct buf *bp; - ufs1_daddr_t lbn; + int32_t lbn; int error; vp = ITOV(ip); @@ -108,7 +108,7 @@ ext2fs_checkoverlap(bp, ip) struct inode *ip; { struct buf *ep; - ufs1_daddr_t start, last; + int32_t start, last; struct vnode *vp; start = bp->b_blkno; diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index da455e7b9ac..bdb0dcb6cf1 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vfsops.c,v 1.46 2007/03/21 17:29:32 thib Exp $ */ +/* $OpenBSD: ext2fs_vfsops.c,v 1.47 2007/06/02 00:45:50 pedro Exp $ */ /* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */ /* @@ -417,7 +417,7 @@ ext2fs_reload(mountp, cred, p) size = DEV_BSIZE; else size = dpart.disklab->d_secsize; - error = bread(devvp, (ufs1_daddr_t)(SBOFF / size), SBSIZE, NOCRED, &bp); + error = bread(devvp, (int32_t)(SBOFF / size), SBSIZE, NOCRED, &bp); if (error) { brelse(bp); return (error); |