Re: [PATCH v5 02/11] xfs, dax: introduce xfs_dax_aops

2018-03-12 Thread Christoph Hellwig
On Sun, Mar 11, 2018 at 12:16:25PM -0700, Dan Williams wrote:
> I did the rename, and am housing these in fs/dax.c, I assume that's
> what you wanted.

libfs.c would seem ok to, but we're into micro-management land now :)


Re: [PATCH v5 02/11] xfs, dax: introduce xfs_dax_aops

2018-03-12 Thread Christoph Hellwig
On Sun, Mar 11, 2018 at 12:16:25PM -0700, Dan Williams wrote:
> I did the rename, and am housing these in fs/dax.c, I assume that's
> what you wanted.

libfs.c would seem ok to, but we're into micro-management land now :)


Re: [PATCH v5 02/11] xfs, dax: introduce xfs_dax_aops

2018-03-11 Thread Dan Williams
On Sat, Mar 10, 2018 at 9:40 AM, Dan Williams  wrote:
> On Sat, Mar 10, 2018 at 1:46 AM, Christoph Hellwig  wrote:
>>> +int dax_set_page_dirty(struct page *page)
>>> +{
>>> + /*
>>> +  * Unlike __set_page_dirty_no_writeback that handles dirty page
>>> +  * tracking in the page object, dax does all dirty tracking in
>>> +  * the inode address_space in response to mkwrite faults. In the
>>> +  * dax case we only need to worry about potentially dirty CPU
>>> +  * caches, not dirty page cache pages to write back.
>>> +  *
>>> +  * This callback is defined to prevent fallback to
>>> +  * __set_page_dirty_buffers() in set_page_dirty().
>>> +  */
>>> + return 0;
>>> +}
>>
>> Make this a generic noop_set_page_dirty maybe?
>>
>>> +EXPORT_SYMBOL(dax_set_page_dirty);
>>> +
>>> +void dax_invalidatepage(struct page *page, unsigned int offset,
>>> + unsigned int length)
>>> +{
>>> + /*
>>> +  * There is no page cache to invalidate in the dax case, however
>>> +  * we need this callback defined to prevent falling back to
>>> +  * block_invalidatepage() in do_invalidatepage().
>>> +  */
>>> +}
>>
>> Same here.
>
> I guess I'm not sure what you mean. These nops are specific to dax I
> don't think they make sense in another context besides dax.
>

I did the rename, and am housing these in fs/dax.c, I assume that's
what you wanted.


Re: [PATCH v5 02/11] xfs, dax: introduce xfs_dax_aops

2018-03-11 Thread Dan Williams
On Sat, Mar 10, 2018 at 9:40 AM, Dan Williams  wrote:
> On Sat, Mar 10, 2018 at 1:46 AM, Christoph Hellwig  wrote:
>>> +int dax_set_page_dirty(struct page *page)
>>> +{
>>> + /*
>>> +  * Unlike __set_page_dirty_no_writeback that handles dirty page
>>> +  * tracking in the page object, dax does all dirty tracking in
>>> +  * the inode address_space in response to mkwrite faults. In the
>>> +  * dax case we only need to worry about potentially dirty CPU
>>> +  * caches, not dirty page cache pages to write back.
>>> +  *
>>> +  * This callback is defined to prevent fallback to
>>> +  * __set_page_dirty_buffers() in set_page_dirty().
>>> +  */
>>> + return 0;
>>> +}
>>
>> Make this a generic noop_set_page_dirty maybe?
>>
>>> +EXPORT_SYMBOL(dax_set_page_dirty);
>>> +
>>> +void dax_invalidatepage(struct page *page, unsigned int offset,
>>> + unsigned int length)
>>> +{
>>> + /*
>>> +  * There is no page cache to invalidate in the dax case, however
>>> +  * we need this callback defined to prevent falling back to
>>> +  * block_invalidatepage() in do_invalidatepage().
>>> +  */
>>> +}
>>
>> Same here.
>
> I guess I'm not sure what you mean. These nops are specific to dax I
> don't think they make sense in another context besides dax.
>

I did the rename, and am housing these in fs/dax.c, I assume that's
what you wanted.


Re: [PATCH v5 02/11] xfs, dax: introduce xfs_dax_aops

2018-03-10 Thread Dan Williams
On Sat, Mar 10, 2018 at 1:46 AM, Christoph Hellwig  wrote:
>> +int dax_set_page_dirty(struct page *page)
>> +{
>> + /*
>> +  * Unlike __set_page_dirty_no_writeback that handles dirty page
>> +  * tracking in the page object, dax does all dirty tracking in
>> +  * the inode address_space in response to mkwrite faults. In the
>> +  * dax case we only need to worry about potentially dirty CPU
>> +  * caches, not dirty page cache pages to write back.
>> +  *
>> +  * This callback is defined to prevent fallback to
>> +  * __set_page_dirty_buffers() in set_page_dirty().
>> +  */
>> + return 0;
>> +}
>
> Make this a generic noop_set_page_dirty maybe?
>
>> +EXPORT_SYMBOL(dax_set_page_dirty);
>> +
>> +void dax_invalidatepage(struct page *page, unsigned int offset,
>> + unsigned int length)
>> +{
>> + /*
>> +  * There is no page cache to invalidate in the dax case, however
>> +  * we need this callback defined to prevent falling back to
>> +  * block_invalidatepage() in do_invalidatepage().
>> +  */
>> +}
>
> Same here.

