• Omar Sandoval's avatar
    btrfs: remove dead snapshot-aware defrag code · 313facc5
    Omar Sandoval authored
    Snapshot-aware defrag has been disabled since commit 8101c8db
    ("Btrfs: disable snapshot aware defrag for now") almost 6 years ago.
    Let's remove the dead code. If someone is up to the task of bringing it
    back, they can dig it up from git.
    
    This is logically a revert of commit 38c227d8 ("Btrfs:
    snapshot-aware defrag") except that now we have to clear the
    EXTENT_DEFRAG bit to avoid need_force_cow() returning true forever.
    
    The reasons to disable were caused by runtime problems (like long stalls
    or memory consumption) on heavily referenced extents (eg. thousands of
    snapshots). There were attempts to fix that but never finished.
    
    Current defrag breaks the extent references and some users prefer that
    behaviour over the one implemented by snapshot aware (ie. keeping links
    for defragmentation).  To enable both usecases we'd need to extend
    defrag ioctl but let's do that properly from scratch.
    Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
    Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
    Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    [ enhance ]
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    313facc5
inode.c 284 KB