Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Sep 2009 15:50:43 GMT
From:      Aditya Sarawgi <truncs@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 168110 for review
Message-ID:  <200909031550.n83FohUC086538@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909031550.n83FohUC086538>