]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: don't allocate file extent tree for non regular files
authorFilipe Manana <fdmanana@suse.com>
Tue, 30 Apr 2024 15:52:27 +0000 (16:52 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 11 Jul 2024 13:33:17 +0000 (15:33 +0200)
commit3d7db6e8bd22e692e0b7073eb7d12c9c1bbaeb2d
tree2eaebdba0550c386daddd4e407a53f8e2f557b3a
parentd9891ae28b0d3d3a188c502d33f04c1fb3ffd950
btrfs: don't allocate file extent tree for non regular files

When not using the NO_HOLES feature we always allocate an io tree for an
inode's file_extent_tree. This is wasteful because that io tree is only
used for regular files, so we allocate more memory than needed for inodes
that represent directories or symlinks for example, or for inodes that
correspond to free space inodes.

So improve on this by allocating the io tree only for inodes of regular
files that are not free space inodes.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file-item.c
fs/btrfs/inode.c