From owner-p4-projects@FreeBSD.ORG Thu Sep 3 15:50:44 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E3F9E1065692; Thu, 3 Sep 2009 15:50:43 +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 8FAEF1065698 for ; Thu, 3 Sep 2009 15:50:43 +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 751F28FC18 for ; Thu, 3 Sep 2009 15:50:43 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n83Foh6G086540 for ; Thu, 3 Sep 2009 15:50:43 GMT (envelope-from truncs@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n83FohUC086538 for perforce@freebsd.org; Thu, 3 Sep 2009 15:50:43 GMT (envelope-from truncs@FreeBSD.org) Date: Thu, 3 Sep 2009 15:50:43 GMT Message-Id: <200909031550.n83FohUC086538@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 168110 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, 03 Sep 2009 15:50:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=168110 Change 168110 by truncs@aditya on 2009/09/03 15:50:29 Remove unnecessary variable. Affected files ... .. //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/ext2_balloc.c#3 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/ext2_vfsops.c#4 edit Differences ... ==== //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/ext2_balloc.c#3 (text+ko) ==== @@ -55,7 +55,7 @@ * the inode and the logical block number in a file. */ int -ext2_balloc(ip, bn, size, cred, bpp, flags) +ext2_balloc(ip, lbn, size, cred, bpp, flags) struct inode *ip; int32_t bn; int size; @@ -72,10 +72,9 @@ int osize, nsize, num, i, error; *bpp = NULL; - if (bn < 0) + if (lbn < 0) return (EFBIG); fs = ip->i_e2fs; - lbn = bn; /* * check if this is a sequential block allocation. @@ -90,12 +89,12 @@ /* * The first NDADDR blocks are direct blocks */ - if (bn < NDADDR) { - nb = ip->i_db[bn]; + if (lbn < NDADDR) { + nb = ip->i_db[lbn]; /* no new block is to be allocated, and no need to expand the file */ - if (nb != 0 && ip->i_size >= (bn + 1) * fs->e2fs_bsize) { - error = bread(vp, bn, fs->e2fs_bsize, NOCRED, &bp); + if (nb != 0 && ip->i_size >= (lbn + 1) * fs->e2fs_bsize) { + error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp); if (error) { brelse(bp); return (error); @@ -111,7 +110,7 @@ osize = fragroundup(fs, blkoff(fs, ip->i_size)); nsize = fragroundup(fs, size); if (nsize <= osize) { - error = bread(vp, bn, osize, NOCRED, &bp); + error = bread(vp, lbn, osize, NOCRED, &bp); if (error) { brelse(bp); return (error); @@ -134,17 +133,17 @@ nsize = fragroundup(fs, size); else nsize = fs->e2fs_bsize; - error = ext2_alloc(ip, bn, - ext2_blkpref(ip, bn, (int)bn, &ip->i_db[0], 0), + error = ext2_alloc(ip, lbn, + ext2_blkpref(ip, bn, (int)lbn, &ip->i_db[0], 0), nsize, cred, &newb); if (error) return (error); - bp = getblk(vp, bn, nsize, 0, 0, 0); + bp = getblk(vp, lbn, nsize, 0, 0, 0); bp->b_blkno = fsbtodb(fs, newb); if (flags & B_CLRBUF) vfs_bio_clrbuf(bp); } - ip->i_db[bn] = dbtofsb(fs, bp->b_blkno); + ip->i_db[lbn] = dbtofsb(fs, bp->b_blkno); ip->i_flag |= IN_CHANGE | IN_UPDATE; *bpp = bp; return (0); @@ -153,7 +152,7 @@ * Determine the number of levels of indirection. */ pref = 0; - if ((error = ext2_getlbns(vp, bn, indirs, &num)) != 0) + if ((error = ext2_getlbns(vp, lbn, indirs, &num)) != 0) return(error); #ifdef DIAGNOSTIC if (num < 1) @@ -182,8 +181,8 @@ 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->e2fs_bsize, - cred, &newb)) != 0) + if (error = ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, + cred, &newb) return (error); nb = newb; bp = getblk(vp, indirs[1].in_lbn, fs->e2fs_bsize, 0, 0, 0); ==== //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/ext2_vfsops.c#4 (text+ko) ==== @@ -401,6 +401,7 @@ * 4) invalidate all inactive vnodes. * 5) invalidate all cached file data. * 6) re-read inode data for all active vnodes. + * XXX we are missing some steps, in particular # 3, this has to be reviewed. */ static int ext2_reload(struct mount *mp, struct thread *td)