fscrypt: introduce fscrypt_encrypt_block_inplace()
authorEric Biggers <ebiggers@google.com>
Mon, 20 May 2019 16:29:43 +0000 (09:29 -0700)
committerEric Biggers <ebiggers@google.com>
Tue, 28 May 2019 17:27:52 +0000 (10:27 -0700)
commit03569f2fb8e734f281379767de674e23c38b0b14
tree13c222b83eaf83f30c2ae175c9f539033bec44a7
parenteeacfdc68a104967162dfcba60f53f6f5b62a334
fscrypt: introduce fscrypt_encrypt_block_inplace()

fscrypt_encrypt_page() behaves very differently depending on whether the
filesystem set FS_CFLG_OWN_PAGES in its fscrypt_operations.  This makes
the function difficult to understand and document.  It also makes it so
that all callers have to provide inode and lblk_num, when fscrypt could
determine these itself for pagecache pages.

Therefore, move the FS_CFLG_OWN_PAGES behavior into a new function
fscrypt_encrypt_block_inplace().

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

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