linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfs: add missing CONFIG_MIGRATION for nfs_migrate_page
@ 2016-09-19 12:09 Chao Yu
  2016-09-19 17:38 ` Anna Schumaker
  0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2016-09-19 12:09 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: linux-nfs, linux-kernel, Chao Yu

We'd better to use CONFIG_MIGRATION to cover nfs_migrate_page, otherwise
when CONFIG_MIGRATION is not defined, unused nfs_migrate_page will still
be compiled into kernel.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 fs/nfs/file.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 7d62097..6cfb83e 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -543,7 +543,9 @@ const struct address_space_operations nfs_file_aops = {
 	.invalidatepage = nfs_invalidate_page,
 	.releasepage = nfs_release_page,
 	.direct_IO = nfs_direct_IO,
+#ifdef CONFIG_MIGRATION
 	.migratepage = nfs_migrate_page,
+#endif
 	.launder_page = nfs_launder_page,
 	.is_dirty_writeback = nfs_check_dirty_writeback,
 	.error_remove_page = generic_error_remove_page,
-- 
2.8.2.311.gee88674

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] nfs: add missing CONFIG_MIGRATION for nfs_migrate_page
  2016-09-19 12:09 [PATCH] nfs: add missing CONFIG_MIGRATION for nfs_migrate_page Chao Yu
@ 2016-09-19 17:38 ` Anna Schumaker
  2016-09-20  0:34   ` Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Anna Schumaker @ 2016-09-19 17:38 UTC (permalink / raw)
  To: Chao Yu, trond.myklebust; +Cc: linux-nfs, linux-kernel

Hi Chao,

On 09/19/2016 08:09 AM, Chao Yu wrote:
> We'd better to use CONFIG_MIGRATION to cover nfs_migrate_page, otherwise
> when CONFIG_MIGRATION is not defined, unused nfs_migrate_page will still
> be compiled into kernel.

I don't think that nfs_migrate_page is still compiled into the kernel when CONFIG_MIGRATION=n.  The file fs/nfs/internal.h has:

  #ifdef CONFIG_MIGRATION
  extern int nfs_migrate_page(struct address_space *,
                  struct page *, struct page *, enum migrate_mode);
  #else
  #define nfs_migrate_page NULL
  #endif

So it looks like we're just setting the variable to a NULL pointer in this case.  I'm not opposed to your change, since it better matches how we've done things in other parts of the client, but can you please clean up internal.h while you're at it?

Thanks,
Anna

> 
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> ---
>  fs/nfs/file.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/nfs/file.c b/fs/nfs/file.c
> index 7d62097..6cfb83e 100644
> --- a/fs/nfs/file.c
> +++ b/fs/nfs/file.c
> @@ -543,7 +543,9 @@ const struct address_space_operations nfs_file_aops = {
>  	.invalidatepage = nfs_invalidate_page,
>  	.releasepage = nfs_release_page,
>  	.direct_IO = nfs_direct_IO,
> +#ifdef CONFIG_MIGRATION
>  	.migratepage = nfs_migrate_page,
> +#endif
>  	.launder_page = nfs_launder_page,
>  	.is_dirty_writeback = nfs_check_dirty_writeback,
>  	.error_remove_page = generic_error_remove_page,
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nfs: add missing CONFIG_MIGRATION for nfs_migrate_page
  2016-09-19 17:38 ` Anna Schumaker
@ 2016-09-20  0:34   ` Chao Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2016-09-20  0:34 UTC (permalink / raw)
  To: Anna Schumaker, trond.myklebust; +Cc: linux-nfs, linux-kernel

Hi Anna,

On 2016/9/20 1:38, Anna Schumaker wrote:
> Hi Chao,
> 
> On 09/19/2016 08:09 AM, Chao Yu wrote:
>> We'd better to use CONFIG_MIGRATION to cover nfs_migrate_page, otherwise
>> when CONFIG_MIGRATION is not defined, unused nfs_migrate_page will still
>> be compiled into kernel.
> 
> I don't think that nfs_migrate_page is still compiled into the kernel when CONFIG_MIGRATION=n.  The file fs/nfs/internal.h has:
> 
>   #ifdef CONFIG_MIGRATION
>   extern int nfs_migrate_page(struct address_space *,
>                   struct page *, struct page *, enum migrate_mode);
>   #else
>   #define nfs_migrate_page NULL
>   #endif
> 
> So it looks like we're just setting the variable to a NULL pointer in this case.  

Oh, thank you for correcting me, I think I'm missing that part.

> I'm not opposed to your change, since it better matches how we've done things in other parts of the client, but can you please clean up internal.h while you're at it?

OK, let me change commit log and do more cleanup like you suggested above.

Thanks,

> 
> Thanks,
> Anna
> 
>>
>> Signed-off-by: Chao Yu <yuchao0@huawei.com>
>> ---
>>  fs/nfs/file.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/fs/nfs/file.c b/fs/nfs/file.c
>> index 7d62097..6cfb83e 100644
>> --- a/fs/nfs/file.c
>> +++ b/fs/nfs/file.c
>> @@ -543,7 +543,9 @@ const struct address_space_operations nfs_file_aops = {
>>  	.invalidatepage = nfs_invalidate_page,
>>  	.releasepage = nfs_release_page,
>>  	.direct_IO = nfs_direct_IO,
>> +#ifdef CONFIG_MIGRATION
>>  	.migratepage = nfs_migrate_page,
>> +#endif
>>  	.launder_page = nfs_launder_page,
>>  	.is_dirty_writeback = nfs_check_dirty_writeback,
>>  	.error_remove_page = generic_error_remove_page,
>>
> 
> 
> .
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-20  0:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-19 12:09 [PATCH] nfs: add missing CONFIG_MIGRATION for nfs_migrate_page Chao Yu
2016-09-19 17:38 ` Anna Schumaker
2016-09-20  0:34   ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).