On Wed, Sep 19, 2018 at 11:28:00AM -0700, Omar Sandoval wrote: > On Wed, Sep 19, 2018 at 02:09:09PM -0400, Johannes Weiner wrote: > > On Tue, Sep 11, 2018 at 03:34:45PM -0700, Omar Sandoval wrote: > > > From: Omar Sandoval <osandov@xxxxxx> > > > > > > Btrfs will need this for swap file support. > > > > > > Signed-off-by: Omar Sandoval <osandov@xxxxxx> > > > > That looks reasonable. After reading the last patch, it's somewhat > > understandable why you cannot simply implemnet ->bmap and use the > > generic activation code. But it would be good to explain the reason(s) > > for why you can't here briefly to justify this patch. > > I'll rewrite it to: > > Btrfs currently does not support swap files because swap's use of bmap > does not work with copy-on-write and multiple devices. See 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 67482129cdab ("iomap: > add a swapfile activation function"). Btrfs will do the same in a later > patch, so export add_swap_extent(). That explains it perfectly. Thanks!