FS/CACHEFILES: convert printk to pr_foo()
Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
ef74885353
commit
4e1eb88305
@ -228,9 +228,8 @@ static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache)
|
|||||||
set_bit(CACHEFILES_READY, &cache->flags);
|
set_bit(CACHEFILES_READY, &cache->flags);
|
||||||
dput(root);
|
dput(root);
|
||||||
|
|
||||||
printk(KERN_INFO "CacheFiles:"
|
pr_info("CacheFiles: File cache on %s registered\n",
|
||||||
" File cache on %s registered\n",
|
cache->cache.identifier);
|
||||||
cache->cache.identifier);
|
|
||||||
|
|
||||||
/* check how much space the cache has */
|
/* check how much space the cache has */
|
||||||
cachefiles_has_space(cache, 0, 0);
|
cachefiles_has_space(cache, 0, 0);
|
||||||
@ -262,9 +261,8 @@ void cachefiles_daemon_unbind(struct cachefiles_cache *cache)
|
|||||||
_enter("");
|
_enter("");
|
||||||
|
|
||||||
if (test_bit(CACHEFILES_READY, &cache->flags)) {
|
if (test_bit(CACHEFILES_READY, &cache->flags)) {
|
||||||
printk(KERN_INFO "CacheFiles:"
|
pr_info("CacheFiles: File cache on %s unregistering\n",
|
||||||
" File cache on %s unregistering\n",
|
cache->cache.identifier);
|
||||||
cache->cache.identifier);
|
|
||||||
|
|
||||||
fscache_withdraw_cache(&cache->cache);
|
fscache_withdraw_cache(&cache->cache);
|
||||||
}
|
}
|
||||||
|
@ -146,8 +146,7 @@ static int cachefiles_lookup_object(struct fscache_object *_object)
|
|||||||
|
|
||||||
if (ret < 0 && ret != -ETIMEDOUT) {
|
if (ret < 0 && ret != -ETIMEDOUT) {
|
||||||
if (ret != -ENOBUFS)
|
if (ret != -ENOBUFS)
|
||||||
printk(KERN_WARNING
|
pr_warn("CacheFiles: Lookup failed error %d\n", ret);
|
||||||
"CacheFiles: Lookup failed error %d\n", ret);
|
|
||||||
fscache_object_lookup_error(&object->fscache);
|
fscache_object_lookup_error(&object->fscache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ extern int cachefiles_remove_object_xattr(struct cachefiles_cache *cache,
|
|||||||
/*
|
/*
|
||||||
* error handling
|
* error handling
|
||||||
*/
|
*/
|
||||||
#define kerror(FMT, ...) printk(KERN_ERR "CacheFiles: "FMT"\n", ##__VA_ARGS__)
|
#define kerror(FMT, ...) pr_err("CacheFiles: "FMT"\n", ##__VA_ARGS__)
|
||||||
|
|
||||||
#define cachefiles_io_error(___cache, FMT, ...) \
|
#define cachefiles_io_error(___cache, FMT, ...) \
|
||||||
do { \
|
do { \
|
||||||
@ -310,8 +310,8 @@ do { \
|
|||||||
#define ASSERT(X) \
|
#define ASSERT(X) \
|
||||||
do { \
|
do { \
|
||||||
if (unlikely(!(X))) { \
|
if (unlikely(!(X))) { \
|
||||||
printk(KERN_ERR "\n"); \
|
pr_err("\n"); \
|
||||||
printk(KERN_ERR "CacheFiles: Assertion failed\n"); \
|
pr_err("CacheFiles: Assertion failed\n"); \
|
||||||
BUG(); \
|
BUG(); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
@ -319,9 +319,9 @@ do { \
|
|||||||
#define ASSERTCMP(X, OP, Y) \
|
#define ASSERTCMP(X, OP, Y) \
|
||||||
do { \
|
do { \
|
||||||
if (unlikely(!((X) OP (Y)))) { \
|
if (unlikely(!((X) OP (Y)))) { \
|
||||||
printk(KERN_ERR "\n"); \
|
pr_err("\n"); \
|
||||||
printk(KERN_ERR "CacheFiles: Assertion failed\n"); \
|
pr_err("CacheFiles: Assertion failed\n"); \
|
||||||
printk(KERN_ERR "%lx " #OP " %lx is false\n", \
|
pr_err("%lx " #OP " %lx is false\n", \
|
||||||
(unsigned long)(X), (unsigned long)(Y)); \
|
(unsigned long)(X), (unsigned long)(Y)); \
|
||||||
BUG(); \
|
BUG(); \
|
||||||
} \
|
} \
|
||||||
@ -330,8 +330,8 @@ do { \
|
|||||||
#define ASSERTIF(C, X) \
|
#define ASSERTIF(C, X) \
|
||||||
do { \
|
do { \
|
||||||
if (unlikely((C) && !(X))) { \
|
if (unlikely((C) && !(X))) { \
|
||||||
printk(KERN_ERR "\n"); \
|
pr_err("\n"); \
|
||||||
printk(KERN_ERR "CacheFiles: Assertion failed\n"); \
|
pr_err("CacheFiles: Assertion failed\n"); \
|
||||||
BUG(); \
|
BUG(); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
@ -339,9 +339,9 @@ do { \
|
|||||||
#define ASSERTIFCMP(C, X, OP, Y) \
|
#define ASSERTIFCMP(C, X, OP, Y) \
|
||||||
do { \
|
do { \
|
||||||
if (unlikely((C) && !((X) OP (Y)))) { \
|
if (unlikely((C) && !((X) OP (Y)))) { \
|
||||||
printk(KERN_ERR "\n"); \
|
pr_err("\n"); \
|
||||||
printk(KERN_ERR "CacheFiles: Assertion failed\n"); \
|
pr_err("CacheFiles: Assertion failed\n"); \
|
||||||
printk(KERN_ERR "%lx " #OP " %lx is false\n", \
|
pr_err("%lx " #OP " %lx is false\n", \
|
||||||
(unsigned long)(X), (unsigned long)(Y)); \
|
(unsigned long)(X), (unsigned long)(Y)); \
|
||||||
BUG(); \
|
BUG(); \
|
||||||
} \
|
} \
|
||||||
|
@ -68,8 +68,7 @@ static int __init cachefiles_init(void)
|
|||||||
SLAB_HWCACHE_ALIGN,
|
SLAB_HWCACHE_ALIGN,
|
||||||
cachefiles_object_init_once);
|
cachefiles_object_init_once);
|
||||||
if (!cachefiles_object_jar) {
|
if (!cachefiles_object_jar) {
|
||||||
printk(KERN_NOTICE
|
pr_notice("CacheFiles: Failed to allocate an object jar\n");
|
||||||
"CacheFiles: Failed to allocate an object jar\n");
|
|
||||||
goto error_object_jar;
|
goto error_object_jar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +76,7 @@ static int __init cachefiles_init(void)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error_proc;
|
goto error_proc;
|
||||||
|
|
||||||
printk(KERN_INFO "CacheFiles: Loaded\n");
|
pr_info("CacheFiles: Loaded\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_proc:
|
error_proc:
|
||||||
@ -96,7 +95,7 @@ fs_initcall(cachefiles_init);
|
|||||||
*/
|
*/
|
||||||
static void __exit cachefiles_exit(void)
|
static void __exit cachefiles_exit(void)
|
||||||
{
|
{
|
||||||
printk(KERN_INFO "CacheFiles: Unloading\n");
|
pr_info("CacheFiles: Unloading\n");
|
||||||
|
|
||||||
cachefiles_proc_cleanup();
|
cachefiles_proc_cleanup();
|
||||||
kmem_cache_destroy(cachefiles_object_jar);
|
kmem_cache_destroy(cachefiles_object_jar);
|
||||||
|
@ -35,22 +35,21 @@ void __cachefiles_printk_object(struct cachefiles_object *object,
|
|||||||
struct fscache_cookie *cookie;
|
struct fscache_cookie *cookie;
|
||||||
unsigned keylen, loop;
|
unsigned keylen, loop;
|
||||||
|
|
||||||
printk(KERN_ERR "%sobject: OBJ%x\n",
|
pr_err("%sobject: OBJ%x\n", prefix, object->fscache.debug_id);
|
||||||
prefix, object->fscache.debug_id);
|
pr_err("%sobjstate=%s fl=%lx wbusy=%x ev=%lx[%lx]\n",
|
||||||
printk(KERN_ERR "%sobjstate=%s fl=%lx wbusy=%x ev=%lx[%lx]\n",
|
|
||||||
prefix, object->fscache.state->name,
|
prefix, object->fscache.state->name,
|
||||||
object->fscache.flags, work_busy(&object->fscache.work),
|
object->fscache.flags, work_busy(&object->fscache.work),
|
||||||
object->fscache.events, object->fscache.event_mask);
|
object->fscache.events, object->fscache.event_mask);
|
||||||
printk(KERN_ERR "%sops=%u inp=%u exc=%u\n",
|
pr_err("%sops=%u inp=%u exc=%u\n",
|
||||||
prefix, object->fscache.n_ops, object->fscache.n_in_progress,
|
prefix, object->fscache.n_ops, object->fscache.n_in_progress,
|
||||||
object->fscache.n_exclusive);
|
object->fscache.n_exclusive);
|
||||||
printk(KERN_ERR "%sparent=%p\n",
|
pr_err("%sparent=%p\n",
|
||||||
prefix, object->fscache.parent);
|
prefix, object->fscache.parent);
|
||||||
|
|
||||||
spin_lock(&object->fscache.lock);
|
spin_lock(&object->fscache.lock);
|
||||||
cookie = object->fscache.cookie;
|
cookie = object->fscache.cookie;
|
||||||
if (cookie) {
|
if (cookie) {
|
||||||
printk(KERN_ERR "%scookie=%p [pr=%p nd=%p fl=%lx]\n",
|
pr_err("%scookie=%p [pr=%p nd=%p fl=%lx]\n",
|
||||||
prefix,
|
prefix,
|
||||||
object->fscache.cookie,
|
object->fscache.cookie,
|
||||||
object->fscache.cookie->parent,
|
object->fscache.cookie->parent,
|
||||||
@ -62,16 +61,16 @@ void __cachefiles_printk_object(struct cachefiles_object *object,
|
|||||||
else
|
else
|
||||||
keylen = 0;
|
keylen = 0;
|
||||||
} else {
|
} else {
|
||||||
printk(KERN_ERR "%scookie=NULL\n", prefix);
|
pr_err("%scookie=NULL\n", prefix);
|
||||||
keylen = 0;
|
keylen = 0;
|
||||||
}
|
}
|
||||||
spin_unlock(&object->fscache.lock);
|
spin_unlock(&object->fscache.lock);
|
||||||
|
|
||||||
if (keylen) {
|
if (keylen) {
|
||||||
printk(KERN_ERR "%skey=[%u] '", prefix, keylen);
|
pr_err("%skey=[%u] '", prefix, keylen);
|
||||||
for (loop = 0; loop < keylen; loop++)
|
for (loop = 0; loop < keylen; loop++)
|
||||||
printk("%02x", keybuf[loop]);
|
pr_cont("%02x", keybuf[loop]);
|
||||||
printk("'\n");
|
pr_cont("'\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,13 +130,11 @@ found_dentry:
|
|||||||
dentry);
|
dentry);
|
||||||
|
|
||||||
if (fscache_object_is_live(&object->fscache)) {
|
if (fscache_object_is_live(&object->fscache)) {
|
||||||
printk(KERN_ERR "\n");
|
pr_err("\n");
|
||||||
printk(KERN_ERR "CacheFiles: Error:"
|
pr_err("CacheFiles: Error: Can't preemptively bury live object\n");
|
||||||
" Can't preemptively bury live object\n");
|
|
||||||
cachefiles_printk_object(object, NULL);
|
cachefiles_printk_object(object, NULL);
|
||||||
} else if (test_and_set_bit(CACHEFILES_OBJECT_BURIED, &object->flags)) {
|
} else if (test_and_set_bit(CACHEFILES_OBJECT_BURIED, &object->flags)) {
|
||||||
printk(KERN_ERR "CacheFiles: Error:"
|
pr_err("CacheFiles: Error: Object already preemptively buried\n");
|
||||||
" Object already preemptively buried\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
write_unlock(&cache->active_lock);
|
write_unlock(&cache->active_lock);
|
||||||
@ -160,7 +157,7 @@ try_again:
|
|||||||
write_lock(&cache->active_lock);
|
write_lock(&cache->active_lock);
|
||||||
|
|
||||||
if (test_and_set_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags)) {
|
if (test_and_set_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags)) {
|
||||||
printk(KERN_ERR "CacheFiles: Error: Object already active\n");
|
pr_err("CacheFiles: Error: Object already active\n");
|
||||||
cachefiles_printk_object(object, NULL);
|
cachefiles_printk_object(object, NULL);
|
||||||
BUG();
|
BUG();
|
||||||
}
|
}
|
||||||
@ -193,9 +190,8 @@ try_again:
|
|||||||
* need to wait for it to be destroyed */
|
* need to wait for it to be destroyed */
|
||||||
wait_for_old_object:
|
wait_for_old_object:
|
||||||
if (fscache_object_is_live(&object->fscache)) {
|
if (fscache_object_is_live(&object->fscache)) {
|
||||||
printk(KERN_ERR "\n");
|
pr_err("\n");
|
||||||
printk(KERN_ERR "CacheFiles: Error:"
|
pr_err("CacheFiles: Error: Unexpected object collision\n");
|
||||||
" Unexpected object collision\n");
|
|
||||||
cachefiles_printk_object(object, xobject);
|
cachefiles_printk_object(object, xobject);
|
||||||
BUG();
|
BUG();
|
||||||
}
|
}
|
||||||
@ -241,9 +237,8 @@ wait_for_old_object:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (timeout <= 0) {
|
if (timeout <= 0) {
|
||||||
printk(KERN_ERR "\n");
|
pr_err("\n");
|
||||||
printk(KERN_ERR "CacheFiles: Error: Overlong"
|
pr_err("CacheFiles: Error: Overlong wait for old active object to go away\n");
|
||||||
" wait for old active object to go away\n");
|
|
||||||
cachefiles_printk_object(object, xobject);
|
cachefiles_printk_object(object, xobject);
|
||||||
goto requeue;
|
goto requeue;
|
||||||
}
|
}
|
||||||
|
@ -34,9 +34,7 @@ int cachefiles_get_security_ID(struct cachefiles_cache *cache)
|
|||||||
ret = set_security_override_from_ctx(new, cache->secctx);
|
ret = set_security_override_from_ctx(new, cache->secctx);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
put_cred(new);
|
put_cred(new);
|
||||||
printk(KERN_ERR "CacheFiles:"
|
pr_err("CacheFiles: Security denies permission to nominate security context: error %d\n",
|
||||||
" Security denies permission to nominate"
|
|
||||||
" security context: error %d\n",
|
|
||||||
ret);
|
ret);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -59,16 +57,14 @@ static int cachefiles_check_cache_dir(struct cachefiles_cache *cache,
|
|||||||
|
|
||||||
ret = security_inode_mkdir(root->d_inode, root, 0);
|
ret = security_inode_mkdir(root->d_inode, root, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
printk(KERN_ERR "CacheFiles:"
|
pr_err("CacheFiles: Security denies permission to make dirs: error %d",
|
||||||
" Security denies permission to make dirs: error %d",
|
|
||||||
ret);
|
ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = security_inode_create(root->d_inode, root, 0);
|
ret = security_inode_create(root->d_inode, root, 0);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
printk(KERN_ERR "CacheFiles:"
|
pr_err("CacheFiles: Security denies permission to create files: error %d",
|
||||||
" Security denies permission to create files: error %d",
|
|
||||||
ret);
|
ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user