From owner-p4-projects@FreeBSD.ORG Wed Dec 2 20:14:16 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E4BF81065672; Wed, 2 Dec 2009 20:14:15 +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 A9249106566C for ; Wed, 2 Dec 2009 20:14:15 +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 7E04C8FC12 for ; Wed, 2 Dec 2009 20:14:15 +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 nB2KEFkp029328 for ; Wed, 2 Dec 2009 20:14:15 GMT (envelope-from truncs@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id nB2KEFr9029326 for perforce@freebsd.org; Wed, 2 Dec 2009 20:14:15 GMT (envelope-from truncs@FreeBSD.org) Date: Wed, 2 Dec 2009 20:14:15 GMT Message-Id: <200912022014.nB2KEFr9029326@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 Precedence: bulk Cc: Subject: PERFORCE change 171300 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 20:14:16 -0000 http://p4web.freebsd.org/chv.cgi?CH=171300 Change 171300 by truncs@aditya on 2009/12/02 20:13:46 Get rid of the unwanted #ifdef ugliness. Affected files ... .. //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/ext2_balloc.c#9 edit Differences ... ==== //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/ext2_balloc.c#9 (text+ko) ==== @@ -167,24 +167,9 @@ --num; nb = ip->i_ib[indirs[0].in_off]; if (nb == 0) { -#if 0 - pref = ext2_blkpref(ip, lbn, 0, (int32_t *)0, 0); -#else - /* see the comment by ext2_blkpref. What we do here is - to pretend that it'd be good for a block holding indirect - pointers to be allocated near its predecessor in terms - of indirection, or the last direct block. - We shamelessly exploit the fact that i_ib immediately - follows i_db. - Godmar thinks it make sense to allocate i_ib[0] immediately - after i_db[11], but it's not utterly clear whether this also - applies to i_ib[1] and i_ib[0] - */ - EXT2_LOCK(ump); 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))) return (error); @@ -222,22 +207,13 @@ bqrelse(bp); continue; } - if (pref == 0) -#if 1 - /* see the comment above and by ext2_blkpref - * I think this implements Linux policy, but - * does it really make sense to allocate to - * block containing pointers together ? - * Also, will it ever succeed ? - */ - pref = ext2_blkpref(ip, lbn, indirs[i].in_off, bap, - bp->b_lblkno); -#else + if (pref == 0) { EXT2_LOCK(ump); pref = ext2_blkpref(ip, lbn, 0, (int32_t *)0, 0); -#endif - if ((error = - ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, cred, &newb)) != 0) { + } else + EXT2_LOCK(ump); + error = ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, cred, &newb); + if(error) { brelse(bp); return (error); }