All of lore.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: linux-btrfs@vger.kernel.org
Cc: kernel-team@fb.com, David Sterba <dsterba@suse.com>
Subject: [PATCH v8 2/6] mm: export add_swap_extent()
Date: Wed, 19 Sep 2018 22:02:13 -0700	[thread overview]
Message-ID: <c1d44e348e4bc5ae7a2bec803d5db33bcfb3f27c.1537419652.git.osandov@fb.com> (raw)
In-Reply-To: <cover.1537419652.git.osandov@fb.com>

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 --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;
 }
+EXPORT_SYMBOL_GPL(add_swap_extent);
 
 /*
  * A `swap extent' is a simple thing which maps a contiguous range of pages
-- 
2.19.0

  parent reply	other threads:[~2018-09-20 10:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20  5:02 [PATCH v8 0/6] Btrfs: implement swap file support Omar Sandoval
2018-09-20  5:02 ` [PATCH v8 1/6] mm: split SWP_FILE into SWP_ACTIVATED and SWP_FS Omar Sandoval
2018-09-20  5:02 ` Omar Sandoval [this message]
2018-09-20  5:02 ` [PATCH v8 3/6] vfs: update swap_{,de}activate documentation Omar Sandoval
2018-09-20  5:02 ` [PATCH v8 4/6] Btrfs: prevent ioctls from interfering with a swap file Omar Sandoval
2018-09-20 17:01   ` David Sterba
2018-09-20  5:02 ` [PATCH v8 5/6] Btrfs: rename get_chunk_map() and make it non-static Omar Sandoval
2018-09-20 17:05   ` David Sterba
2018-09-20  5:02 ` [PATCH v8 6/6] Btrfs: support swap files Omar Sandoval
2018-09-20 17:15   ` David Sterba
2018-09-20 17:22     ` Omar Sandoval
2018-09-21 15:21       ` David Sterba
2018-09-20 17:22 ` [PATCH v8 0/6] Btrfs: implement swap file support David Sterba
2018-09-20 17:41   ` Omar Sandoval
2018-09-21 15:17     ` David Sterba
2018-09-21 18:29       ` Omar Sandoval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c1d44e348e4bc5ae7a2bec803d5db33bcfb3f27c.1537419652.git.osandov@fb.com \
    --to=osandov@osandov.com \
    --cc=dsterba@suse.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.