Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MbgfD-00009H-GK for mharc-grub-devel@gnu.org; Thu, 13 Aug 2009 16:12:43 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbgfB-00008l-Pz for grub-devel@gnu.org; Thu, 13 Aug 2009 16:12:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mbgf6-00006U-3V for grub-devel@gnu.org; Thu, 13 Aug 2009 16:12:41 -0400 Received: from [199.232.76.173] (port=57631 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mbgf5-00006O-Ug for grub-devel@gnu.org; Thu, 13 Aug 2009 16:12:35 -0400 Received: from mail-fx0-f205.google.com ([209.85.220.205]:35645) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mbgf5-0001jv-JO for grub-devel@gnu.org; Thu, 13 Aug 2009 16:12:35 -0400 Received: by fxm1 with SMTP id 1so792591fxm.31 for ; Thu, 13 Aug 2009 13:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9BAvnP23Nbc1NKAhHIVnYMe3GuJaqfS8ZQuZ7ekyYdU=; b=d98fFZEXsvwaaPT++mK71errUL035s0o0h0uhu2zrpswdB73NBpkB9U9MNvWZLDWGS 3GlDWN5xmJsZg9SKxDMENCQ0T9RBJl4iYT4JxM+ibJgE/Wt94Ok70StIr/s3ZkexPbrJ f2gb0RwDOI7vu3D5FPShXxns1T62QfmvZEheU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=mLRyraonh4K2oPEenYpnMxM/F9969e5BlT1qaHwLlNP4Xp3Xzm8Zx9D6dA16gb5NdP tjlm6EseJ+vkuMk80m4GMepUEuH9hCj+ac2oojOK6haBl9x1JgIB0RUvqrRmgDX8M+Gz ZAILPHr44ITwl3XimzcbdFh5mXoJWRde/tuCs= MIME-Version: 1.0 Received: by 10.204.78.195 with SMTP id m3mr390504bkk.150.1250194354419; Thu, 13 Aug 2009 13:12:34 -0700 (PDT) In-Reply-To: <20090813200014.GB22130@thorin> References: <20090813200014.GB22130@thorin> Date: Thu, 13 Aug 2009 22:12:34 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH 1/2] Split ufs.mod into ufs1.mod and ufs2.mod X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 20:12:42 -0000 > > When you commit this, could you please follow logical order with > ifdef/else/endif? =A0The negation is less intuitive to read. Ok > >> +#ifdef MODE_UFS2 >> + =A0 =A0 =A0grub_uint64_t indir[UFS_BLKSZ (sblock) / sizeof (grub_uint6= 4_t)]; >> +#else >> + =A0 =A0 =A0grub_uint32_t indir[UFS_BLKSZ (sblock) / sizeof (grub_uint3= 2_t)]; >> +#endif > > Can this be made simpler by using typeof() ? =A0(same for the other one b= elow) > I tried using sizeof (indir[0]) but it doesn't work since indir isn't defined at that point. >> - =A0 =A0 =A0return (data->ufs_type =3D=3D UFS1) ? indir[blk] : indir[bl= k << 1]; >> + =A0 =A0 =A0return indir[blk]; > > The blk bitshift was accounted for elsewhere? > By using correct type (grub_uint64_t vs grub_uint32_t) > (Btw I assume you've tested > on both filesystem types). I tested on FreeBSD variants of UFS1 and UFS2. For Sun UFS1 I relied on report by Seth Goldberg >> - =A0 =A0 ? dirent.namelen_bsd : grub_le_to_cpu16 (dirent.namelen); >> +#ifdef MODE_UFS2 >> + =A0 =A0 =A0namelen =3D dirent.namelen_bsd; >> +#else >> + =A0 =A0 =A0namelen =3D grub_le_to_cpu16 (dirent.namelen); >> +#endif > > I wonder if there was a bug here (native endianess assumed for namelen_bs= d?) > It's one byte > -- > Robert Millan > > =A0The DRM opt-in fallacy: "Your data belongs to us. We will decide when = (and > =A0how) you may access your data; but nobody's threatening your freedom: = we > =A0still allow you to remove your data and not access it at all." > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git