Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IFMhL-0001iZ-Hr for mharc-grub-devel@gnu.org; Mon, 30 Jul 2007 00:17:35 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IFMhK-0001fr-3Z for grub-devel@gnu.org; Mon, 30 Jul 2007 00:17:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IFMhJ-0001f9-Kw for grub-devel@gnu.org; Mon, 30 Jul 2007 00:17:33 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IFMhJ-0001eY-FK for grub-devel@gnu.org; Mon, 30 Jul 2007 00:17:33 -0400 Received: from qb-out-0506.google.com ([72.14.204.236]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IFMhJ-0006qU-3O for grub-devel@gnu.org; Mon, 30 Jul 2007 00:17:33 -0400 Received: by qb-out-0506.google.com with SMTP id e6so1359863qbe for ; Sun, 29 Jul 2007 21:17:30 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:from:to:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=AncJri/z/fUqtZJtuCwd6AjRRS5FelBslY2HHYOriGVzNDn9wpM0ojaZ+7fMXgyNsyITysG5V2c0qmHXUXQn6/wtZ6ETc0T/GAQPn4U+TZX+Q+Hxwmtdw9C8rWocxJDdX1hZbPXqJ2zsERNxLrLPCpG1nQB5GLReD9ZI4FgAJaI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=nZXNcXExW0DvF1xIFpLDWF+6f0GC4G/wacYrJ7cHR+Gdqq9oiIGPNbvH0BinnOldPTcDmRdcteBfnO4ulfd/JtHkgBXf+rB5aAPNQKqvOS4YcnxEJ315xcY4MAjf6gDfd1tTHCK177mR5J5HCWK8gq/4/Sx64je/SWinA3Sjo24= Received: by 10.115.93.16 with SMTP id v16mr5161934wal.1185769049997; Sun, 29 Jul 2007 21:17:29 -0700 (PDT) Received: from localhost ( [123.49.169.164]) by mx.google.com with ESMTPS id v35sm3443140wah.2007.07.29.21.17.26 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 Jul 2007 21:17:29 -0700 (PDT) Date: Mon, 30 Jul 2007 12:16:55 +0800 From: Bean To: The development of GRUB 2 Message-ID: <20070730041655.GA2258@ws3.vdp.com> References: <20070612162639.GA10829@ws3.vdp.com> <87abtohbsg.fsf@xs4all.nl> <20070728164413.GA13941@ws3.vdp.com> <874pjnhrya.fsf@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874pjnhrya.fsf@xs4all.nl> User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: Linux 2.6 (newer, 2) 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: Mon, 30 Jul 2007 04:17:34 -0000 On Sun, Jul 29, 2007 at 10:31:57PM +0200, Marco Gerards wrote: > GRUB already has caching code, see kern/disk.c. So this just can > better be removed, to fix deallocation issues, etc. The caching is mainly for decompression. In NTFS, the basic decompression unit is 4096 bytes. If we don't cache the result, we may need to run the decompression routine again. > 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 fact, the hook comes from above. In grub_ntfs_read: mft->read_hook=file->read_hook; In read_data, the hook is enabled: ctx->comp.disk=at->mft->data->disk; ... ctx->comp.disk->read_hook=at->mft->read_hook; ... ctx->comp.disk->read_hook = 0; In read_run_list, the hook is disabled temporarily: save_hook = ctx->comp.disk->read_hook; ctx->comp.disk->read_hook = 0; run = find_attr (ctx->attr, (unsigned char) *ctx->attr->attr_cur); ctx->comp.disk->read_hook = save_hook; I could have used read_hook as a function parameter, but it seems a waste of memory becasue it's accessed deep within the function calls. -- Bean