]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: reada: simplify dev->reada_in_flight processing
authorZhao Lei <zhaolei@cn.fujitsu.com>
Tue, 12 Jan 2016 06:58:39 +0000 (14:58 +0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 18 Feb 2016 09:27:23 +0000 (10:27 +0100)
commit3aa5eeb0c645cae66fcffee915981868b261d9cf
tree345c84adb239a05cb0477c618a36617d34efa2d9
parent1951c262643490099671b457fec60766b18aa541
btrfs: reada: simplify dev->reada_in_flight processing

No need to decrease dev->reada_in_flight in __readahead_hook()'s
internal and reada_extent_put().
reada_extent_put() have no chance to decrease dev->reada_in_flight
in free operation, because reada_extent have additional refcnt when
scheduled to a dev.

We can put inc and dec operation for dev->reada_in_flight to one
place instead to make logic simple and safe, and move useless
reada_extent->scheduled_for to a bool flag instead.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/reada.c