]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: make fiemap not blow when you have lots of snapshots
authorJosef Bacik <jbacik@fb.com>
Wed, 10 Sep 2014 20:20:45 +0000 (16:20 -0400)
committerChris Mason <clm@fb.com>
Wed, 17 Sep 2014 20:38:24 +0000 (13:38 -0700)
commit097c1021307a4a94d5fb3eb68d4136631215f7cf
tree2659e92649b19df4cd54a65eabd34f961f8d57f8
parentd82eda0edb186a78439bc127d8b589b8e66e5e8d
Btrfs: make fiemap not blow when you have lots of snapshots

We have been iterating all references for each extent we have in a file when we
do fiemap to see if it is shared.  This is fine when you have a few clones or a
few snapshots, but when you have 5k snapshots suddenly fiemap just sits there
and stares at you.  So add btrfs_check_shared which will use the backref walking
code but will short circuit as soon as it finds a root or inode that doesn't
match the one we currently have.  This makes fiemap on my testbox go from
looking at me blankly for a day to spitting out actual output in a reasonable
amount of time.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/backref.c
fs/btrfs/backref.h
fs/btrfs/extent_io.c