From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Jambor Subject: Lazy block allocation and block_prepare_write? Date: Mon, 18 Apr 2005 02:54:31 +0200 Message-ID: <8e70aacf05041717546fdff3f@mail.gmail.com> Reply-To: Martin Jambor Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Return-path: Received: from zproxy.gmail.com ([64.233.162.198]:22535 "EHLO zproxy.gmail.com") by vger.kernel.org with ESMTP id S261374AbVDRAyb convert rfc822-to-8bit (ORCPT ); Sun, 17 Apr 2005 20:54:31 -0400 Received: by zproxy.gmail.com with SMTP id 9so1611529nzo for ; Sun, 17 Apr 2005 17:54:31 -0700 (PDT) To: linux-fsdevel@vger.kernel.org Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi all, I am a member of a group that implements a filesystem that allocates disk blocks to in-memory blocks lazily, that means, the decision is made just before the data are actually sent to disk. Moreover, when cached pages are modified, the data can be (and almost certainly will be) written to a different place to from where it was read. I was wondering, whether we could use the generic function block_prepare_write at all. The function checks every buffer of the page and if it is not mapped, it calls a fs supplied function that is supposed to map the buffer, i.e. assign it a block on the device and set its mapped flag. This is where we would like to give an error if there is not enough free disk space left but we cannot give a specific device block number yet. Can we make one up, such as -1? What would that do to such dark functions as unmap_underlying_metadata or any other? Would some other part of kernel break if there was a bunch of buffers assigned to the same spot on the disk? On the other hand, if I understand buffer flags correctly, I need to be able to emulate mapping of buffers to set them dirty, or em I wrong? Thanks for any insight or thoughts, Martin Jambor