Skip to content

Commit

Permalink
aio: fix build when migration is disabled
Browse files Browse the repository at this point in the history
When "fs/aio: Add support to aio ring pages migration" was applied, it
broke the build when CONFIG_MIGRATION was disabled.  Wrap the migration
code with a test for CONFIG_MIGRATION to fix this and save a few bytes
when migration is disabled.

Signed-off-by: Benjamin LaHaise <[email protected]>
  • Loading branch information
bcrl committed Jul 17, 2013
1 parent 36bc08c commit 0c45355
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ static int aio_set_page_dirty(struct page *page)
return 0;
}

#if IS_ENABLED(CONFIG_MIGRATION)
static int aio_migratepage(struct address_space *mapping, struct page *new,
struct page *old, enum migrate_mode mode)
{
Expand Down Expand Up @@ -208,10 +209,13 @@ static int aio_migratepage(struct address_space *mapping, struct page *new,

return rc;
}
#endif

static const struct address_space_operations aio_ctx_aops = {
.set_page_dirty = aio_set_page_dirty,
#if IS_ENABLED(CONFIG_MIGRATION)
.migratepage = aio_migratepage,
#endif
};

static int aio_setup_ring(struct kioctx *ctx)
Expand Down

0 comments on commit 0c45355

Please sign in to comment.