From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KarQu-00054J-V9 for mharc-grub-devel@gnu.org; Wed, 03 Sep 2008 08:26:01 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KarQs-00052h-DS for grub-devel@gnu.org; Wed, 03 Sep 2008 08:25:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KarQr-00051c-8O for grub-devel@gnu.org; Wed, 03 Sep 2008 08:25:57 -0400 Received: from [199.232.76.173] (port=53067 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KarQr-00051L-0y for grub-devel@gnu.org; Wed, 03 Sep 2008 08:25:57 -0400 Received: from fg-out-1718.google.com ([72.14.220.155]:48626) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KarQr-00037A-Ao for grub-devel@gnu.org; Wed, 03 Sep 2008 08:25:57 -0400 Received: by fg-out-1718.google.com with SMTP id l26so156119fgb.30 for ; Wed, 03 Sep 2008 05:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=8IiYcaLvzGi5x+lHOrCPjTfSEaAmQ7jBhoxQuEnWfq8=; b=CUgExAt8trihKciKAoFdYnZMmVTtdtxdMoqQhqhu2VQFc9Xk1U4nXFzzDP3gm3tsw0 T1DXBg3ceJdbBavKiZrEOF3YZX6/95QtIRlo9rokavF4+IhDd5QnibWin5kIAlYago76 ZmNcUeSZOFdE+IO9x9qvIbtDye0PHR/vxFvxM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=jB56VN3T0L/58a3tGnJKyrSICaJgX/zO/+Mp7Zz9jdXwpWIkh2ETGSPAKLZpFbDOKz 14jwVSJFtgMScfQlGGAK7IonsUU9HH0jmy1G/S7ZNIvYr/vPELeNsbYn5+olK/g0aWL+ dXxndnGJigcDII3xMu7w2d1FFK9EWGrWoq+LQ= Received: by 10.86.65.11 with SMTP id n11mr6587123fga.64.1220444754977; Wed, 03 Sep 2008 05:25:54 -0700 (PDT) Received: from ?192.168.1.15? ( [83.76.170.177]) by mx.google.com with ESMTPS id l19sm8292231fgb.7.2008.09.03.05.25.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Sep 2008 05:25:53 -0700 (PDT) Message-ID: <48BE824F.2040007@gmail.com> Date: Wed, 03 Sep 2008 14:25:51 +0200 From: phcoder User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: The development of GRUB 2 References: <48BE5C14.3000105@gmail.com> <20080903103139.GB29762@thorin> In-Reply-To: <20080903103139.GB29762@thorin> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: [RFC]swapfso and "ioctl" function for filesystems 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, 03 Sep 2008 12:25:58 -0000 Robert Millan wrote: > On Wed, Sep 03, 2008 at 11:42:44AM +0200, phcoder wrote: >> Hello, all. >> For some FS sometimes additional functions are needed. It could be some >> type of control (e.g. in ZFS manage zpools) or preparation for OS >> booting (e.g. in FAT put IO.SYS and MSDOS.SYS at the begining of the >> root directory). While theese functions are quite specific to FS >> sometimes are important to implement. > > What would be the purpose of that? Please describe a use case. > With ZFS or ext3cow: Suppose you made a huge mistake and installed unbootable kernel and have no backup in another file. But ZFS/ext3cow has its own backup. So ZFS/ext3cow driver may provide a call something like static grub_err_t zfs_timeback (int timeref); And anounce it like: add_funcs={ {"timeback", zfs_timeback}, {0, 0} }; Then a module timeback.mod can suply a command like timeback which uses the function supplied by zfs and ext3cow. With FAT: suppose you have let's say DR-DOS and windows on the same partition. Great their boot files have different names so they shouldn't conflict. But in fact they do because both require their boot files (io.sys/msdos.sys or ibmbio.com/ibmdos.com) to be first entries in root directory. So fat module can provide a call like fat_put_rootfile_to_slot (char *filename, int place); Then a module "dosprep.mod" can do something like: put_rootfile_to ("io.sys",0); put_rootfile_to ("msdos.sys",0); >> [...]. So I intend to implement a call "swapfso" (FSO=File System >> Object) at least for fat and ext2. > > Do you mean a filesystem write that swaps two file references? > Exactly. It's easy to implement (just exchange inode numbers and filetype fields in dirent). It's also another usage case for first part of my email. Vladimir 'phcoder' Serbinenko