• Eric Biggers's avatar
    fscrypt: simplify bounce page handling · d2d0727b
    Eric Biggers authored
    Currently, bounce page handling for writes to encrypted files is
    unnecessarily complicated.  A fscrypt_ctx is allocated along with each
    bounce page, page_private(bounce_page) points to this fscrypt_ctx, and
    fscrypt_ctx::w::control_page points to the original pagecache page.
    
    However, because writes don't use the fscrypt_ctx for anything else,
    there's no reason why page_private(bounce_page) can't just point to the
    original pagecache page directly.
    
    Therefore, this patch makes this change.  In the process, it also cleans
    up the API exposed to filesystems that allows testing whether a page is
    a bounce page, getting the pagecache page from a bounce page, and
    freeing a bounce page.
    Reviewed-by: default avatarChandan Rajendra <chandan@linux.ibm.com>
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    d2d0727b
fscrypt.h 22.2 KB