Thank you very much for your reply.
On Mar 30, 2005 3:55 PM, Nikita Danilov <[EMAIL PROTECTED]> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html