diff options
-rw-r--r-- | sys/ufs/ext2fs/ext2fs.h | 6 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_alloc.c | 4 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_balloc.c | 4 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_extern.h | 6 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_subr.c | 4 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_alloc.c | 113 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_balloc.c | 19 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_extern.h | 34 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_inode.c | 12 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 36 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep_stub.c | 12 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_subr.c | 24 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 4 | ||||
-rw-r--r-- | sys/ufs/ffs/fs.h | 10 | ||||
-rw-r--r-- | sys/ufs/ffs/softdep.h | 18 | ||||
-rw-r--r-- | sys/ufs/ufs/inode.h | 4 | ||||
-rw-r--r-- | sys/ufs/ufs/quota.h | 6 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_bmap.c | 27 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_extern.h | 6 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_quota.c | 6 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_quota_stub.c | 6 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 8 |
23 files changed, 185 insertions, 188 deletions
diff --git a/sys/ufs/ext2fs/ext2fs.h b/sys/ufs/ext2fs/ext2fs.h index caf38041a30..7b007344dcd 100644 --- a/sys/ufs/ext2fs/ext2fs.h +++ b/sys/ufs/ext2fs/ext2fs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs.h,v 1.12 2007/06/02 00:45:50 pedro Exp $ */ +/* $OpenBSD: ext2fs.h,v 1.13 2008/01/05 19:49:26 otto 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 ((daddr_t)(0)) -#define SBLOCK ((daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE)) +#define BBLOCK ((daddr64_t)(0)) +#define SBLOCK ((daddr64_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 5abad913287..db218f6cfc1 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.24 2007/06/22 09:55:17 jasper Exp $ */ +/* $OpenBSD: ext2fs_alloc.c,v 1.25 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ext2fs_alloc.c,v 1.10 2001/07/05 08:38:27 toshii Exp $ */ /* @@ -218,7 +218,7 @@ ext2fs_dirpref(struct m_ext2fs *fs) * contigously. The two fields of the ext2 inode extension (see * ufs/ufs/inode.h) help this. */ -int32_t +daddr64_t ext2fs_blkpref(struct inode *ip, int32_t lbn, int indx, int32_t *bap) { struct m_ext2fs *fs; diff --git a/sys/ufs/ext2fs/ext2fs_balloc.c b/sys/ufs/ext2fs/ext2fs_balloc.c index 957b6038777..457404cc21d 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.14 2007/06/02 00:45:50 pedro Exp $ */ +/* $OpenBSD: ext2fs_balloc.c,v 1.15 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ext2fs_balloc.c,v 1.10 2001/07/04 21:16:01 chs Exp $ */ /* @@ -56,7 +56,7 @@ * the inode and the logical block number in a file. */ int -ext2fs_buf_alloc(struct inode *ip, daddr_t bn, int size, struct ucred *cred, +ext2fs_buf_alloc(struct inode *ip, daddr64_t bn, int size, struct ucred *cred, struct buf **bpp, int flags) { struct m_ext2fs *fs; diff --git a/sys/ufs/ext2fs/ext2fs_extern.h b/sys/ufs/ext2fs/ext2fs_extern.h index ec587a9f02f..abbb68ecc47 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.25 2007/06/02 00:45:50 pedro Exp $ */ +/* $OpenBSD: ext2fs_extern.h,v 1.26 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ext2fs_extern.h,v 1.1 1997/06/11 09:33:55 bouyer Exp $ */ /*- @@ -64,12 +64,12 @@ int ext2fs_realloccg(struct inode *, int32_t, int32_t, int, int, int ext2fs_reallocblks(void *); int ext2fs_inode_alloc(struct inode *pip, mode_t mode, struct ucred *, struct vnode **); -daddr_t ext2fs_blkpref(struct inode *, int32_t, int, int32_t *); +daddr64_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 */ -int ext2fs_buf_alloc(struct inode *, daddr_t, int, struct ucred *, +int ext2fs_buf_alloc(struct inode *, daddr64_t, int, struct ucred *, struct buf **, int); /* ext2fs_bmap.c */ diff --git a/sys/ufs/ext2fs/ext2fs_subr.c b/sys/ufs/ext2fs/ext2fs_subr.c index f378edd4574..a8ac75a91ec 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.17 2007/06/17 20:15:25 jasper Exp $ */ +/* $OpenBSD: ext2fs_subr.c,v 1.18 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ext2fs_subr.c,v 1.1 1997/06/11 09:34:03 bouyer Exp $ */ /* @@ -115,7 +115,7 @@ ext2fs_checkoverlap(struct buf *bp, struct inode *ip) if (ep == bp || (ep->b_flags & B_INVAL) || ep->b_vp == NULLVP) continue; - if (VOP_BMAP(ep->b_vp, (daddr_t)0, &vp, (daddr_t)0, NULL)) + if (VOP_BMAP(ep->b_vp, (daddr64_t)0, &vp, (daddr64_t)0, NULL)) continue; if (vp != ip->i_devvp) continue; diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index eb2a4d811c1..76eec44843c 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_alloc.c,v 1.80 2007/11/09 09:59:54 thib Exp $ */ +/* $OpenBSD: ffs_alloc.c,v 1.81 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ffs_alloc.c,v 1.11 1996/05/11 18:27:09 mycroft Exp $ */ /* @@ -68,16 +68,16 @@ (fs)->fs_fsmnt, (cp)); \ } while (0) -daddr_t ffs_alloccg(struct inode *, int, daddr_t, int); -struct buf *ffs_cgread(struct fs *, struct inode *, int); -daddr_t ffs_alloccgblk(struct inode *, struct buf *, daddr_t); -daddr_t ffs_clusteralloc(struct inode *, int, daddr_t, int); -ino_t ffs_dirpref(struct inode *); -daddr_t ffs_fragextend(struct inode *, int, long, int, int); -u_long ffs_hashalloc(struct inode *, int, long, int, - daddr_t (*)(struct inode *, int, daddr_t, int)); -daddr_t ffs_nodealloccg(struct inode *, int, daddr_t, int); -daddr_t ffs_mapsearch(struct fs *, struct cg *, daddr_t, int); +daddr64_t ffs_alloccg(struct inode *, int, daddr64_t, int); +struct buf * ffs_cgread(struct fs *, struct inode *, int); +daddr64_t ffs_alloccgblk(struct inode *, struct buf *, daddr64_t); +daddr64_t ffs_clusteralloc(struct inode *, int, daddr64_t, int); +ino_t ffs_dirpref(struct inode *); +daddr64_t ffs_fragextend(struct inode *, int, daddr64_t, int, int); +daddr64_t ffs_hashalloc(struct inode *, int, daddr64_t, int, + daddr64_t (*)(struct inode *, int, daddr64_t, int)); +daddr64_t ffs_nodealloccg(struct inode *, int, daddr64_t, int); +daddr64_t ffs_mapsearch(struct fs *, struct cg *, daddr64_t, int); int ffs1_reallocblks(void *); #ifdef FFS2 @@ -85,7 +85,7 @@ int ffs2_reallocblks(void *); #endif #ifdef DIAGNOSTIC -int ffs_checkblk(struct inode *, daddr_t, long); +int ffs_checkblk(struct inode *, daddr64_t, long); #endif /* @@ -108,11 +108,11 @@ int ffs_checkblk(struct inode *, daddr_t, long); * available block is located. */ int -ffs_alloc(struct inode *ip, daddr_t lbn, daddr_t bpref, int size, - struct ucred *cred, daddr_t *bnp) +ffs_alloc(struct inode *ip, daddr64_t lbn, daddr64_t bpref, int size, + struct ucred *cred, daddr64_t *bnp) { struct fs *fs; - daddr_t bno; + daddr64_t bno; int cg; int error; @@ -148,7 +148,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn, daddr_t bpref, int size, cg = dtog(fs, bpref); /* Try allocating a block. */ - bno = (daddr_t)ffs_hashalloc(ip, cg, (long)bpref, size, ffs_alloccg); + bno = ffs_hashalloc(ip, cg, bpref, size, ffs_alloccg); if (bno > 0) { /* allocation successful, update inode data */ DIP_ADD(ip, blocks, btodb(size)); @@ -175,14 +175,14 @@ nospace: * invoked to get an appropriate block. */ int -ffs_realloccg(struct inode *ip, daddr_t lbprev, daddr_t bpref, int osize, - int nsize, struct ucred *cred, struct buf **bpp, daddr_t *blknop) +ffs_realloccg(struct inode *ip, daddr64_t lbprev, daddr64_t bpref, int osize, + int nsize, struct ucred *cred, struct buf **bpp, daddr64_t *blknop) { struct fs *fs; struct buf *bp = NULL; - daddr_t quota_updated = 0; + daddr64_t quota_updated = 0; int cg, request, error; - daddr_t bprev, bno; + daddr64_t bprev, bno; if (bpp != NULL) *bpp = NULL; @@ -229,7 +229,7 @@ ffs_realloccg(struct inode *ip, daddr_t lbprev, daddr_t bpref, int osize, * Check for extension in the existing location. */ cg = dtog(fs, bprev); - if ((bno = ffs_fragextend(ip, cg, (long)bprev, osize, nsize)) != 0) { + if ((bno = ffs_fragextend(ip, cg, bprev, osize, nsize)) != 0) { DIP_ADD(ip, blocks, btodb(nsize - osize)); ip->i_flag |= IN_CHANGE | IN_UPDATE; if (bpp != NULL) { @@ -293,8 +293,7 @@ ffs_realloccg(struct inode *ip, daddr_t lbprev, daddr_t bpref, int osize, panic("ffs_realloccg: bad optim"); /* NOTREACHED */ } - bno = (daddr_t)ffs_hashalloc(ip, cg, (long)bpref, request, - ffs_alloccg); + bno = ffs_hashalloc(ip, cg, bpref, request, ffs_alloccg); if (bno <= 0) goto nospace; @@ -372,9 +371,9 @@ ffs1_reallocblks(void *v) struct inode *ip; struct vnode *vp; struct buf *sbp, *ebp; - daddr_t *bap, *sbap, *ebap = NULL; + int32_t *bap, *sbap, *ebap = NULL; struct cluster_save *buflist; - daddr_t start_lbn, end_lbn, soff, newblk, blkno; + daddr64_t start_lbn, end_lbn, soff, newblk, blkno; struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp; int i, len, start_lvl, end_lvl, pref, ssize; @@ -427,7 +426,7 @@ ffs1_reallocblks(void *v) brelse(sbp); return (ENOSPC); } - sbap = (daddr_t *)sbp->b_data; + sbap = (int32_t *)sbp->b_data; soff = idp->in_off; } /* @@ -448,13 +447,13 @@ ffs1_reallocblks(void *v) ssize = len - (idp->in_off + 1); if (bread(vp, idp->in_lbn, (int)fs->fs_bsize, NOCRED, &ebp)) goto fail; - ebap = (daddr_t *)ebp->b_data; + ebap = (int32_t *)ebp->b_data; } /* * Search the block map looking for an allocation of the desired size. */ - if ((newblk = (daddr_t)ffs_hashalloc(ip, dtog(fs, pref), (long)pref, - len, ffs_clusteralloc)) == 0) + if ((newblk = ffs_hashalloc(ip, dtog(fs, pref), pref, len, + ffs_clusteralloc)) == 0) goto fail; /* * We have found a new contiguous block. @@ -855,7 +854,7 @@ ffs_inode_alloc(struct inode *pip, mode_t mode, struct ucred *cred, if (fs->fs_contigdirs[cg] > 0) fs->fs_contigdirs[cg]--; } - ino = (ino_t)ffs_hashalloc(pip, cg, (long)ipref, mode, ffs_nodealloccg); + ino = (ino_t)ffs_hashalloc(pip, cg, ipref, mode, ffs_nodealloccg); if (ino == 0) goto noinodes; error = VFS_VGET(pvp->v_mount, ino, vpp); @@ -1030,7 +1029,7 @@ end: * allocated. */ int32_t -ffs1_blkpref(struct inode *ip, daddr_t lbn, int indx, int32_t *bap) +ffs1_blkpref(struct inode *ip, daddr64_t lbn, int indx, int32_t *bap) { struct fs *fs; int cg, avgbfree, startcg; @@ -1073,7 +1072,7 @@ ffs1_blkpref(struct inode *ip, daddr_t lbn, int indx, int32_t *bap) */ #ifdef FFS2 int64_t -ffs2_blkpref(struct inode *ip, daddr_t lbn, int indx, int64_t *bap) +ffs2_blkpref(struct inode *ip, daddr64_t lbn, int indx, int64_t *bap) { struct fs *fs; int cg, avgbfree, startcg; @@ -1126,12 +1125,12 @@ ffs2_blkpref(struct inode *ip, daddr_t lbn, int indx, int64_t *bap) * 3) brute force search for a free block. */ /*VARARGS5*/ -u_long -ffs_hashalloc(struct inode *ip, int cg, long pref, int size, - daddr_t (*allocator)(struct inode *, int, daddr_t, int)) +daddr64_t +ffs_hashalloc(struct inode *ip, int cg, daddr64_t pref, int size, + daddr64_t (*allocator)(struct inode *, int, daddr64_t, int)) { struct fs *fs; - long result; + daddr64_t result; int i, icg = cg; fs = ip->i_fs; @@ -1194,13 +1193,13 @@ ffs_cgread(struct fs *fs, struct inode *ip, int cg) * Check to see if the necessary fragments are available, and * if they are, allocate them. */ -daddr_t -ffs_fragextend(struct inode *ip, int cg, long bprev, int osize, int nsize) +daddr64_t +ffs_fragextend(struct inode *ip, int cg, daddr64_t bprev, int osize, int nsize) { struct fs *fs; struct cg *cgp; struct buf *bp; - long bno; + daddr64_t bno; int i, frags, bbase; fs = ip->i_fs; @@ -1257,13 +1256,13 @@ ffs_fragextend(struct inode *ip, int cg, long bprev, int osize, int nsize) * Check to see if a block of the appropriate size is available, * and if it is, allocate it. */ -daddr_t -ffs_alloccg(struct inode *ip, int cg, daddr_t bpref, int size) +daddr64_t +ffs_alloccg(struct inode *ip, int cg, daddr64_t bpref, int size) { struct fs *fs; struct cg *cgp; struct buf *bp; - daddr_t bno, blkno; + daddr64_t bno, blkno; int i, frags, allocsiz; fs = ip->i_fs; @@ -1338,7 +1337,7 @@ ffs_alloccg(struct inode *ip, int cg, daddr_t bpref, int size) if (DOINGSOFTDEP(ITOV(ip))) softdep_setup_blkmapdep(bp, fs, blkno); bdwrite(bp); - return ((u_long)blkno); + return (blkno); } /* @@ -1346,12 +1345,12 @@ ffs_alloccg(struct inode *ip, int cg, daddr_t bpref, int size) * Note that this routine only allocates fs_bsize blocks; these * blocks may be fragmented by the routine that allocates them. */ -daddr_t -ffs_alloccgblk(struct inode *ip, struct buf *bp, daddr_t bpref) +daddr64_t +ffs_alloccgblk(struct inode *ip, struct buf *bp, daddr64_t bpref) { struct fs *fs; struct cg *cgp; - daddr_t bno, blkno; + daddr64_t bno, blkno; u_int8_t *blksfree; int cylno; @@ -1382,7 +1381,7 @@ ffs_alloccgblk(struct inode *ip, struct buf *bp, daddr_t bpref) gotit: blkno = fragstoblks(fs, bno); - ffs_clrblock(fs, blksfree, (long) blkno); + ffs_clrblock(fs, blksfree, blkno); ffs_clusteracct(fs, cgp, blkno, -1); cgp->cg_cs.cs_nbfree--; fs->fs_cstotal.cs_nbfree--; @@ -1410,8 +1409,8 @@ gotit: * are multiple choices in the same cylinder group. Instead we just * take the first one that we find following bpref. */ -daddr_t -ffs_clusteralloc(struct inode *ip, int cg, daddr_t bpref, int len) +daddr64_t +ffs_clusteralloc(struct inode *ip, int cg, daddr64_t bpref, int len) { struct fs *fs; struct cg *cgp; @@ -1516,8 +1515,8 @@ fail: } /* inode allocation routine */ -daddr_t -ffs_nodealloccg(struct inode *ip, int cg, daddr_t ipref, int mode) +daddr64_t +ffs_nodealloccg(struct inode *ip, int cg, daddr64_t ipref, int mode) { struct fs *fs; struct cg *cgp; @@ -1685,7 +1684,7 @@ ffs_blkfree(struct inode *ip, daddr64_t bno, long size) struct fs *fs; struct cg *cgp; struct buf *bp; - daddr_t blkno; + daddr64_t blkno; int i, cg, blk, frags, bbase; fs = ip->i_fs; @@ -1844,7 +1843,7 @@ ffs_freefile(struct inode *pip, ino_t ino, mode_t mode) * fragment is allocated, false if it is free. */ int -ffs_checkblk(struct inode *ip, daddr_t bno, long size) +ffs_checkblk(struct inode *ip, daddr64_t bno, long size) { struct fs *fs; struct cg *cgp; @@ -1887,10 +1886,10 @@ ffs_checkblk(struct inode *ip, daddr_t bno, long size) * It is a panic if a request is made to find a block if none are * available. */ -daddr_t -ffs_mapsearch(struct fs *fs, struct cg *cgp, daddr_t bpref, int allocsiz) +daddr64_t +ffs_mapsearch(struct fs *fs, struct cg *cgp, daddr64_t bpref, int allocsiz) { - daddr_t bno; + daddr64_t bno; int start, len, loc, i; int blk, field, subfield, pos; @@ -1948,7 +1947,7 @@ ffs_mapsearch(struct fs *fs, struct cg *cgp, daddr_t bpref, int allocsiz) * Cnt == 1 means free; cnt == -1 means allocating. */ void -ffs_clusteracct(struct fs *fs, struct cg *cgp, daddr_t blkno, int cnt) +ffs_clusteracct(struct fs *fs, struct cg *cgp, daddr64_t blkno, int cnt) { int32_t *sump; int32_t *lp; diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c index 2d6518c079c..df2407c7d0c 100644 --- a/sys/ufs/ffs/ffs_balloc.c +++ b/sys/ufs/ffs/ffs_balloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_balloc.c,v 1.35 2007/11/27 16:22:14 martynas Exp $ */ +/* $OpenBSD: ffs_balloc.c,v 1.36 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ffs_balloc.c,v 1.3 1996/02/09 22:22:21 christos Exp $ */ /* @@ -73,14 +73,13 @@ int ffs1_balloc(struct inode *ip, off_t startoffset, int size, struct ucred *cred, int flags, struct buf **bpp) { - daddr_t lbn; + daddr64_t lbn, nb, newb, pref; struct fs *fs; - daddr_t nb; struct buf *bp, *nbp; struct vnode *vp; struct proc *p; struct indir indirs[NIADDR + 2]; - int32_t newb, *bap, pref; + int32_t *bap; int deallocated, osize, nsize, num, i, error; int32_t *allocib, *blkp, *allocblk, allociblk[NIADDR+1]; int unwindidx = -1; @@ -240,7 +239,7 @@ ffs1_balloc(struct inode *ip, off_t startoffset, int size, struct ucred *cred, allocib = NULL; allocblk = allociblk; if (nb == 0) { - pref = ffs1_blkpref(ip, lbn, 0, (daddr_t *)0); + pref = ffs1_blkpref(ip, lbn, 0, (int32_t *)0); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, cred, &newb); if (error) @@ -279,7 +278,7 @@ ffs1_balloc(struct inode *ip, off_t startoffset, int size, struct ucred *cred, brelse(bp); goto fail; } - bap = (daddr_t *)bp->b_data; + bap = (int32_t *)bp->b_data; nb = bap[indirs[i].in_off]; if (i == num) break; @@ -289,7 +288,7 @@ ffs1_balloc(struct inode *ip, off_t startoffset, int size, struct ucred *cred, continue; } if (pref == 0) - pref = ffs1_blkpref(ip, lbn, 0, (daddr_t *)0); + pref = ffs1_blkpref(ip, lbn, 0, (int32_t *)0); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, cred, &newb); if (error) { @@ -411,7 +410,7 @@ fail: (int)fs->fs_bsize, NOCRED, &bp); if (r) panic("Could not unwind indirect block, error %d", r); - bap = (daddr_t *)bp->b_data; + bap = (int32_t *)bp->b_data; bap[indirs[unwindidx].in_off] = 0; if (flags & B_SYNC) { bwrite(bp); @@ -437,8 +436,8 @@ int ffs2_balloc(struct inode *ip, off_t off, int size, struct ucred *cred, int flags, struct buf **bpp) { - daddr_t lbn, lastlbn, nb, newb, *blkp; - daddr_t pref, *allocblk, allociblk[NIADDR + 1]; + daddr64_t lbn, lastlbn, nb, newb, *blkp; + daddr64_t pref, *allocblk, allociblk[NIADDR + 1]; daddr64_t *bap, *allocib; int deallocated, osize, nsize, num, i, error, unwindidx, r; struct buf *bp, *nbp; diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 8261377d334..47888bc0215 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_extern.h,v 1.32 2007/06/01 20:23:25 pedro Exp $ */ +/* $OpenBSD: ffs_extern.h,v 1.33 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ffs_extern.h,v 1.4 1996/02/09 22:22:22 christos Exp $ */ /* @@ -97,21 +97,21 @@ struct vop_vfree_args; __BEGIN_DECLS /* ffs_alloc.c */ -int ffs_alloc(struct inode *, daddr_t, daddr_t , int, struct ucred *, - daddr_t *); -int ffs_realloccg(struct inode *, daddr_t, daddr_t, int, int , - struct ucred *, struct buf **, daddr_t *); +int ffs_alloc(struct inode *, daddr64_t, daddr64_t , int, struct ucred *, + daddr64_t *); +int ffs_realloccg(struct inode *, daddr64_t, daddr64_t, int, int , + struct ucred *, struct buf **, daddr64_t *); int ffs_reallocblks(void *); int ffs_inode_alloc(struct inode *, mode_t, struct ucred *, struct vnode **); int ffs_inode_free(struct inode *, ino_t, mode_t); int ffs_freefile(struct inode *, ino_t, mode_t); -int32_t ffs1_blkpref(struct inode *, daddr_t, int, int32_t *); +int32_t ffs1_blkpref(struct inode *, daddr64_t, int, int32_t *); #ifdef FFS2 -int64_t ffs2_blkpref(struct inode *, daddr_t, int, int64_t *); +int64_t ffs2_blkpref(struct inode *, daddr64_t, int, int64_t *); #endif void ffs_blkfree(struct inode *, daddr64_t, long); -void ffs_clusteracct(struct fs *, struct cg *, daddr_t, int); +void ffs_clusteracct(struct fs *, struct cg *, daddr64_t, int); /* ffs_balloc.c */ int ffs_balloc(struct inode *, off_t, int, struct ucred *, int, struct buf **); @@ -127,10 +127,10 @@ void ffs_fragacct(struct fs *, int, int32_t[], int); #ifdef DIAGNOSTIC void ffs_checkoverlap(struct buf *, struct inode *); #endif -int ffs_isfreeblock(struct fs *, unsigned char *, daddr_t); -int ffs_isblock(struct fs *, unsigned char *, daddr_t); -void ffs_clrblock(struct fs *, u_char *, daddr_t); -void ffs_setblock(struct fs *, unsigned char *, daddr_t); +int ffs_isfreeblock(struct fs *, unsigned char *, daddr64_t); +int ffs_isblock(struct fs *, unsigned char *, daddr64_t); +void ffs_clrblock(struct fs *, u_char *, daddr64_t); +void ffs_setblock(struct fs *, unsigned char *, daddr64_t); /* ffs_vfsops.c */ int ffs_mountroot(void); @@ -176,13 +176,13 @@ void softdep_load_inodeblock(struct inode *); void softdep_freefile(struct vnode *, ino_t, mode_t); 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 *, daddr_t); -void softdep_setup_allocdirect(struct inode *, daddr64_t, daddr_t, - daddr_t, long, long, struct buf *); +void softdep_setup_blkmapdep(struct buf *, struct fs *, daddr64_t); +void softdep_setup_allocdirect(struct inode *, daddr64_t, daddr64_t, + daddr64_t, long, long, struct buf *); void softdep_setup_allocindir_meta(struct buf *, struct inode *, - struct buf *, int, daddr_t); + struct buf *, int, daddr64_t); void softdep_setup_allocindir_page(struct inode *, daddr64_t, - struct buf *, int, daddr_t, daddr_t, struct buf *); + struct buf *, int, daddr64_t, daddr64_t, struct buf *); void softdep_fsync_mountdev(struct vnode *, int); int softdep_sync_metadata(struct vop_fsync_args *); int softdep_fsync(struct vnode *); diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 01c04440288..6105983adbf 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_inode.c,v 1.51 2007/10/29 17:06:20 chl Exp $ */ +/* $OpenBSD: ffs_inode.c,v 1.52 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ffs_inode.c,v 1.10 1996/05/11 18:27:19 mycroft Exp $ */ /* @@ -53,7 +53,7 @@ #include <ufs/ffs/fs.h> #include <ufs/ffs/ffs_extern.h> -int ffs_indirtrunc(struct inode *, daddr_t, daddr_t, daddr_t, int, long *); +int ffs_indirtrunc(struct inode *, daddr64_t, daddr64_t, daddr64_t, int, long *); /* * Update the access, modified, and inode change times as specified by the @@ -460,15 +460,15 @@ done: * NB: triple indirect blocks are untested. */ int -ffs_indirtrunc(struct inode *ip, daddr_t lbn, daddr_t dbn, daddr_t lastbn, - int level, long *countp) +ffs_indirtrunc(struct inode *ip, daddr64_t lbn, daddr64_t dbn, + daddr64_t lastbn, int level, long *countp) { int i; struct buf *bp; struct fs *fs = ip->i_fs; struct vnode *vp; void *copy = NULL; - daddr_t nb, nlbn, last; + daddr64_t nb, nlbn, last; long blkcount, factor; int nblocks, blocksreleased = 0; int error = 0, allerror = 0; @@ -554,7 +554,7 @@ ffs_indirtrunc(struct inode *ip, daddr_t lbn, daddr_t dbn, daddr_t lastbn, continue; if (level > SINGLE) { error = ffs_indirtrunc(ip, nlbn, fsbtodb(fs, nb), - (daddr_t)-1, level - 1, + (daddr64_t)-1, level - 1, &blkcount); if (error) allerror = error; diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index a57937f56bc..e2f88051a8a 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_softdep.c,v 1.93 2007/10/29 17:06:20 chl Exp $ */ +/* $OpenBSD: ffs_softdep.c,v 1.94 2008/01/05 19:49:26 otto Exp $ */ /* * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved. @@ -139,7 +139,7 @@ STATIC struct dirrem *newdirrem(struct buf *, struct inode *, STATIC void free_diradd(struct diradd *); STATIC void free_allocindir(struct allocindir *, struct inodedep *); STATIC void free_newdirblk(struct newdirblk *); -STATIC int indir_trunc(struct inode *, daddr_t, int, daddr64_t, long *); +STATIC int indir_trunc(struct inode *, daddr64_t, int, daddr64_t, long *); STATIC void deallocate_dependencies(struct buf *, struct inodedep *); STATIC void free_allocdirect(struct allocdirectlst *, struct allocdirect *, int); @@ -149,14 +149,14 @@ 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, daddr_t, - daddr_t); +STATIC struct allocindir *newallocindir(struct inode *, int, daddr64_t, + daddr64_t); STATIC void handle_workitem_freefrag(struct freefrag *); -STATIC struct freefrag *newfreefrag(struct inode *, daddr_t, long); +STATIC struct freefrag *newfreefrag(struct inode *, daddr64_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 *, daddr_t, int, +STATIC int newblk_lookup(struct fs *, daddr64_t, int, struct newblk **); STATIC int inodedep_lookup(struct fs *, ino_t, int, struct inodedep **); STATIC int pagedep_lookup(struct inode *, daddr64_t, int, struct pagedep **); @@ -1142,7 +1142,7 @@ STATIC struct sema newblk_in_progress; STATIC int newblk_lookup(fs, newblkno, flags, newblkpp) struct fs *fs; - daddr_t newblkno; + daddr64_t newblkno; int flags; struct newblk **newblkpp; { @@ -1352,7 +1352,7 @@ void softdep_setup_blkmapdep(bp, fs, newblkno) struct buf *bp; /* buffer for cylgroup block with block map */ struct fs *fs; /* filesystem doing allocation */ - daddr_t newblkno; /* number of newly allocated block */ + daddr64_t newblkno; /* number of newly allocated block */ { struct newblk *newblk; struct bmsafemap *bmsafemap; @@ -1439,8 +1439,8 @@ void softdep_setup_allocdirect(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp) struct inode *ip; /* inode to which block is being added */ daddr64_t lbn; /* block pointer within inode */ - daddr_t newblkno; /* disk block number being added */ - daddr_t oldblkno; /* previous block number, 0 unless frag */ + daddr64_t newblkno; /* disk block number being added */ + daddr64_t oldblkno; /* previous block number, 0 unless frag */ long newsize; /* size of new block */ long oldsize; /* size of new block */ struct buf *bp; /* bp for allocated block */ @@ -1619,7 +1619,7 @@ allocdirect_merge(adphead, newadp, oldadp) STATIC struct freefrag * newfreefrag(ip, blkno, size) struct inode *ip; - daddr_t blkno; + daddr64_t blkno; long size; { struct freefrag *freefrag; @@ -1695,8 +1695,8 @@ STATIC struct allocindir * newallocindir(ip, ptrno, newblkno, oldblkno) struct inode *ip; /* inode for file being extended */ int ptrno; /* offset of pointer in indirect block */ - daddr_t newblkno; /* disk block number being added */ - daddr_t oldblkno; /* previous block number, 0 if none */ + daddr64_t newblkno; /* disk block number being added */ + daddr64_t oldblkno; /* previous block number, 0 if none */ { struct allocindir *aip; @@ -1721,8 +1721,8 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp) daddr64_t lbn; /* allocated block number within file */ struct buf *bp; /* buffer with indirect blk referencing page */ int ptrno; /* offset of pointer in indirect block */ - daddr_t newblkno; /* disk block number being added */ - daddr_t oldblkno; /* previous block number, 0 if none */ + daddr64_t newblkno; /* disk block number being added */ + daddr64_t oldblkno; /* previous block number, 0 if none */ struct buf *nbp; /* buffer holding allocated page */ { struct allocindir *aip; @@ -1759,7 +1759,7 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno) struct inode *ip; /* inode for file being extended */ struct buf *bp; /* indirect block referencing allocated block */ int ptrno; /* offset of pointer in indirect block */ - daddr_t newblkno; /* disk block number being added */ + daddr64_t newblkno; /* disk block number being added */ { struct allocindir *aip; @@ -2388,7 +2388,7 @@ handle_workitem_freeblocks(freeblks) struct freeblks *freeblks; { struct inode tip; - daddr_t bn; + daddr64_t bn; union { struct ufs1_dinode di1; struct ufs2_dinode di2; @@ -2460,7 +2460,7 @@ handle_workitem_freeblocks(freeblks) STATIC int indir_trunc(ip, dbn, level, lbn, countp) struct inode *ip; - daddr_t dbn; + daddr64_t dbn; int level; daddr64_t lbn; long *countp; diff --git a/sys/ufs/ffs/ffs_softdep_stub.c b/sys/ufs/ffs/ffs_softdep_stub.c index 166002f4bb9..d18c41c52e6 100644 --- a/sys/ufs/ffs/ffs_softdep_stub.c +++ b/sys/ufs/ffs/ffs_softdep_stub.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_softdep_stub.c,v 1.15 2007/06/01 20:23:26 pedro Exp $ */ +/* $OpenBSD: ffs_softdep_stub.c,v 1.16 2008/01/05 19:49:26 otto Exp $ */ /* * Copyright 1998 Marshall Kirk McKusick. All Rights Reserved. @@ -74,28 +74,28 @@ softdep_setup_inomapdep(struct buf *bp, struct inode *ip, ino_t newinum) } void -softdep_setup_blkmapdep(struct buf *bp, struct fs *fs, daddr_t newblkno) +softdep_setup_blkmapdep(struct buf *bp, struct fs *fs, daddr64_t newblkno) { panic("softdep_setup_blkmapdep called"); } void -softdep_setup_allocdirect(struct inode *ip, daddr64_t lbn, daddr_t newblkno, - daddr_t oldblkno, long newsize, long oldsize, struct buf *bp) +softdep_setup_allocdirect(struct inode *ip, daddr64_t lbn, daddr64_t newblkno, + daddr64_t oldblkno, long newsize, long oldsize, struct buf *bp) { panic("softdep_setup_allocdirect called"); } void softdep_setup_allocindir_page(struct inode *ip, daddr64_t lbn, struct buf *bp, - int ptrno, daddr_t newblkno, daddr_t oldblkno, struct buf *nbp) + int ptrno, daddr64_t newblkno, daddr64_t oldblkno, struct buf *nbp) { panic("softdep_setup_allocindir_page called"); } void softdep_setup_allocindir_meta(struct buf *nbp, struct inode *ip, - struct buf *bp, int ptrno, daddr_t newblkno) + struct buf *bp, int ptrno, daddr64_t newblkno) { panic("softdep_setup_allocindir_meta called"); } diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 68236370737..21524c2bcbf 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_subr.c,v 1.20 2007/05/26 20:26:51 pedro Exp $ */ +/* $OpenBSD: ffs_subr.c,v 1.21 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ffs_subr.c,v 1.6 1996/03/17 02:16:23 christos Exp $ */ /* @@ -59,7 +59,7 @@ ffs_bufatoff(struct inode *ip, off_t offset, char **res, struct buf **bpp) struct fs *fs; struct vnode *vp; struct buf *bp; - daddr_t lbn; + daddr64_t lbn; int bsize, error; vp = ITOV(ip); @@ -81,10 +81,10 @@ ffs_bufatoff(struct inode *ip, off_t offset, char **res, struct buf **bpp) #else /* Prototypes for userland */ void ffs_fragacct(struct fs *, int, int32_t[], int); -int ffs_isfreeblock(struct fs *, unsigned char *, daddr_t); -int ffs_isblock(struct fs *, unsigned char *, daddr_t); -void ffs_clrblock(struct fs *, u_char *, daddr_t); -void ffs_setblock(struct fs *, unsigned char *, daddr_t); +int ffs_isfreeblock(struct fs *, unsigned char *, daddr64_t); +int ffs_isblock(struct fs *, unsigned char *, daddr64_t); +void ffs_clrblock(struct fs *, u_char *, daddr64_t); +void ffs_setblock(struct fs *, unsigned char *, daddr64_t); __dead void panic(const char *, ...); #endif @@ -123,7 +123,7 @@ ffs_fragacct(struct fs *fs, int fragmap, int32_t fraglist[], int cnt) void ffs_checkoverlap(struct buf *bp, struct inode *ip) { - daddr_t start, last; + daddr64_t start, last; struct vnode *vp; struct buf *ep; @@ -133,7 +133,7 @@ ffs_checkoverlap(struct buf *bp, struct inode *ip) if (ep == bp || (ep->b_flags & B_INVAL) || ep->b_vp == NULLVP) continue; - if (VOP_BMAP(ep->b_vp, (daddr_t)0, &vp, (daddr_t)0, NULL)) + if (VOP_BMAP(ep->b_vp, (daddr64_t)0, &vp, (daddr64_t)0, NULL)) continue; if (vp != ip->i_devvp) continue; @@ -156,7 +156,7 @@ ffs_checkoverlap(struct buf *bp, struct inode *ip) * check if a block is available */ int -ffs_isblock(struct fs *fs, unsigned char *cp, daddr_t h) +ffs_isblock(struct fs *fs, unsigned char *cp, daddr64_t h) { unsigned char mask; @@ -180,7 +180,7 @@ ffs_isblock(struct fs *fs, unsigned char *cp, daddr_t h) * take a block out of the map */ void -ffs_clrblock(struct fs *fs, u_char *cp, daddr_t h) +ffs_clrblock(struct fs *fs, u_char *cp, daddr64_t h) { switch (fs->fs_frag) { @@ -204,7 +204,7 @@ ffs_clrblock(struct fs *fs, u_char *cp, daddr_t h) * put a block into the map */ void -ffs_setblock(struct fs *fs, unsigned char *cp, daddr_t h) +ffs_setblock(struct fs *fs, unsigned char *cp, daddr64_t h) { switch (fs->fs_frag) { @@ -228,7 +228,7 @@ ffs_setblock(struct fs *fs, unsigned char *cp, daddr_t h) * check if a block is free */ int -ffs_isfreeblock(struct fs *fs, unsigned char *cp, daddr_t h) +ffs_isfreeblock(struct fs *fs, unsigned char *cp, daddr64_t h) { switch (fs->fs_frag) { diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 1731d7f6d0d..76c93f18d08 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.111 2007/09/10 20:57:04 thib Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.112 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -554,7 +554,7 @@ ffs_reload(struct mount *mountp, struct ucred *cred, struct proc *p) fs = VFSTOUFS(mountp)->um_fs; - error = bread(devvp, (daddr_t)(fs->fs_sblockloc / size), SBSIZE, + error = bread(devvp, (daddr64_t)(fs->fs_sblockloc / size), SBSIZE, NOCRED, &bp); if (error) { brelse(bp); diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 57e398d8c21..04650126e14 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vnops.c,v 1.46 2007/09/23 20:15:07 millert Exp $ */ +/* $OpenBSD: ffs_vnops.c,v 1.47 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ffs_vnops.c,v 1.7 1996/05/11 18:27:24 mycroft Exp $ */ /* @@ -269,7 +269,7 @@ ffs_write(void *v) struct fs *fs; struct buf *bp; struct proc *p; - daddr_t lbn; + daddr64_t lbn; off_t osize; int blkoffset, error, extended, flags, ioflag, resid, size, xfersize; diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index 31df499bf9e..da799a11497 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fs.h,v 1.32 2007/06/01 07:03:27 otto Exp $ */ +/* $OpenBSD: fs.h,v 1.33 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: fs.h,v 1.6 1995/04/12 21:21:02 mycroft Exp $ */ /* @@ -60,8 +60,8 @@ #define SBSIZE 8192 #define BBOFF ((off_t)(0)) #define SBOFF ((off_t)(BBOFF + BBSIZE)) -#define BBLOCK ((daddr_t)(0)) -#define SBLOCK ((daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE)) +#define BBLOCK ((daddr64_t)(0)) +#define SBLOCK ((daddr64_t)(BBLOCK + BBSIZE / DEV_BSIZE)) #define SBLOCK_UFS1 8192 #define SBLOCK_UFS2 65536 #define SBLOCK_PIGGY 262144 @@ -463,7 +463,7 @@ struct ocg { * Cylinder group macros to locate things in cylinder groups. * They calc file system addresses of cylinder group data structures. */ -#define cgbase(fs, c) ((daddr_t)((fs)->fs_fpg * (c))) +#define cgbase(fs, c) ((daddr64_t)(fs)->fs_fpg * (c)) #define cgdmin(fs, c) (cgstart(fs, c) + (fs)->fs_dblkno) /* 1st data */ #define cgimin(fs, c) (cgstart(fs, c) + (fs)->fs_iblkno) /* inode blk */ #define cgsblock(fs, c) (cgstart(fs, c) + (fs)->fs_sblkno) /* super blk */ @@ -479,7 +479,7 @@ struct ocg { */ #define ino_to_cg(fs, x) ((x) / (fs)->fs_ipg) #define ino_to_fsba(fs, x) \ - ((daddr_t)(cgimin(fs, ino_to_cg(fs, x)) + \ + ((daddr64_t)(cgimin(fs, ino_to_cg(fs, x)) + \ (blkstofrags((fs), (((x) % (fs)->fs_ipg) / INOPB(fs)))))) #define ino_to_fsbo(fs, x) ((x) % INOPB(fs)) diff --git a/sys/ufs/ffs/softdep.h b/sys/ufs/ffs/softdep.h index 187dbd22ac3..3f4bd355f00 100644 --- a/sys/ufs/ffs/softdep.h +++ b/sys/ufs/ffs/softdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: softdep.h,v 1.14 2007/06/01 20:23:26 pedro Exp $ */ +/* $OpenBSD: softdep.h,v 1.15 2008/01/05 19:49:26 otto Exp $ */ /* * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved. @@ -280,7 +280,7 @@ struct inodedep { struct newblk { LIST_ENTRY(newblk) nb_hash; /* hashed lookup */ struct fs *nb_fs; /* associated filesystem */ - daddr_t nb_newblkno; /* allocated block number */ + daddr64_t nb_newblkno; /* allocated block number */ int nb_state; /* state of bitmap dependency */ LIST_ENTRY(newblk) nb_deps; /* bmsafemap's list of newblk's */ struct bmsafemap *nb_bmsafemap; /* associated bmsafemap */ @@ -337,8 +337,8 @@ struct allocdirect { # define ad_state ad_list.wk_state /* block pointer state */ TAILQ_ENTRY(allocdirect) ad_next; /* inodedep's list of allocdirect's */ daddr64_t ad_lbn; /* block within file */ - daddr_t ad_newblkno; /* new value of block pointer */ - daddr_t ad_oldblkno; /* old value of block pointer */ + daddr64_t ad_newblkno; /* new value of block pointer */ + daddr64_t ad_oldblkno; /* old value of block pointer */ long ad_newsize; /* size of new block */ long ad_oldsize; /* size of old block */ LIST_ENTRY(allocdirect) ad_deps; /* bmsafemap's list of allocdirect's */ @@ -392,8 +392,8 @@ struct allocindir { # define ai_state ai_list.wk_state /* indirect block pointer state */ LIST_ENTRY(allocindir) ai_next; /* indirdep's list of allocindir's */ int ai_offset; /* pointer offset in indirect block */ - daddr_t ai_newblkno; /* new block pointer value */ - daddr_t ai_oldblkno; /* old block pointer value */ + daddr64_t ai_newblkno; /* new block pointer value */ + daddr64_t ai_oldblkno; /* old block pointer value */ struct freefrag *ai_freefrag; /* block to be freed when complete */ struct indirdep *ai_indirdep; /* address of associated indirdep */ LIST_ENTRY(allocindir) ai_deps; /* bmsafemap's list of allocindir's */ @@ -415,7 +415,7 @@ struct freefrag { # define ff_state ff_list.wk_state /* owning user; should be uid_t */ struct vnode *ff_devvp; /* filesystem device vnode */ struct mount *ff_mnt; /* associated mount point */ - daddr_t ff_blkno; /* fragment physical block number */ + daddr64_t ff_blkno; /* fragment physical block number */ long ff_fragsize; /* size of fragment being deleted */ ino_t ff_inum; /* owning inode number */ }; @@ -436,8 +436,8 @@ struct freeblks { off_t fb_newsize; /* new file size */ int fb_chkcnt; /* used to check cnt of blks released */ uid_t fb_uid; /* uid of previous owner of blocks */ - daddr_t fb_dblks[NDADDR]; /* direct blk ptrs to deallocate */ - daddr_t fb_iblks[NIADDR]; /* indirect blk ptrs to deallocate */ + daddr64_t fb_dblks[NDADDR]; /* direct blk ptrs to deallocate */ + daddr64_t fb_iblks[NIADDR]; /* indirect blk ptrs to deallocate */ }; /* diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index 457977bcf91..f9cd5b4ae32 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -1,4 +1,4 @@ -/* $OpenBSD: inode.h,v 1.35 2007/06/02 00:45:50 pedro Exp $ */ +/* $OpenBSD: inode.h,v 1.36 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: inode.h,v 1.8 1995/06/15 23:22:50 cgd Exp $ */ /* @@ -290,7 +290,7 @@ struct inode_vtbl { * ufs_getlbns and used by truncate and bmap code. */ struct indir { - daddr_t in_lbn; /* Logical block number. */ + daddr64_t in_lbn; /* Logical block number. */ int in_off; /* Offset in buffer. */ int in_exists; /* Flag if the block exists. */ }; diff --git a/sys/ufs/ufs/quota.h b/sys/ufs/ufs/quota.h index 00af9e215d9..b23a2b6c427 100644 --- a/sys/ufs/ufs/quota.h +++ b/sys/ufs/ufs/quota.h @@ -1,4 +1,4 @@ -/* $OpenBSD: quota.h,v 1.8 2003/06/02 23:28:23 millert Exp $ */ +/* $OpenBSD: quota.h,v 1.9 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: quota.h,v 1.6 1995/03/26 20:38:17 jtc Exp $ */ /* @@ -130,8 +130,8 @@ __BEGIN_DECLS #define ufs_quota_free_blocks(i, c, cr) ufs_quota_free_blocks2(i, c, cr, 0) #define ufs_quota_alloc_inode(i, cr) ufs_quota_alloc_inode2(i, cr, 0) #define ufs_quota_free_inode(i, cr) ufs_quota_free_inode2(i, cr, 0) -int ufs_quota_alloc_blocks2(struct inode *, int32_t, struct ucred *, enum ufs_quota_flags); -int ufs_quota_free_blocks2(struct inode *, int32_t, struct ucred *, enum ufs_quota_flags); +int ufs_quota_alloc_blocks2(struct inode *, daddr64_t, struct ucred *, enum ufs_quota_flags); +int ufs_quota_free_blocks2(struct inode *, daddr64_t, struct ucred *, enum ufs_quota_flags); int ufs_quota_alloc_inode2(struct inode *, struct ucred *, enum ufs_quota_flags); int ufs_quota_free_inode2(struct inode *, struct ucred *, enum ufs_quota_flags); diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c index 5f1d3f1bbe0..fa22c0934ec 100644 --- a/sys/ufs/ufs/ufs_bmap.c +++ b/sys/ufs/ufs/ufs_bmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_bmap.c,v 1.25 2007/06/01 23:47:57 deraadt Exp $ */ +/* $OpenBSD: ufs_bmap.c,v 1.26 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ufs_bmap.c,v 1.3 1996/02/09 22:36:00 christos Exp $ */ /* @@ -89,7 +89,7 @@ ufs_bmap(void *v) * next block and the disk address of the block (if it is assigned). */ int -ufs_bmaparray(struct vnode *vp, daddr_t bn, daddr64_t *bnp, struct indir *ap, +ufs_bmaparray(struct vnode *vp, daddr64_t bn, daddr64_t *bnp, struct indir *ap, int *nump, int *runp) { struct inode *ip; @@ -98,8 +98,7 @@ ufs_bmaparray(struct vnode *vp, daddr_t bn, daddr64_t *bnp, struct indir *ap, struct mount *mp; struct vnode *devvp; struct indir a[NIADDR+1], *xap; - daddr64_t daddr; - long metalbn; + daddr64_t daddr, metalbn; int error, maxrun = 0, num; ip = VTOI(vp); @@ -184,13 +183,13 @@ ufs_bmaparray(struct vnode *vp, daddr_t bn, daddr64_t *bnp, struct indir *ap, #ifdef FFS2 if (ip->i_ump->um_fstype == UM_UFS2) { - daddr = ((daddr64_t *)bp->b_data)[xap->in_off]; + daddr = ((int64_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, - ((daddr64_t *)bp->b_data)[bn - 1], - ((daddr64_t *)bp->b_data)[bn]); + ((int64_t *)bp->b_data)[bn - 1], + ((int64_t *)bp->b_data)[bn]); ++bn, ++*runp); continue; @@ -198,13 +197,13 @@ ufs_bmaparray(struct vnode *vp, daddr_t bn, daddr64_t *bnp, struct indir *ap, #endif /* FFS2 */ - daddr = ((daddr_t *)bp->b_data)[xap->in_off]; + daddr = ((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, - ((daddr_t *)bp->b_data)[bn - 1], - ((daddr_t *)bp->b_data)[bn]); + ((int32_t *)bp->b_data)[bn - 1], + ((int32_t *)bp->b_data)[bn]); ++bn, ++*runp); } if (bp) @@ -225,9 +224,9 @@ ufs_bmaparray(struct vnode *vp, daddr_t bn, daddr64_t *bnp, struct indir *ap, * once with the offset into the page itself. */ int -ufs_getlbns(struct vnode *vp, daddr_t bn, struct indir *ap, int *nump) +ufs_getlbns(struct vnode *vp, daddr64_t bn, struct indir *ap, int *nump) { - long metalbn, realbn; + daddr64_t metalbn, realbn; struct ufsmount *ump; int64_t blockcnt; int i, numlevels, off; @@ -237,8 +236,8 @@ ufs_getlbns(struct vnode *vp, daddr_t bn, struct indir *ap, int *nump) *nump = 0; numlevels = 0; realbn = bn; - if ((long)bn < 0) - bn = -(long)bn; + if (bn < 0) + bn = -bn; #ifdef DIAGNOSTIC if (realbn < 0 && realbn > -NDADDR) { diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index 8043b6472c1..d2fa799ed85 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_extern.h,v 1.28 2007/05/09 17:04:22 deraadt Exp $ */ +/* $OpenBSD: ufs_extern.h,v 1.29 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ufs_extern.h,v 1.5 1996/02/09 22:36:03 christos Exp $ */ /*- @@ -95,9 +95,9 @@ int ufsfifo_close(void *); #endif /* ufs_bmap.c */ -int ufs_bmaparray(struct vnode *, daddr_t, daddr64_t *, struct indir *, +int ufs_bmaparray(struct vnode *, daddr64_t, daddr64_t *, struct indir *, int *, int *); -int ufs_getlbns(struct vnode *, daddr_t, struct indir *, int *); +int ufs_getlbns(struct vnode *, daddr64_t, struct indir *, int *); /* ufs_ihash.c */ void ufs_ihashinit(void); diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index 1b33801d9a5..287e5531e8d 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_quota.c,v 1.29 2007/10/01 16:39:30 krw Exp $ */ +/* $OpenBSD: ufs_quota.c,v 1.30 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ufs_quota.c,v 1.8 1996/02/09 22:36:09 christos Exp $ */ /* @@ -177,7 +177,7 @@ getinoquota(struct inode *ip) * Update disk usage, and take corrective action. */ int -ufs_quota_alloc_blocks2(struct inode *ip, int32_t change, +ufs_quota_alloc_blocks2(struct inode *ip, daddr64_t change, struct ucred *cred, enum ufs_quota_flags flags) { struct dquot *dq; @@ -218,7 +218,7 @@ ufs_quota_alloc_blocks2(struct inode *ip, int32_t change, } int -ufs_quota_free_blocks2(struct inode *ip, int32_t change, +ufs_quota_free_blocks2(struct inode *ip, daddr64_t change, struct ucred *cred, enum ufs_quota_flags flags) { struct dquot *dq; diff --git a/sys/ufs/ufs/ufs_quota_stub.c b/sys/ufs/ufs/ufs_quota_stub.c index 70f0334587f..19f3fdba50d 100644 --- a/sys/ufs/ufs/ufs_quota_stub.c +++ b/sys/ufs/ufs/ufs_quota_stub.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_quota_stub.c,v 1.4 2005/07/03 20:14:03 drahn Exp $ */ +/* $OpenBSD: ufs_quota_stub.c,v 1.5 2008/01/05 19:49:26 otto Exp $ */ #include <sys/param.h> #include <sys/kernel.h> @@ -23,13 +23,13 @@ getinoquota(struct inode *ip) { } int -ufs_quota_alloc_blocks2(struct inode *ip, daddr_t change, +ufs_quota_alloc_blocks2(struct inode *ip, daddr64_t change, struct ucred *cred, enum ufs_quota_flags flags) { return (0); } int -ufs_quota_free_blocks2(struct inode *ip, daddr_t change, +ufs_quota_free_blocks2(struct inode *ip, daddr64_t change, struct ucred *cred, enum ufs_quota_flags flags) { return (0); } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index d4fad5c6d21..d2bd1fb978f 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_vnops.c,v 1.84 2007/10/29 17:06:20 chl Exp $ */ +/* $OpenBSD: ufs_vnops.c,v 1.85 2008/01/05 19:49:26 otto Exp $ */ /* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */ /* @@ -450,7 +450,7 @@ ufs_chown(struct vnode *vp, uid_t uid, gid_t gid, struct ucred *cred, uid_t ouid; gid_t ogid; int error = 0; - daddr_t change; + daddr64_t change; enum ufs_quota_flags quota_flags = 0; if (uid == (uid_t)VNOVAL) @@ -1565,10 +1565,10 @@ ufs_strategy(void *v) splx(s); return (error); } - if ((long)bp->b_blkno == -1) + if (bp->b_blkno == -1) clrbuf(bp); } - if ((long)bp->b_blkno == -1) { + if (bp->b_blkno == -1) { s = splbio(); biodone(bp); splx(s); |