From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <20060906133954.264033000@chello.nl> References: <20060906131630.793619000@chello.nl>> Date: Wed, 06 Sep 2006 15:16:38 +0200 From: Peter Zijlstra Subject: [PATCH 08/21] nfs: enable swap on NFS Content-Disposition: inline; filename=nfs_swapfile.patch Sender: owner-linux-mm@kvack.org Return-Path: To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Daniel Phillips , Rik van Riel , David Miller , Andrew Morton , Peter Zijlstra , Trond Myklebust List-ID: Now that NFS can handle swap cache pages, add a swapfile method to allow swapping over NFS. NOTE: this dummy method is obviously not enough to make it safe. A more complete version of the nfs_swapfile() function will be present in the next VM deadlock avoidance patches. Signed-off-by: Peter Zijlstra CC: Trond Myklebust --- fs/nfs/file.c | 6 ++++++ 1 file changed, 6 insertions(+) Index: linux-2.6/fs/nfs/file.c =================================================================== --- linux-2.6.orig/fs/nfs/file.c +++ linux-2.6/fs/nfs/file.c @@ -321,6 +321,11 @@ static int nfs_release_page(struct page return 0; } +static int nfs_swapfile(struct address_space *mapping, int enable) +{ + return 0; +} + const struct address_space_operations nfs_file_aops = { .readpage = nfs_readpage, .readpages = nfs_readpages, @@ -334,6 +339,7 @@ const struct address_space_operations nf #ifdef CONFIG_NFS_DIRECTIO .direct_IO = nfs_direct_IO, #endif + .swapfile = nfs_swapfile, }; /* -- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org