I think there are two major components in this porting:
1. Make bufferred lockless io into direct lockless io.
Current 2.0 code supports bufferred lockless io, we should make them into direct io, since:
- Partial write could cause data corrption: a partial write should make page uptodate by read page in prepare_write, since
it's lockless io, the cached page isn't protected by dlm lock, then another client could change other part of this page
just after prior client's prepare_write, when the prior client flush this page, the change made by the 2nd client will
be overwritten by stale data.
- In fact in the bufferred lockless io case, the page never been cached (it can't be cached), so it doesn't make any sense
to copy data between user page and kernel cache, as shown in b18801, the overhead of such copy sometimes is quite heavy.
2. Support unaligned direct io.
To support unaligned direct io in 2.0, I think we'd better build io request based on user pages and file offset directly,
that should be similar to obd_brw api does. In my opinion, direct io doesn't fit those cl_xxx apis very well (they are
designed for bufferred io, the page offset is tightly binding with file offset, I think), and I don't see what's the
benefit of maitaining a raidx tree for those never cached user pages.
Jay, Oleg
Does my propsal sound ok to you? Thanks.
I don't like the idea of adding new users of the obd_brw() APIs. These are pretty much obsolete on both the client and server, and we should be removing them entirely instead of adding new users.