fscrypt: handle blocksize < PAGE_SIZE in fscrypt_zeroout_range()
authorEric Biggers <ebiggers@google.com>
Mon, 20 May 2019 16:29:45 +0000 (09:29 -0700)
committerEric Biggers <ebiggers@google.com>
Tue, 28 May 2019 17:27:53 +0000 (10:27 -0700)
commit930d453995bdf4a0000bd162dfd4b70c6d7329f8
treefcfc6f8c9cb1cbde2fe3c965cdf393d54595f6f2
parent53bc1d854c64c20d967dab15b111baca02a6d99e
fscrypt: handle blocksize < PAGE_SIZE in fscrypt_zeroout_range()

Adjust fscrypt_zeroout_range() to encrypt a block at a time rather than
a page at a time, so that it works when blocksize < PAGE_SIZE.

This isn't optimized for performance, but then again this function
already wasn't optimized for performance.  As a future optimization, we
could submit much larger bios here.

This is in preparation for allowing encryption on ext4 filesystems with
blocksize != PAGE_SIZE.

This is based on work by Chandan Rajendra.

Reviewed-by: Chandan Rajendra <chandan@linux.ibm.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/crypto/bio.c