diff options
author | Eric Biggers <ebiggers@google.com> | 2018-04-30 15:51:47 -0700 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-05-20 16:21:05 -0400 |
commit | 544d08fde258b4da72b6cfbe2d7172c86ce9860d (patch) | |
tree | 56d013a89974bd62e3ca974e090f495808edc64a /fs/crypto/fscrypt_private.h | |
parent | 11b8818ec09d577567f59fc1b32cfa56c756fe89 (diff) | |
download | linux-544d08fde258b4da72b6cfbe2d7172c86ce9860d.tar.bz2 |
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); |