Btrfs: avoid unnecessarily locking inode when clearing a range
authorFilipe Manana <fdmanana@suse.com>
Thu, 27 Jul 2017 18:52:55 +0000 (19:52 +0100)
committerDavid Sterba <dsterba@suse.com>
Fri, 18 Aug 2017 14:36:29 +0000 (16:36 +0200)
commit4a4b964f42fa5a70d0023d2f1d44a2764bd144f4
tree76bdd44a66758499fea197a3403d5551050afe0d
parent938e1c77f8c9d345dab7c44ea5c0515fdad1ee8c
Btrfs: avoid unnecessarily locking inode when clearing a range

If the range being cleared was not marked for defrag and we are not
about to clear the range from the defrag status, we don't need to
lock and unlock the inode.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Chris Mason <clm@fb.com>
Reviewed-by: Wang Shilong <wangshilong1991@gmail.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c