From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Jambor Subject: Re: Address space operations questions Date: Thu, 7 Apr 2005 01:52:20 +0200 Message-ID: <8e70aacf05040616527000e864@mail.gmail.com> References: <8e70aacf05032616151c958eed@mail.gmail.com> <8e70aacf05032914306a827923@mail.gmail.com> <16970.44996.53630.886769@gargle.gargle.HOWL> Reply-To: Martin Jambor Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from wproxy.gmail.com ([64.233.184.204]:17058 "EHLO wproxy.gmail.com") by vger.kernel.org with ESMTP id S262358AbVDFXwU (ORCPT ); Wed, 6 Apr 2005 19:52:20 -0400 Received: by wproxy.gmail.com with SMTP id 68so432427wri for ; Wed, 06 Apr 2005 16:52:20 -0700 (PDT) To: Nikita Danilov In-Reply-To: <16970.44996.53630.886769@gargle.gargle.HOWL> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Thank you very much for your reply. On Mar 30, 2005 3:55 PM, Nikita Danilov wrote: > > 1. What is bmap for and what is it supposed to do? > > ->bmap() maps logical block offset within "object" to physical block > number. It is used in few places, notably in the implementation of > FIBMAP ioctl. We are about to start implementing a fs where data can move around the device and so a physical block address is not really useful. I have understood from other postings to this list that reiserfs and ntfs don;t implement this method so I suppose we'll do the same. I'll just find some nice error to return. > > 2. What is the difference between sync_page and writepage? > > ->sync_page() is an awful misnomer. Usually, when page IO operation is > requested by calling ->writepage() or ->readpage(), file-system queues > IO request (e.g., disk-based file system may do this my calling > submit_bio()), but underlying device driver does not proceed with this > IO immediately, because IO scheduling is more efficient when there are > multiple requests in the queue. > > Only when something really wants to wait for IO completion > (wait_on_page_{locked,writeback}() are used to wait for read and write > completion respectively) IO queue is processed. To do this > wait_on_page_bit() calls ->sync_page() (see block_sync_page()---standard > implementation of ->sync_page() for disk-based file systems). OK, so if I understand it well, sync_page does not actually write the page anywhere, it only waits until the device driver finishes all previous requests with that page, right? Does block_sync_page do exactly that? (I would read the source but all it does is that it calls a callback function) BTW, does it wait also for metadata? Or is the semantics of this method really only wait until the device driver releases this page and has nothing to do with data consistency as we know it from syncing files and filesystems? Moreover, if a page is marked dirty but not yet sent to the device to be written, sync_page does actually nothing? Huh, please consider a comment in the definition of the address_space_operations :-) Again, thanks a lot for all your replies, I have learnt an important bit. Martin