I guess I'm not sure what you mean. These nops are specific to dax I
don't think they make sense in another context besides dax.

>
>> +EXPORT_SYMBOL(dax_invalidatepage);
>
> And EXPORT_SYMBOL_GPL for anything dax-related, please.
>
>> +const struct address_space_operations xfs_dax_aops = {
>> + .writepages = xfs_vm_writepages,
>
> Please split out the DAX case from xfs_vm_writepages.

Will do.

> This patch should probably also split into VFS and XFS parts.

Ok.


Re: [PATCH v5 02/11] xfs, dax: introduce xfs_dax_aops

2018-03-10 Thread Dan Williams
On Sat, Mar 10, 2018 at 1:46 AM, Christoph Hellwig  wrote:
>> +int dax_set_page_dirty(struct page *page)
>> +{
>> + /*
>> +  * Unlike __set_page_dirty_no_writeback that handles dirty page
>> +  * tracking in the page object, dax does all dirty tracking in
>> +  * the inode address_space in response to mkwrite faults. In the
>> +  * dax case we only need to worry about potentially dirty CPU
>> +  * caches, not dirty page cache pages to write back.
>> +  *
>> +  * This callback is defined to prevent fallback to
>> +  * __set_page_dirty_buffers() in set_page_dirty().
>> +  */
>> + return 0;
>> +}
>
> Make this a generic noop_set_page_dirty maybe?
>
>> +EXPORT_SYMBOL(dax_set_page_dirty);
>> +
>> +void dax_invalidatepage(struct page *page, unsigned int offset,
>> + unsigned int length)
>> +{
>> + /*
>> +  * There is no page cache to invalidate in the dax case, however
>> +  * we need this callback defined to prevent falling back to
>> +  * block_invalidatepage() in do_invalidatepage().
>> +  */
>> +}
>
> Same here.

I guess I'm not sure what you mean. These nops are specific to dax I
don't think they make sense in another context besides dax.

>
>> +EXPORT_SYMBOL(dax_invalidatepage);
>
> And EXPORT_SYMBOL_GPL for anything dax-related, please.
>
>> +const struct address_space_operations xfs_dax_aops = {
>> + .writepages = xfs_vm_writepages,
>
> Please split out the DAX case from xfs_vm_writepages.

Will do.

> This patch should probably also split into VFS and XFS parts.

Ok.


Re: [PATCH v5 02/11] xfs, dax: introduce xfs_dax_aops

2018-03-10 Thread Christoph Hellwig
> +int dax_set_page_dirty(struct page *page)
> +{
> + /*
> +  * Unlike __set_page_dirty_no_writeback that handles dirty page
> +  * tracking in the page object, dax does all dirty tracking in
> +  * the inode address_space in response to mkwrite faults. In the
> +  * dax case we only need to worry about potentially dirty CPU
> +  * caches, not dirty page cache pages to write back.
> +  *
> +  * This callback is defined to prevent fallback to
> +  * __set_page_dirty_buffers() in set_page_dirty().
> +  */
> + return 0;
> +}

Make this a generic noop_set_page_dirty maybe?

> +EXPORT_SYMBOL(dax_set_page_dirty);
> +
> +void dax_invalidatepage(struct page *page, unsigned int offset,
> + unsigned int length)
> +{
> + /*
> +  * There is no page cache to invalidate in the dax case, however
> +  * we need this callback defined to prevent falling back to
> +  * block_invalidatepage() in do_invalidatepage().
> +  */
> +}

Same here.

> +EXPORT_SYMBOL(dax_invalidatepage);

And EXPORT_SYMBOL_GPL for anything dax-related, please.

> +const struct address_space_operations xfs_dax_aops = {
> + .writepages = xfs_vm_writepages,

Please split out the DAX case from xfs_vm_writepages.

This patch should probably also split into VFS and XFS parts.


Re: [PATCH v5 02/11] xfs, dax: introduce xfs_dax_aops

2018-03-10 Thread Christoph Hellwig
> +int dax_set_page_dirty(struct page *page)
> +{
> + /*
> +  * Unlike __set_page_dirty_no_writeback that handles dirty page
> +  * tracking in the page object, dax does all dirty tracking in
> +  * the inode address_space in response to mkwrite faults. In the
> +  * dax case we only need to worry about potentially dirty CPU
> +  * caches, not dirty page cache pages to write back.
> +  *
> +  * This callback is defined to prevent fallback to
> +  * __set_page_dirty_buffers() in set_page_dirty().
> +  */
> + return 0;
> +}

Make this a generic noop_set_page_dirty maybe?

> +EXPORT_SYMBOL(dax_set_page_dirty);
> +
> +void dax_invalidatepage(struct page *page, unsigned int offset,
> + unsigned int length)
> +{
> + /*
> +  * There is no page cache to invalidate in the dax case, however
> +  * we need this callback defined to prevent falling back to
> +  * block_invalidatepage() in do_invalidatepage().
> +  */
> +}

Same here.

> +EXPORT_SYMBOL(dax_invalidatepage);

And EXPORT_SYMBOL_GPL for anything dax-related, please.

> +const struct address_space_operations xfs_dax_aops = {
> + .writepages = xfs_vm_writepages,

Please split out the DAX case from xfs_vm_writepages.

This patch should probably also split into VFS and XFS parts.