Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IFFP3-0007yT-E2 for mharc-grub-devel@gnu.org; Sun, 29 Jul 2007 16:30:13 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IFFP1-0007uW-TE for grub-devel@gnu.org; Sun, 29 Jul 2007 16:30:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IFFOz-0007mB-0G for grub-devel@gnu.org; Sun, 29 Jul 2007 16:30:10 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IFFOy-0007m4-US for grub-devel@gnu.org; Sun, 29 Jul 2007 16:30:08 -0400 Received: from smtp-vbr3.xs4all.nl ([194.109.24.23]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IFFOy-0000oV-Ff for grub-devel@gnu.org; Sun, 29 Jul 2007 16:30:08 -0400 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr3.xs4all.nl (8.13.8/8.13.8) with ESMTP id l6TKU4Zo020216 for ; Sun, 29 Jul 2007 22:30:05 +0200 (CEST) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <20070612162639.GA10829@ws3.vdp.com> <87abtohbsg.fsf@xs4all.nl> <20070728164413.GA13941@ws3.vdp.com> Mail-Copies-To: mgerards@xs4all.nl Date: Sun, 29 Jul 2007 22:31:57 +0200 In-Reply-To: <20070728164413.GA13941@ws3.vdp.com> (bean123ch@gmail.com's message of "Sun, 29 Jul 2007 00:44:13 +0800") Message-ID: <874pjnhrya.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: FreeBSD 4.6-4.9 Subject: Re: NTFS file system driver (update 3) 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: Sun, 29 Jul 2007 20:30:12 -0000 Bean writes: > On Sun, Jul 22, 2007 at 02:18:23PM +0200, Marco Gerards wrote: >> Was this patch tested on both 32 and 64 bits machines? And little/big >> endian machines? Perhaps other people can help Bean if he doesn't >> have access to such machines? > > I only test it in 32-bit x86 machines, please report bug if it doesn't work > in other environment. Did someone test this? >> One comment in general is that you do not use fshelp.h. Could you >> please have a quick look at this? This would help to structure the >> code a bit more like the other filesystem implementations and save >> some code and complexity. If it can be used (in a sane way), please >> do :-) > > I've rewritten the directory searching code to use grub_fshelp_find_file. But > I don't use grub_fshelp_read_file to read files, becasue the fshelp > implementation don't work well with ntfs filesystem. > >> What are you caching and how would that work? > > I'm caching the last read cluster, which can be 512 to 4192 long. If the next > read is from the same cluster, no disk access is needed. GRUB already has caching code, see kern/disk.c. So this just can better be removed, to fix deallocation issues, etc. > The buffer is attr->sbuf, it's released in free_attr. > >> Why are you using these hooks? I think they are meant for the users >> of the filesystem, so they can build a blocklist or so and not for the >> filesystems. Are you really sure this is required? > > The hook is used to get the disk layout of a file. But sometimes the driver > needs to read from system structure like mft. So I'm enabling the hook only > when it's reading data blocks. I still don't really get it ;-). You wrote an NTFS implementation which is supposed to know about the disk layout of a file. So why do you need a hook to peek how NTFS works? This sounds a bit circular to me. I am sure there is another and cleaner way to fix this. This solution can not be used inside a filesystem implementation because it might break other code. Can you please look for some other solution? >> In this case the mtf->buf leaks, right? Same for the returns below I >> think when returning 0. > > The memory is released in free_file: > > grub_free(mft->buf); Ok. -- Marco