Skip to content

Commit

Permalink
mm: export add_swap_extent()
Browse files Browse the repository at this point in the history
Btrfs currently does not support swap files because swap's use of bmap
does not work with copy-on-write and multiple devices.  See 3505439
("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 6748212 ("iomap: add a swapfile activation
function").  Btrfs will do the same in a later patch, so export
add_swap_extent().

Link: http://lkml.kernel.org/r/bb1208575e02829aae51b538709476964f97b1ea.1536704650.git.osandov@fb.com
Signed-off-by: Omar Sandoval <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: David Sterba <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Nikolay Borisov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
osandov authored and torvalds committed Oct 26, 2018
1 parent bc4ae27 commit aa8aa8a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -2354,6 +2354,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;
}
EXPORT_SYMBOL_GPL(add_swap_extent);

/*
* A `swap extent' is a simple thing which maps a contiguous range of pages
Expand Down

0 comments on commit aa8aa8a

Please sign in to comment.