Skip to content
  • Filipe Manana's avatar
    Btrfs: simplify inline extent handling when doing reflinks · a61e1e0d
    Filipe Manana authored
    We can not reflink parts of an inline extent, we must always reflink the
    whole inline extent. We know that inline extents always start at file
    offset 0 and that can never represent an amount of data larger then the
    filesystem's sector size (both compressed and uncompressed). We also have
    had the constraints that reflink operations must have a start offset that
    is aligned to the sector size and an end offset that is also aligned or
    it ends the inode's i_size, so there's no way for user space to be able
    to do a reflink operation that will refer to only a part of an inline
    extent.
    
    Initially there was a bug in the inlining code that could allow compressed
    inline extents that encoded more than 1 page, but that was fixed in 2008
    by commit 70b99e69
    
     ("Btrfs: Compression corner fixes") since that
    was problematic.
    
    So remove all the extent cloning code that deals with the possibility
    of cloning only partial inline extents.
    
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    a61e1e0d