[pnfs] [PATCH 0/37] pnfs: client layout cache
Benny Halevy
bhalevy at panasas.com
Tue Jan 1 05:47:49 EST 2008
This patchset contains some cleanups and bug fixes to the existing pnfs code.
Mainly support for non page cache I/O was removed since it's not used anywhere
at the moment. Rather than maintaining the dead code we rather add it back only
if/when needed.
The client layout cache stores layout segments in a sorted list hung
from struct pnfs_layout_type.
Allocation and deallocation of this structure was simplified allowing
the layout driver to easily allocate its private data in one chunk
immediately following the generic structure.
Same principle was applied for layout segment allocation.
New accessors help getting the LD private data, as well as "standard" pointers
(e.g. nfs_inode, nfs_server, etc.) derived from pnfs_layout_type (and
pnfs_layout_segment). This allows simplifying the LD API a bit by
passing it only the pnfs_layout_type without the inode.
Layout driver is no longer responsible for maintaining layout segments
and it does not set the nfsi->current_layout to NULL when there's no
more layout information to keep. The pnfs layout cache is doing that
by keeping track of all layout segments and maintaining them in sync
with LAYOUTGETs and LAYOUTRETURNs.
The LD read, write, (and later-on commit) methods now get the
layout segment covering the I/O byte range in the nfs_{read,write}_data
structure and it is freed on exit for synchronous I/O or in the
done function for the asynchronous paths.
To simplify async done processing the layout drivers must always set
the rpc task.tk_status and result fields (count, eof for read, committed for
write) and then call back the pnfs nfs_{read,write}list_complete functions
that will call up the rpc_call_done chain. If the LD I/O function returns
synchronously, it still must set the fields mentioned above.
I also added some basic synchronization and reference counting for allocating
and using layout cache structures. Higher level synchronization between layout
gets, returns, and recalls is still to be done.
Benny
More information about the pNFS
mailing list