forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Structural cleanup for filesystem-based swap
Linux primarily uses IO to block devices for swap, but can send the IO requests to a filesystem. This has only ever worked for NFS, and that hasn't worked for a while due to a lack of testing. This seems like a good time for some tidy-up before restoring swap-over-NFS functionality. This patch: - updates the documentation (both copies!) for swap_activate which is woefully out-of-date - introduces a new address_space operation "swap_rw" for swap IO. The code currently used ->readpage for reads and ->direct_IO for writes. The former imposes a limit of one-page-at-a-time, the later means that direct writes and swap writes are encouraged to use the same path. While similar, swap can often be simpler as it can assume that no allocation is needed, and coherence with the page cache is irrelevant. - move the responsibility for setting SWP_FS_OPS to ->swap_activate() and also requires it to always call add_swap_extent(). This makes it much easier to find filesystems that require SWP_FS_OPS. - drops the call to the filesystem for ->set_page_dirty(). These pages do not belong to the filesystem, and it has no interest in the dirty status. writeout is switched to ->swap_rw, but read-in is not as that requires too much change for this patch. Both cifs and nfs set SWP_FS_OPS but neither provide a swap_rw, so both will now fail to activate swap. cifs never really tried to provide swap support as ->direct_IO always returns an error. NFS will be fixed up with following patches. Signed-off-by: NeilBrown <neilb@suse.de>
- Loading branch information
1 parent
68f87ec
commit 6443c9d
Showing
9 changed files
with
56 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters