From raybry@sgi.com Fri Jul 1 15:40:53 2005 Date: Fri, 1 Jul 2005 15:40:51 -0700 (PDT) From: Ray Bryant To: Hirokazu Takahashi , Dave Hansen , Marcelo Tosatti , Andi Kleen Cc: Christoph Hellwig , linux-mm , Nathan Scott , Ray Bryant , lhms-devel@lists.sourceforge.net, Ray Bryant , Paul Jackson , clameter@sgi.com Subject: [PATCH 2.6.13-rc1 2/11] mm: manual page migration-rc4 -- xfs-migrate-page-rc4.patch Nathan Scott of SGI provided this patch for XFS that supports the migrate_page method in the address_space operations vector. It is basically the same as what is in ext2_migrate_page(). However, the routine "xfs_skip_migrate_page()" is added to disallow migration of xfs metadata. Signed-off-by: Ray Bryant xfs_aops.c | 10 ++++++++++ xfs_buf.c | 7 +++++++ 2 files changed, 17 insertions(+) Index: linux-2.6.13/fs/xfs/linux-2.6/xfs_aops.c =================================================================== --- linux-2.6.13.orig/fs/xfs/linux-2.6/xfs_aops.c 2005-08-28 16:41:01.000000000 -0700 +++ linux-2.6.13/fs/xfs/linux-2.6/xfs_aops.c 2005-08-30 13:17:07.000000000 -0700 @@ -54,6 +54,7 @@ #include "xfs_iomap.h" #include #include +#include STATIC void xfs_count_page_state(struct page *, int *, int *, int *); STATIC void xfs_convert_page(struct inode *, struct page *, xfs_iomap_t *, @@ -1273,6 +1274,14 @@ linvfs_prepare_write( return block_prepare_write(page, from, to, linvfs_get_block); } +STATIC int +linvfs_migrate_page( + struct page *from, + struct page *to) +{ + return generic_migrate_page(from, to, migrate_page_buffer); +} + struct address_space_operations linvfs_aops = { .readpage = linvfs_readpage, .readpages = linvfs_readpages, @@ -1283,4 +1292,5 @@ struct address_space_operations linvfs_a .commit_write = generic_commit_write, .bmap = linvfs_bmap, .direct_IO = linvfs_direct_IO, + .migrate_page = linvfs_migrate_page, }; Index: linux-2.6.13/fs/xfs/linux-2.6/xfs_buf.c =================================================================== --- linux-2.6.13.orig/fs/xfs/linux-2.6/xfs_buf.c 2005-08-28 16:41:01.000000000 -0700 +++ linux-2.6.13/fs/xfs/linux-2.6/xfs_buf.c 2005-08-30 13:17:07.000000000 -0700 @@ -1617,6 +1617,12 @@ xfs_setsize_buftarg( } STATIC int +xfs_skip_migrate_page(struct page *from, struct page *to) +{ + return -EBUSY; +} + +STATIC int xfs_mapping_buftarg( xfs_buftarg_t *btp, struct block_device *bdev) @@ -1626,6 +1632,7 @@ xfs_mapping_buftarg( struct address_space *mapping; static struct address_space_operations mapping_aops = { .sync_page = block_sync_page, + .migrate_page = xfs_skip_migrate_page, }; inode = new_inode(bdev->bd_inode->i_sb);