On Wed, Jan 23, 2019 at 10:48:58AM +0200, Amir Goldstein wrote: > Hi, > > In his session about "reflink" in LSF/MM 2016 [1], Darrick Wong brought > up the subject of sharing pages between cloned files and the general vibe > in room was that it could be done. > > In his talk about XFS subvolumes and snapshots [2], Dave Chinner said > that Matthew Willcox was "working on that problem". My solution is to move the DAX hacks into the page cache proper. For a reflinked file, the filesystem would create a canonical address_space to own the pages, and this is what ->mapping and ->index would refer to. Instances of that reflinked file would each have their own address_space, just as they have their own inode. The i_pages array would contain only PFN entries (until the COWs start). I'm currently at LCA; please excuse me for not participating more fully right now.