Skip to content

Commit

Permalink
fscrypt: unexport fscrypt_get_encryption_info()
Browse files Browse the repository at this point in the history
Now that fscrypt_get_encryption_info() is only called from files in
fs/crypto/ (due to all key setup now being handled by higher-level
helper functions instead of directly by filesystems), unexport it and
move its declaration to fscrypt_private.h.

Reviewed-by: Andreas Dilger <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Eric Biggers <[email protected]>
  • Loading branch information
ebiggers committed Dec 3, 2020
1 parent de3cdc6 commit 5b421f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions fs/crypto/fscrypt_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@ int fscrypt_derive_dirhash_key(struct fscrypt_info *ci,
void fscrypt_hash_inode_number(struct fscrypt_info *ci,
const struct fscrypt_master_key *mk);

int fscrypt_get_encryption_info(struct inode *inode);

/**
* fscrypt_require_key() - require an inode's encryption key
* @inode: the inode we need the key for
Expand Down
1 change: 0 additions & 1 deletion fs/crypto/keysetup.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@ int fscrypt_get_encryption_info(struct inode *inode)
res = 0;
return res;
}
EXPORT_SYMBOL(fscrypt_get_encryption_info);

/**
* fscrypt_prepare_new_inode() - prepare to create a new inode in a directory
Expand Down
7 changes: 1 addition & 6 deletions include/linux/fscrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct fscrypt_operations {
static inline struct fscrypt_info *fscrypt_get_info(const struct inode *inode)
{
/*
* Pairs with the cmpxchg_release() in fscrypt_get_encryption_info().
* Pairs with the cmpxchg_release() in fscrypt_setup_encryption_info().
* I.e., another task may publish ->i_crypt_info concurrently, executing
* a RELEASE barrier. We need to use smp_load_acquire() here to safely
* ACQUIRE the memory the other task published.
Expand Down Expand Up @@ -200,7 +200,6 @@ int fscrypt_ioctl_remove_key_all_users(struct file *filp, void __user *arg);
int fscrypt_ioctl_get_key_status(struct file *filp, void __user *arg);

/* keysetup.c */
int fscrypt_get_encryption_info(struct inode *inode);
int fscrypt_prepare_new_inode(struct inode *dir, struct inode *inode,
bool *encrypt_ret);
void fscrypt_put_encryption_info(struct inode *inode);
Expand Down Expand Up @@ -408,10 +407,6 @@ static inline int fscrypt_ioctl_get_key_status(struct file *filp,
}

/* keysetup.c */
static inline int fscrypt_get_encryption_info(struct inode *inode)
{
return -EOPNOTSUPP;
}

static inline int fscrypt_prepare_new_inode(struct inode *dir,
struct inode *inode,
Expand Down

0 comments on commit 5b421f0

Please sign in to comment.