From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MTetg-00079P-9L for mharc-grub-devel@gnu.org; Wed, 22 Jul 2009 12:42:28 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTete-00077b-IS for grub-devel@gnu.org; Wed, 22 Jul 2009 12:42:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTeta-00074f-TQ for grub-devel@gnu.org; Wed, 22 Jul 2009 12:42:26 -0400 Received: from [199.232.76.173] (port=54214 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTeta-00074W-Jz for grub-devel@gnu.org; Wed, 22 Jul 2009 12:42:22 -0400 Received: from mx2.redhat.com ([66.187.237.31]:59728) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MTeta-0002Bh-2i for grub-devel@gnu.org; Wed, 22 Jul 2009 12:42:22 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6MGgKet019104 for ; Wed, 22 Jul 2009 12:42:21 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6MGgKPQ019394 for ; Wed, 22 Jul 2009 12:42:20 -0400 Received: from zeta.englab.brq.redhat.com (dhcp-lab-198.englab.brq.redhat.com [10.34.33.198]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6MGgJgX010602 for ; Wed, 22 Jul 2009 12:42:19 -0400 Message-ID: <4A67414C.7080009@redhat.com> Date: Wed, 22 Jul 2009 18:41:48 +0200 From: Edward Shishkin User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: grub-0.97/VFS 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: Wed, 22 Jul 2009 16:42:26 -0000 (CC linux-btrfs mailing list) Hello everyone. Grub-0.97 filesystem interface (read_func, dir_func) seems to be poor. Instead of this I would prefer to have something like the following: /* * * .init_root() // set index of root dir * .lookup_begin() // get index by name * .lookup_end() // get inode by index * .read_file() * .read_dir() * .read_symlink() * * so that dir_func in grub_open will look like the * following: */ int path_walk() { ops->init_root(); while (1) { int mode; ops->lookup_end(&mode, ...); switch (type_of_file(mode)) { case SYMLINK_FILE: follow_symlink(read_symlink, ...); ...; continue; case REGULAR_FILE: /* * the end of path walk: * normally we want to exit here */ ...; return 1; case DIRECTORY_FILE: /* * optionally this will * print possibilities */ ops->lookup_begin(mode, read_dir, ...); ...; continue; default: errnum = ERR_BAD_FILETYPE; return 0; } } } Just my 2 cents in the (grub-2?) development process.. Thanks, Edward.