Alternative approach for XIP AIO read/write
Ross Zwisler
ross.zwisler at linux.intel.com
Tue Nov 12 12:30:29 EST 2013
On Tue, 2013-11-12 at 08:30 -0500, Matthew Wilcox wrote:
> Hi Vishal,
>
> I know I signed off on your commit 8f30edd8f92d4148964cd8cd04c385761d105287,
> but I was looking at something else over the weekend, and I think there's a
> better approach than we took there.
>
> The pattern for most filesystems is:
>
> struct file_operations = {
> .read = do_sync_read,
> .write = do_sync_write,
> .aio_read = generic_file_aio_read,
> .aio_write = generic_file_aio_write,
> };
>
> and do_sync_read/write call ->aio_read/write.
>
> For the two XIP filesystems, we have:
>
> struct file_operations = {
> .read = xip_file_read,
> .write = xip_file_write,
> .aio_read = xip_file_aio_read,
> .aio_write = xip_file_aio_write,
> };
>
> and the xip_file_aio_read/write ends up calling ->read/write.
>
> We should invert this to the sense that most filesystem have; change
> xip_file_aio_read/write to be the actual implementation and set
> ->read/write to point to do_sync_read / do_sync_write.
>
>
> FYI, what I was looking at doing was seeing if generic_file_aio_read/write
> could be used for XIP filesystems. It might be possible, but it's a
> larger job than I'm comfortable taking on right now. I want to see where
> we end up with 'struct page' for NV-DIMMs.
Agreed, this seems like a better way to go.
More information about the Linux-pmfs
mailing list