• Jeff Mahoney's avatar
    btrfs: remove old tree_root dirent processing in btrfs_real_readdir() · c2951f32
    Jeff Mahoney authored
    Commit 3de4586c (Btrfs: Allow subvolumes and snapshots anywhere
    in the directory tree) introduced the current system of placing
    snapshots in the directory tree.  It also introduced the behavior of
    creating the snapshot and then creating the directory entries for it.
    
    We've kept this code around for compatibility reasons, but it turns
    out that no file systems with the old tree_root based snapshots can
    be mounted on newer (>= 2009) kernels anyway.  About a month after the
    above commit, commit 2a7108ad (Btrfs: rev the disk format for the
    inode compat and csum selection changes) landed, changing the superblock
    magic number.
    
    As a result, we know that we'll never encounter tree_root-based dirents
    or have to deal with skipping our own snapshot dirents.  Since that
    also means that we're now only iterating over DIR_INDEX items, which only
    contain one directory entry per leaf item, we don't need to loop over
    the leaf item contents anymore either.
    Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    c2951f32
inode.c 282 KB