summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-01-05 10:45:02 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-04-08 02:26:47 -0700
commitfd457d2c4e0411e56b82f67a3b22c8c589f77038 (patch)
treeeab6ceec16e3b08f5c90979a3a6d734d1b18aa11 /include/linux
parenta1cdacb7ae0db3e376c3c874df8c8793448ad1e9 (diff)
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/linux')
-rw-r--r--include/linux/fscrypt_notsupp.h7
-rw-r--r--include/linux/fscrypt_supp.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/fscrypt_notsupp.h b/include/linux/fscrypt_notsupp.h
index 875c83672318..1886b255adcb 100644
--- a/include/linux/fscrypt_notsupp.h
+++ b/include/linux/fscrypt_notsupp.h
@@ -238,4 +238,11 @@ static inline int __fscrypt_encrypt_symlink(struct inode *inode,
return -EOPNOTSUPP;
}
+static inline void *fscrypt_get_symlink(struct inode *inode,
+ const void *caddr,
+ unsigned int max_size)
+{
+ return ERR_PTR(-EOPNOTSUPP);
+}
+
#endif /* _LINUX_FSCRYPT_NOTSUPP_H */
diff --git a/include/linux/fscrypt_supp.h b/include/linux/fscrypt_supp.h
index 6ccaad58d2be..92e50820fd4f 100644
--- a/include/linux/fscrypt_supp.h
+++ b/include/linux/fscrypt_supp.h
@@ -210,5 +210,7 @@ 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 void *fscrypt_get_symlink(struct inode *inode, const void *caddr,
+ unsigned int max_size);
#endif /* _LINUX_FSCRYPT_SUPP_H */