diff options
author | Eric Biggers <ebiggers@google.com> | 2018-01-05 10:45:02 -0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-01-11 22:06:19 -0500 |
commit | 3b0d8837a79ba7b7cc324d1f2b206c074e9c6182 (patch) | |
tree | c9ed6e1bd6c46f88e38f74d2efebf83705e03932 /include | |
parent | 76e81d6d50481144824237e6843122824b0a55c0 (diff) | |
download | linux-stable-3b0d8837a79ba7b7cc324d1f2b206c074e9c6182.tar.gz linux-stable-3b0d8837a79ba7b7cc324d1f2b206c074e9c6182.tar.bz2 linux-stable-3b0d8837a79ba7b7cc324d1f2b206c074e9c6182.zip |
fscrypt: new helper function - fscrypt_get_symlink()
Filesystems also have duplicate code to support ->get_link() on
encrypted symlinks. Factor it out into a new function
fscrypt_get_symlink(). It takes in the contents of the encrypted
symlink on-disk and provides the target (decrypted or encoded) that
should be returned from ->get_link().
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fscrypt_notsupp.h | 8 | ||||
-rw-r--r-- | include/linux/fscrypt_supp.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/fscrypt_notsupp.h b/include/linux/fscrypt_notsupp.h index 02ec0aa894d8..dd106640c6ea 100644 --- a/include/linux/fscrypt_notsupp.h +++ b/include/linux/fscrypt_notsupp.h @@ -239,4 +239,12 @@ static inline int __fscrypt_encrypt_symlink(struct inode *inode, return -EOPNOTSUPP; } +static inline const char *fscrypt_get_symlink(struct inode *inode, + const void *caddr, + unsigned int max_size, + struct delayed_call *done) +{ + return ERR_PTR(-EOPNOTSUPP); +} + #endif /* _LINUX_FSCRYPT_NOTSUPP_H */ diff --git a/include/linux/fscrypt_supp.h b/include/linux/fscrypt_supp.h index 7e0b67ccd816..dc2babf3f7d3 100644 --- a/include/linux/fscrypt_supp.h +++ b/include/linux/fscrypt_supp.h @@ -211,5 +211,8 @@ extern int __fscrypt_prepare_symlink(struct inode *dir, unsigned int len, extern int __fscrypt_encrypt_symlink(struct inode *inode, const char *target, unsigned int len, struct fscrypt_str *disk_link); +extern const char *fscrypt_get_symlink(struct inode *inode, const void *caddr, + unsigned int max_size, + struct delayed_call *done); #endif /* _LINUX_FSCRYPT_SUPP_H */ |