diff options
author | Eric Biggers <ebiggers@google.com> | 2018-05-01 00:51:47 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-05-20 22:21:05 +0200 |
commit | 544d08fde258b4da72b6cfbe2d7172c86ce9860d (patch) | |
tree | 56d013a89974bd62e3ca974e090f495808edc64a /fs/crypto/fscrypt_private.h | |
parent | fscrypt: remove internal key size constants (diff) | |
download | linux-544d08fde258b4da72b6cfbe2d7172c86ce9860d.tar.xz linux-544d08fde258b4da72b6cfbe2d7172c86ce9860d.zip |
fscrypt: use a common logging function
Use a common function for fscrypt warning and error messages so that all
the messages are consistently ratelimited, include the "fscrypt:"
prefix, and include the filesystem name if applicable.
Also fix up a few of the log messages to be more descriptive.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/crypto/fscrypt_private.h')
-rw-r--r-- | fs/crypto/fscrypt_private.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/crypto/fscrypt_private.h b/fs/crypto/fscrypt_private.h index 8358610d6558..09d6c72635b6 100644 --- a/fs/crypto/fscrypt_private.h +++ b/fs/crypto/fscrypt_private.h @@ -100,6 +100,14 @@ extern struct page *fscrypt_alloc_bounce_page(struct fscrypt_ctx *ctx, gfp_t gfp_flags); extern const struct dentry_operations fscrypt_d_ops; +extern void __printf(3, 4) __cold +fscrypt_msg(struct super_block *sb, const char *level, const char *fmt, ...); + +#define fscrypt_warn(sb, fmt, ...) \ + fscrypt_msg(sb, KERN_WARNING, fmt, ##__VA_ARGS__) +#define fscrypt_err(sb, fmt, ...) \ + fscrypt_msg(sb, KERN_ERR, fmt, ##__VA_ARGS__) + /* fname.c */ extern int fname_encrypt(struct inode *inode, const struct qstr *iname, u8 *out, unsigned int olen); |