Btrfs: set leave_spinning in btrfs_get_extent
authorLiu Bo <bo.liu@linux.alibaba.com>
Sat, 25 Aug 2018 05:47:09 +0000 (13:47 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:29 +0000 (17:23 +0200)
commite49aabd973fd0b3e8e949bd9e7e05acbb9008244
treea252d214b5e84393e8258286768935cede688be1
parentde2c6615dcddf2af868c5cbd1db2e9e73b4beb58
Btrfs: set leave_spinning in btrfs_get_extent

Unless it's going to read inline extents from btree leaf to page,
btrfs_get_extent won't sleep during the period of holding path lock.

This sets leave_spinning at first and sets path to blocking mode right
before reading inline extent if that's the case.  The benefit is that a
path in spinning mode typically has lower impact (faster) on waiters
rather than that in the blocking mode.

Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c