lkml.org 
[lkml]   [2005]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 6/8] Direct Migration V2: Avoid writeback / page_migrate() method
Christoph Lameter writes:
> On Wed, 9 Nov 2005, Nikita Danilov wrote:
>
> > > +#ifdef CONFIG_MIGRATION
> > > +extern int buffer_migrate_page(struct page *, struct page *);
> > > +#else
> > > +#define buffer_migrate_page(a,b) NULL
> > > +#endif
> >
> > Depending on the CONFIG_MIGRATION, the type of buffer_migrate_page(a,b)
> > expansion is either int or void *, which doesn't look right.
>
> But its right. You need to think about buffer_migrate_page as a pointer to
> a function.

buffer_migrate_page is a pointer to function.

buffer_migrate_page(a, b) is a value of type int (or void *).

>
> > Moreover below you have initializations
> >
> > .migrate_page = buffer_migrate_page,
> >
> > that wouldn't compile when CONFIG_MIGRATION is not defined (as macro
> > requires two arguments).
>
> NULL is a void * pointer which should work.

$ cat > macro.c
#define buffer_migrate_page(a,b) NULL

int (*migrate_page) (void *, void *) = buffer_migrate_page;
^D
$ cc macro.c
macro.c:3: error: `buffer_migrate_page' undeclared here (not in a function)

When CONFIG_MIGRATION is not defined, buffer_migrate_page is a macro,
taking _two_ arguments. Name of such macro cannot be used without
argument list.

Nikita.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-09 18:22    [W:0.047 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site