]> git.baikalelectronics.ru Git - kernel.git/commit
fscrypt: optimize fscrypt_zeroout_range()
authorEric Biggers <ebiggers@google.com>
Thu, 26 Dec 2019 16:08:13 +0000 (10:08 -0600)
committerEric Biggers <ebiggers@google.com>
Tue, 14 Jan 2020 20:50:33 +0000 (12:50 -0800)
commitf63fa5837c3ae9b8428f30e2e54d1e3fa069282b
tree5cd471266ee65359183864ef406dca159adde4c5
parente95755d1e7773471e5e509cb76cf35622257c40f
fscrypt: optimize fscrypt_zeroout_range()

Currently fscrypt_zeroout_range() issues and waits on a bio for each
block it writes, which makes it very slow.

Optimize it to write up to 16 pages at a time instead.

Also add a function comment, and improve reliability by allowing the
allocations of the bio and the first ciphertext page to wait on the
corresponding mempools.

Link: https://lore.kernel.org/r/20191226160813.53182-1-ebiggers@kernel.org
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/crypto/bio.c