From owner-p4-projects@FreeBSD.ORG Wed Jul 8 23:42:56 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C1C521065672; Wed, 8 Jul 2009 23:42:55 +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 8148C106564A for ; Wed, 8 Jul 2009 23:42:55 +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 6ED478FC1F for ; Wed, 8 Jul 2009 23:42:55 +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 n68Ngt2A021403 for ; Wed, 8 Jul 2009 23:42:55 GMT (envelope-from truncs@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n68NgtRD021401 for perforce@freebsd.org; Wed, 8 Jul 2009 23:42:55 GMT (envelope-from truncs@FreeBSD.org) Date: Wed, 8 Jul 2009 23:42:55 GMT Message-Id: <200907082342.n68NgtRD021401@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 165839 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: Wed, 08 Jul 2009 23:42:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=165839 Change 165839 by truncs@aditya on 2009/07/08 23:41:57 Check whether the block group has a superblock if the sparse super feature is there. Affected files ... .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_alloc.c#29 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_extern.h#6 edit Differences ... ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_alloc.c#29 (text+ko) ==== @@ -891,5 +891,18 @@ *bh = fs->e2fs_group_desc[group_desc]; return gdp + desc; } +int +cg_has_sb(int i) +{ + int a3, a5, a7; + if (i == 0 || i == 1) + return 1; + for (a3 = 3, a5 = 5, a7 = 7; + a3 <= i || a5 <= i || a7 <= i; + a3 *= 3, a5 *= 5, a7 *= 7) + if (i == a3 || i == a5 || i == a7) + return 1; + return 0; +} ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_extern.h#6 (text+ko) ==== @@ -80,8 +80,7 @@ int ext2_checkpath(struct inode *, struct inode *, struct ucred *); struct ext2_gd * get_group_desc(struct mount * , unsigned int , struct buf ** ); -int ext2_group_sparse(int group); -void ext2_discard_prealloc(struct inode *); +int cg_has_sb(int i); int ext2_inactive(struct vop_inactive_args *); int ext2_new_block(struct mount * mp, unsigned long goal, u_int32_t *prealloc_count, u_int32_t *prealloc_block);