From owner-p4-projects@FreeBSD.ORG Thu Jun 4 18:19:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7C8F2106567A; Thu, 4 Jun 2009 18:19:54 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3745E1065674 for ; Thu, 4 Jun 2009 18:19:54 +0000 (UTC) (envelope-from truncs@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 183B98FC4D for ; Thu, 4 Jun 2009 18:19:54 +0000 (UTC) (envelope-from truncs@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n54IJrZ7019758 for ; Thu, 4 Jun 2009 18:19:53 GMT (envelope-from truncs@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n54IJrDZ019756 for perforce@freebsd.org; Thu, 4 Jun 2009 18:19:53 GMT (envelope-from truncs@FreeBSD.org) Date: Thu, 4 Jun 2009 18:19:53 GMT Message-Id: <200906041819.n54IJrDZ019756@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to truncs@FreeBSD.org using -f From: Aditya Sarawgi To: Perforce Change Reviews Cc: Subject: PERFORCE change 163509 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 18:19:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=163509 Change 163509 by truncs@aditya on 2009/06/04 18:19:50 Migration to new in-memory superblock continues. Affected files ... .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/COPYRIGHT.INFO#4 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_alloc.c#3 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_balloc.c#2 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_bitops.h#2 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_bmap.c#2 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_extern.h#2 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_fs.h#4 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_fs_sb.h#3 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_inode.c#2 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_inode_cnv.c#3 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_linux_balloc.c#2 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c#2 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_lookup.c#3 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_mount.h#2 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_readwrite.c#2 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_subr.c#2 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#3 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vnops.c#5 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/fs.h#3 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/i386-bitops.h#2 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/inode.h#3 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/sparc64-bitops.h#2 edit Differences ... ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/COPYRIGHT.INFO#4 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_alloc.c#3 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_balloc.c#2 (text+ko) ==== @@ -64,7 +64,7 @@ struct buf **bpp; int flags; { - struct ext2_sb_info *fs; + struct m_ext2fs *fs; int32_t nb; struct buf *bp, *nbp; struct vnode *vp = ITOV(ip); @@ -98,8 +98,8 @@ nb = ip->i_db[bn]; /* no new block is to be allocated, and no need to expand the file */ - if (nb != 0 && ip->i_size >= (bn + 1) * fs->s_blocksize) { - error = bread(vp, bn, fs->s_blocksize, NOCRED, &bp); + if (nb != 0 && ip->i_size >= (bn + 1) * fs->e2fs_bsize) { + error = bread(vp, bn, fs->e2fs_bsize, NOCRED, &bp); if (error) { brelse(bp); return (error); @@ -134,10 +134,10 @@ */ } } else { - if (ip->i_size < (bn + 1) * fs->s_blocksize) + if (ip->i_size < (bn + 1) * fs->e2fs_bsize) nsize = fragroundup(fs, size); else - nsize = fs->s_blocksize; + nsize = fs->e2fs_bsize; error = ext2_alloc(ip, bn, ext2_blkpref(ip, bn, (int)bn, &ip->i_db[0], 0), nsize, cred, &newb); @@ -186,11 +186,11 @@ pref = ext2_blkpref(ip, lbn, indirs[0].in_off + EXT2_NDIR_BLOCKS, &ip->i_db[0], 0); #endif - if ((error = ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, + if ((error = ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, cred, &newb)) != 0) return (error); nb = newb; - bp = getblk(vp, indirs[1].in_lbn, fs->s_blocksize, 0, 0, 0); + bp = getblk(vp, indirs[1].in_lbn, fs->e2fs_bsize, 0, 0, 0); bp->b_blkno = fsbtodb(fs, newb); vfs_bio_clrbuf(bp); /* @@ -198,7 +198,7 @@ * never point at garbage. */ if ((error = bwrite(bp)) != 0) { - ext2_blkfree(ip, nb, fs->s_blocksize); + ext2_blkfree(ip, nb, fs->e2fs_bsize); return (error); } ip->i_ib[indirs[0].in_off] = newb; @@ -209,7 +209,7 @@ */ for (i = 1;;) { error = bread(vp, - indirs[i].in_lbn, (int)fs->s_blocksize, NOCRED, &bp); + indirs[i].in_lbn, (int)fs->e2fs_bsize, NOCRED, &bp); if (error) { brelse(bp); return (error); @@ -237,12 +237,12 @@ pref = ext2_blkpref(ip, lbn, 0, (int32_t *)0, 0); #endif if ((error = - ext2_alloc(ip, lbn, pref, (int)fs->s_blocksize, cred, &newb)) != 0) { + ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, cred, &newb)) != 0) { brelse(bp); return (error); } nb = newb; - nbp = getblk(vp, indirs[i].in_lbn, fs->s_blocksize, 0, 0, 0); + nbp = getblk(vp, indirs[i].in_lbn, fs->e2fs_bsize, 0, 0, 0); nbp->b_blkno = fsbtodb(fs, nb); vfs_bio_clrbuf(nbp); /* @@ -250,7 +250,7 @@ * never point at garbage. */ if ((error = bwrite(nbp)) != 0) { - ext2_blkfree(ip, nb, fs->s_blocksize); + ext2_blkfree(ip, nb, fs->e2fs_bsize); brelse(bp); return (error); } @@ -272,12 +272,12 @@ pref = ext2_blkpref(ip, lbn, indirs[i].in_off, &bap[0], bp->b_lblkno); if ((error = ext2_alloc(ip, - lbn, pref, (int)fs->s_blocksize, cred, &newb)) != 0) { + lbn, pref, (int)fs->e2fs_bsize, cred, &newb)) != 0) { brelse(bp); return (error); } nb = newb; - nbp = getblk(vp, lbn, fs->s_blocksize, 0, 0, 0); + nbp = getblk(vp, lbn, fs->e2fs_bsize, 0, 0, 0); nbp->b_blkno = fsbtodb(fs, nb); if (flags & B_CLRBUF) vfs_bio_clrbuf(nbp); @@ -296,13 +296,13 @@ } brelse(bp); if (flags & B_CLRBUF) { - error = bread(vp, lbn, (int)fs->s_blocksize, NOCRED, &nbp); + error = bread(vp, lbn, (int)fs->e2fs_bsize, NOCRED, &nbp); if (error) { brelse(nbp); return (error); } } else { - nbp = getblk(vp, lbn, fs->s_blocksize, 0, 0, 0); + nbp = getblk(vp, lbn, fs->e2fs_bsize, 0, 0, 0); nbp->b_blkno = fsbtodb(fs, nb); } *bpp = nbp; ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_bitops.h#2 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_bmap.c#2 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_extern.h#2 (text+ko) ==== @@ -62,7 +62,7 @@ void ext2_itimes(struct vnode *vp); int ext2_reallocblks(struct vop_reallocblks_args *); int ext2_reclaim(struct vop_reclaim_args *); -void ext2_setblock(struct ext2_sb_info *, u_char *, int32_t); +void ext2_setblock(struct m_ext2fs *, u_char *, int32_t); int ext2_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *); int ext2_update(struct vnode *, int); int ext2_valloc(struct vnode *, int, struct ucred *, struct vnode **); ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_fs.h#4 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_fs_sb.h#3 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_inode.c#2 (text+ko) ==== @@ -71,7 +71,7 @@ struct vnode *vp; int waitfor; { - struct ext2_sb_info *fs; + struct m_ext2fs *fs; struct buf *bp; struct inode *ip; int error; @@ -86,7 +86,7 @@ fs = ip->i_e2fs; if ((error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), - (int)fs->s_blocksize, NOCRED, &bp)) != 0) { + (int)fs->e2fs_bsize, NOCRED, &bp)) != 0) { brelse(bp); return (error); } @@ -120,7 +120,7 @@ struct inode *oip; int32_t bn, lbn, lastiblock[NIADDR], indir_lbn[NIADDR]; int32_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR]; - struct ext2_sb_info *fs; + struct m_ext2fs *fs; struct buf *bp; int offset, size, level; long count, nblocks, blocksreleased = 0; @@ -160,7 +160,7 @@ * value of oszie is 0, length will be at least 1. */ if (osize < length) { - if (length > oip->i_e2fs->fs_maxfilesize) + if (length > oip->i_e2fs->e2fs_maxfilesize) return (EFBIG); offset = blkoff(fs, length - 1); lbn = lblkno(fs, length - 1); @@ -213,11 +213,11 @@ * which we want to keep. Lastblock is -1 when * the file is truncated to 0. */ - lastblock = lblkno(fs, length + fs->s_blocksize - 1) - 1; + lastblock = lblkno(fs, length + fs->e2fs_bsize - 1) - 1; lastiblock[SINGLE] = lastblock - NDADDR; lastiblock[DOUBLE] = lastiblock[SINGLE] - NINDIR(fs); lastiblock[TRIPLE] = lastiblock[DOUBLE] - NINDIR(fs) * NINDIR(fs); - nblocks = btodb(fs->s_blocksize); + nblocks = btodb(fs->e2fs_bsize); /* * Update file and block pointers on disk before we start freeing * blocks. If we crash before free'ing blocks below, the blocks @@ -244,7 +244,7 @@ bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof newblks); bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof oldblks); oip->i_size = osize; - error = vtruncbuf(ovp, cred, td, length, (int)fs->s_blocksize); + error = vtruncbuf(ovp, cred, td, length, (int)fs->e2fs_bsize); if (error && (allerror == 0)) allerror = error; @@ -362,7 +362,7 @@ long *countp; { struct buf *bp; - struct ext2_sb_info *fs = ip->i_e2fs; + struct m_ext2fs *fs = ip->i_e2fs; struct vnode *vp; int32_t *bap, *copy, nb, nlbn, last; long blkcount, factor; @@ -380,7 +380,7 @@ last = lastbn; if (lastbn > 0) last /= factor; - nblocks = btodb(fs->s_blocksize); + nblocks = btodb(fs->e2fs_bsize); /* * Get buffer of block pointers, zero those entries corresponding * to blocks to be free'd, and update on disk copy first. Since @@ -390,7 +390,7 @@ * explicitly instead of letting bread do everything for us. */ vp = ITOV(ip); - bp = getblk(vp, lbn, (int)fs->s_blocksize, 0, 0, 0); + bp = getblk(vp, lbn, (int)fs->e2fs_bsize, 0, 0, 0); if (bp->b_flags & (B_DONE | B_DELWRI)) { } else { bp->b_iocmd = BIO_READ; @@ -409,8 +409,8 @@ } bap = (int32_t *)bp->b_data; - copy = malloc(fs->s_blocksize, M_TEMP, M_WAITOK); - bcopy((caddr_t)bap, (caddr_t)copy, (u_int)fs->s_blocksize); + copy = malloc(fs->e2fs_bsize, M_TEMP, M_WAITOK); + bcopy((caddr_t)bap, (caddr_t)copy, (u_int)fs->e2fs_bsize); bzero((caddr_t)&bap[last + 1], (u_int)(NINDIR(fs) - (last + 1)) * sizeof (int32_t)); if (last == -1) @@ -434,7 +434,7 @@ allerror = error; blocksreleased += blkcount; } - ext2_blkfree(ip, nb, fs->s_blocksize); + ext2_blkfree(ip, nb, fs->e2fs_bsize); blocksreleased += nblocks; } ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_inode_cnv.c#3 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_linux_balloc.c#2 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c#2 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_lookup.c#3 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_mount.h#2 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_readwrite.c#2 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_subr.c#2 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#3 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vnops.c#5 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/fs.h#3 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/i386-bitops.h#2 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/inode.h#3 (text+ko) ==== ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/sparc64-bitops.h#2 (text+ko) ====