fscrypt: add ->ci_inode to fscrypt_info
authorEric Biggers <ebiggers@google.com>
Mon, 5 Aug 2019 02:35:44 +0000 (19:35 -0700)
committerEric Biggers <ebiggers@google.com>
Tue, 13 Aug 2019 02:05:22 +0000 (19:05 -0700)
commit59dc6a8e1f534cde6f7986f2fd278062e25336c0
treee4baead29dbb2a75c0ba3a14d7c2dd4f4ec40e16
parent3b6df59bc4d242ac5847592de55d1ff327cd4549
fscrypt: add ->ci_inode to fscrypt_info

Add an inode back-pointer to 'struct fscrypt_info', such that
inode->i_crypt_info->ci_inode == inode.

This will be useful for:

1. Evicting the inodes when a fscrypt key is removed, since we'll track
   the inodes using a given key by linking their fscrypt_infos together,
   rather than the inodes directly.  This avoids bloating 'struct inode'
   with a new list_head.

2. Simplifying the per-file key setup, since the inode pointer won't
   have to be passed around everywhere just in case something goes wrong
   and it's needed for fscrypt_warn().

Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/crypto/fscrypt_private.h
fs/crypto/keyinfo.c