From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: [PATCH 08/20] nfs: enable swap on NFS Date: Tue, 12 Sep 2006 17:25:49 +0200 Message-ID: <20060912144903.885568000@chello.nl> References: <20060912143049.278065000@chello.nl> Cc: Linus Torvalds , Andrew Morton , David Miller , Rik van Riel , Daniel Phillips , Peter Zijlstra , Trond Myklebust Return-path: Received: from amsfep17-int.chello.nl ([213.46.243.15]:14752 "EHLO amsfep20-int.chello.nl") by vger.kernel.org with ESMTP id S1751440AbWILPvD (ORCPT ); Tue, 12 Sep 2006 11:51:03 -0400 To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Disposition: inline; filename=nfs_swapfile.patch Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org 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 presented later in the series. 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, }; /* --