• Eric Biggers's avatar
    fscrypt: introduce fscrypt_decrypt_block_inplace() · 41adbcb7
    Eric Biggers authored
    Currently fscrypt_decrypt_page() does one of two logically distinct
    things depending on whether FS_CFLG_OWN_PAGES is set in the filesystem's
    fscrypt_operations: decrypt a pagecache page in-place, or decrypt a
    filesystem block in-place in any page.  Currently these happen to share
    the same implementation, but this conflates the notion of blocks and
    pages.  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_decrypt_block_inplace().  This mirrors
    fscrypt_encrypt_block_inplace().
    
    This is in preparation for allowing encryption on ext4 filesystems with
    blocksize != PAGE_SIZE.
    Reviewed-by: default avatarChandan Rajendra <chandan@linux.ibm.com>
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    41adbcb7
crypto.c 2.35 KB