Since I noticed some postings referring to the topic of stackable
filesystems surfacing of late, let me take this
chance to bring up a problem that has been on my mind for a while. I hope
I'm not repeating a question that has
already been discussed/answered here. (I've only subscribed to this list
recently. I did attempt a search of
the archives, but didn't come across anything on this yet.)
Put very simply, the question is whether readpage/writepage completion
routines could be included as part of
the inode/address space operations.
The need for these arises in the case of async i/o for reading/writing
pages, where the filesystem (or in the case
I am considering, a filter filesystem stacked over it) needs to perform
some filesystem specific
post-processing on completion of the i/o. Doing a wait_on_page() inside
a_ops->readpage() may not
be appropriate, since it would force the operation to become synchronous.
Think of what happens if the
a_ops->readpage() is invoked during a read ahead , for example.
Ion, did you consider this during your implementation of cryptfs ? There
you need to decrypt the contents of
the page loaded in by the underlying filesystem after the page read i/o
is completed. The underlying
readpage() could return after initiating the i/o without waiting for it to
complete, so currently you probably
just wait for the page lock to be released on i/o completion before
starting the decryption.
But in a read-ahead or async read situation, won't it be preferable to
rather have an inode op (address space
op, rather) that gets called when the read-in actually completes, so that
the caller of readpage() doesn't have to
be blocked till the i/o completes ? This a_op should be called before
releasing the page lock (since we
don't want anyone to start using the page until this last stage of page
load is completed, so to say).
[Yes, I know that there are more complications in using this in a stacked
filesystem implementation - like how
to get the cryptfs readpage completion operation called on completion
of the underlying inode's readpage,
but I guess it should be possible to work that out]
There are further points to think about on how these ops if present should
get invoked (e.g. in the typical
block device async i/o end case, and then in a network filesystem case),
but just to assess the need first of
all, is there any other neat way in which we can achieve the same effect
without introducing these ops ?
Could I have overlooked something ?
[To work properly in a layered filesystem implementation, the stacked
layers should not need to know anything
about each other - just following the VFS interface semantics must
suffice ]
Regards
Suparna
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]