Alternative approach for XIP AIO read/write

Matthew Wilcox willy at linux.intel.com
Tue Nov 12 08:30:02 EST 2013


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.



More information about the Linux-pmfs mailing list