[v9,2/6] mm: export add_swap_extent()
diff mbox series

Message ID 56d08bc182becd35eaa4605c970936caca312cae.1538072009.git.osandov@fb.com
State New
Headers show
  • Btrfs: implement swap file support
Related show

Commit Message

Omar Sandoval Sept. 27, 2018, 6:17 p.m. UTC
From: Omar Sandoval <osandov@fb.com>

Btrfs currently does not support swap files because swap's use of bmap
does not work with copy-on-write and multiple devices. See commit
35054394c4b3 ("Btrfs: stop providing a bmap operation to avoid swapfile
corruptions"). However, the swap code has a mechanism for the filesystem
to manually add swap extents using add_swap_extent() from the
->swap_activate() aop. iomap has done this since commit 67482129cdab
("iomap: add a swapfile activation function"). Btrfs will do the same in
a later patch, so export add_swap_extent().

Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Omar Sandoval <osandov@fb.com>
 mm/swapfile.c | 1 +
 1 file changed, 1 insertion(+)

diff mbox series

diff --git a/mm/swapfile.c b/mm/swapfile.c
index d3f95833d12e..51cb30de17bc 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2365,6 +2365,7 @@  add_swap_extent(struct swap_info_struct *sis, unsigned long start_page,
 	list_add_tail(&new_se->list, &sis->first_swap_extent.list);
 	return 1;
  * A `swap extent' is a simple thing which maps a contiguous range of pages