]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: reada: limit max works count
authorZhao Lei <zhaolei@cn.fujitsu.com>
Thu, 7 Jan 2016 10:38:48 +0000 (18:38 +0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 18 Feb 2016 09:27:23 +0000 (10:27 +0100)
commit77ac963b73bdbdd2a974261d57dec2782b29080a
tree6f5c406bc2dc0ba63c36f3fb19e2462c9f42739c
parent9f359eb537de26fc9f780504251de9a8d076ee2b
btrfs: reada: limit max works count

Reada creates 2 works for each level of tree recursively.

In case of a tree having many levels, the number of created works
is 2^level_of_tree.
Actually we don't need so many works in parallel, this patch limits
max works to BTRFS_MAX_MIRRORS * 2.

The per-fs works_counter will be also used for btrfs_reada_wait() to
check is there are background workers.

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