]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: remove old tree_root dirent processing in btrfs_real_readdir()
authorJeff Mahoney <jeffm@suse.com>
Mon, 21 Nov 2016 14:59:04 +0000 (15:59 +0100)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 Nov 2016 12:45:19 +0000 (13:45 +0100)
commit2b6cceb9e1cf5d664d3bc5d99ad22236d58fdbe5
tree6db6a4fa2a4b3d2ee75e7fff6e1bb7d29ac77525
parent8ba15df5554d77d0611ed1a8c9eec58f028322c4
btrfs: remove old tree_root dirent processing in btrfs_real_readdir()

Commit 0e646b8d7c9 (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 4cc4bcc1886 (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: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c