From owner-p4-projects@FreeBSD.ORG Tue Oct 20 20:48:41 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9FEBA106568D; Tue, 20 Oct 2009 20:48:41 +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 644291065693 for ; Tue, 20 Oct 2009 20:48:41 +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 520D78FC1B for ; Tue, 20 Oct 2009 20:48:41 +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 n9KKmfK1012798 for ; Tue, 20 Oct 2009 20:48:41 GMT (envelope-from truncs@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n9KKmfw7012796 for perforce@freebsd.org; Tue, 20 Oct 2009 20:48:41 GMT (envelope-from truncs@FreeBSD.org) Date: Tue, 20 Oct 2009 20:48:41 GMT Message-Id: <200910202048.n9KKmfw7012796@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 169625 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: Tue, 20 Oct 2009 20:48:42 -0000 http://p4web.freebsd.org/chv.cgi?CH=169625 Change 169625 by truncs@aditya on 2009/10/20 20:47:46 Apply locks to ext2_balloc. Affected files ... .. //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/ext2_balloc.c#6 edit Differences ... ==== //depot/projects/soc2009/soc_ext2fs/src/sys/fs/ext2fs/ext2_balloc.c#6 (text+ko) ==== @@ -64,6 +64,7 @@ int flags; { struct m_ext2fs *fs; + struct ext2mount *ump; int32_t nb; struct buf *bp, *nbp; struct vnode *vp = ITOV(ip); @@ -75,6 +76,7 @@ if (lbn < 0) return (EFBIG); fs = ip->i_e2fs; + ump = ip->i_ump; /* * check if this is a sequential block allocation. @@ -133,6 +135,7 @@ nsize = fragroundup(fs, size); else nsize = fs->e2fs_bsize; + EXT2_LOCK(ump); error = ext2_alloc(ip, lbn, ext2_blkpref(ip, lbn, (int)lbn, &ip->i_db[0], 0), nsize, cred, &newb); @@ -177,7 +180,8 @@ 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 @@ -228,7 +232,8 @@ */ pref = ext2_blkpref(ip, lbn, indirs[i].in_off, bap, bp->b_lblkno); -#else +#else + EXT2_LOCK(ump); pref = ext2_blkpref(ip, lbn, 0, (int32_t *)0, 0); #endif if ((error = @@ -264,6 +269,7 @@ * Get the data block, allocating if necessary. */ if (nb == 0) { + EXT2_LOCK(ump); pref = ext2_blkpref(ip, lbn, indirs[i].in_off, &bap[0], bp->b_lblkno); if ((error = ext2_alloc(ip,