Received: from mailman by lists.gnu.org with archive (Exim 4.33) id 1CIPqC-00071B-F5 for mharc-grub-devel@gnu.org; Fri, 15 Oct 2004 07:01:44 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CIPqA-00070c-41 for grub-devel@gnu.org; Fri, 15 Oct 2004 07:01:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CIPq9-00070Q-MM for grub-devel@gnu.org; Fri, 15 Oct 2004 07:01:41 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CIPq9-00070N-IR for grub-devel@gnu.org; Fri, 15 Oct 2004 07:01:41 -0400 Received: from [145.74.66.11] (helo=mail-cn.han.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CIPip-00063G-FG for grub-devel@gnu.org; Fri, 15 Oct 2004 06:54:07 -0400 Received: from localhost (charlie.han.nl [145.74.66.9]) by mail-cn.han.nl (Postfix) with ESMTP id 11AB48F23; Fri, 15 Oct 2004 12:47:06 +0200 (CEST) Received: from mail-cn.han.nl ([145.74.66.11]) by localhost (charlie.han.nl [145.74.66.9]) (amavisd-new, port 10024) with ESMTP id 11305-05; Fri, 15 Oct 2004 12:47:03 +0200 (CEST) Received: from mail1.han.nl (mail1.han.nl [145.74.103.11]) by mail-cn.han.nl (Postfix) with ESMTP id CA1658F19; Fri, 15 Oct 2004 12:47:03 +0200 (CEST) Received: from marco.marco-g.com (mgerards.xs4all.nl [82.92.27.129]) by mail1.han.nl (Postfix) with ESMTP id 01F2BC046; Fri, 15 Oct 2004 12:46:56 +0200 (CEST) Mail-Copies-To: metgerards@student.han.nl To: Johan Rydberg References: <87pt3kj56d.fsf@marco.marco-g.com> <87k6ts98yl.fsf@night.trouble.net> From: Marco Gerards Date: Fri, 15 Oct 2004 10:46:50 +0000 In-Reply-To: <87k6ts98yl.fsf@night.trouble.net> (Johan Rydberg's message of "Fri, 15 Oct 2004 01:27:30 +0200") Message-ID: <87lle81co5.fsf@marco.marco-g.com> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new@vscan-cn.han.nl Cc: The development of GRUB 2 Subject: Re: iso9660 support 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: Fri, 15 Oct 2004 11:01:42 -0000 Johan Rydberg writes: > This might be a stupid request, but could you split the patch into > two? One with iso9660 support, and one with the small fixes. Just > for the sake of making clean change sets. That would simplify, for > example, the process of reversing one of the patches if they turn out > to be buggy and ugly. :) The other parts of the patch are kind of related. It fixes some bugs in the probe of filesystems which result in problems with some iso9660 images I used. Therefore I have included them. > A few comments: > >> +#if 0 >> +/* XXX: This code is used to lookup directories using the path tables. >> + This code is currently disabled, but should be enabled again to >> + speed up the lookup of nested files. */ >> +static grub_err_t >> +grub_iso9660_finddir (struct grub_iso9660_data *data, int parent, >> + const char *name, int *dirid, int *first_sector) >> +{ >> [...] >> +#endif /* 0 */ > > Why include dead code in the patch? If you want to keep it around, > store it on your local disk instead of the repository. > > I know it's easy to include half-done future enhancements. But instead > write a (lengthy) comment on how things could be tuned for performance. > > Though, I don't think that you should remove code that is disabled just > temporary, that used to be "alive." > > Just my 2 cents. I could remove that. Personally I like to keep this around so it is there when people need it. >> + /* The symlink is not stored as a POSIX symlink, translate it. */ >> + while (pos < grub_le_to_cpu32 (entry->len)) >> + { > > Are grub_le_to_cpu32 and friends implemented as macros? If not, break > out the grub_le_to_cpu32 (entry->len) expr into a variable and use > that for comparison. They are. >> +static grub_err_t >> +grub_iso9660_dir (grub_device_t device, const char *path, >> + int (*hook) (const char *filename, int dir)) >> +{ >> + struct grub_iso9660_data *data = 0; >> + struct grub_fshelp_node rootnode; >> + struct grub_fshelp_node *foundnode; >> + >> + auto int NESTED_FUNC_ATTR iterate (const char *filename, >> + enum grub_fshelp_filetype filetype, >> + grub_fshelp_node_t node); >> + >> + int NESTED_FUNC_ATTR iterate (const char *filename, >> + enum grub_fshelp_filetype filetype, >> + grub_fshelp_node_t node) >> + { >> + grub_free (node); >> + > > I do not know what NESTED_FUNC_ATTR do or is good for, but I guess it > is needed for all nested functions. I could of course be wrong. If > I'm right, I think I saw another function (that currently is somewhere > in my kill-ring) without the attribute (lua_read or something.) NESTED_FUNC_ATTR is there to work around a bug in gcc. It is only triggered when 3 or ore arguments are used. Because of that it is used here and not in the other function you mentioned. >> +static grub_ssize_t >> +grub_iso9660_read (grub_file_t file, char *buf, grub_ssize_t len) >> +{ >> + struct grub_iso9660_data *data = >> + (struct grub_iso9660_data *) file->data; >> + >> + /* XXX: The file is stored in as a single extent. */ >> + data->disk->read_hook = file->read_hook; >> + grub_disk_read (data->disk, >> + data->first_sector << GRUB_ISO9660_LOG2_BLKSZ, >> + file->offset, >> + len, buf); >> + data->disk->read_hook = 0; > > I know it's easy to add "XXX" or "FIXME" comments. But try to write a > real comment instead. In this case, why not just remove the "XXX:" I'm used to Hurd hacking and this is the style that is used in the Hurd. Comments like XXX and FIXME are useful because it is the first thing you want to look at in case of problems. This is such case. I am not really convinced yet that it should be removed. Thanks, Marco