diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-06-06 17:37:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-06 19:08:14 -0400 |
commit | 4e1eb88305135248ad0e927449e457df95d8d9b3 (patch) | |
tree | 5751bb25a6bec21e9863d8f554cb2ae55e99160c /fs/cachefiles | |
parent | ef74885353e0ee4d884604148628df3369c76719 (diff) |
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>
Diffstat (limited to 'fs/cachefiles')
-rw-r--r-- | fs/cachefiles/bind.c | 10 | ||||
-rw-r--r-- | fs/cachefiles/interface.c | 3 | ||||
-rw-r--r-- | fs/cachefiles/internal.h | 22 | ||||
-rw-r--r-- | fs/cachefiles/main.c | 7 | ||||
-rw-r--r-- | fs/cachefiles/namei.c | 39 | ||||
-rw-r--r-- | fs/cachefiles/security.c | 10 |
6 files changed, 39 insertions, 52 deletions
diff --git a/fs/cachefiles/bind.c b/fs/cachefiles/bind.c index 5b99bafc31d1..c7f3dd2b79dd 100644 --- a/fs/cachefiles/bind.c +++ b/fs/cachefiles/bind.c | |||
@@ -228,9 +228,8 @@ static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache) | |||
228 | set_bit(CACHEFILES_READY, &cache->flags); | 228 | set_bit(CACHEFILES_READY, &cache->flags); |
229 | dput(root); | 229 | dput(root); |
230 | 230 | ||
231 | printk(KERN_INFO "CacheFiles:" | 231 | pr_info("CacheFiles: File cache on %s registered\n", |
232 | " File cache on %s registered\n", | 232 | cache->cache.identifier); |
233 | cache->cache.identifier); | ||
234 | 233 | ||
235 | /* check how much space the cache has */ | 234 | /* check how much space the cache has */ |
236 | cachefiles_has_space(cache, 0, 0); | 235 | cachefiles_has_space(cache, 0, 0); |
@@ -262,9 +261,8 @@ void cachefiles_daemon_unbind(struct cachefiles_cache *cache) | |||
262 | _enter(""); | 261 | _enter(""); |
263 | 262 | ||
264 | if (test_bit(CACHEFILES_READY, &cache->flags)) { | 263 | if (test_bit(CACHEFILES_READY, &cache->flags)) { |
265 | printk(KERN_INFO "CacheFiles:" | 264 | pr_info("CacheFiles: File cache on %s unregistering\n", |
266 | " File cache on %s unregistering\n", | 265 | cache->cache.identifier); |
267 | cache->cache.identifier); | ||
268 | 266 | ||
269 | fscache_withdraw_cache(&cache->cache); | 267 | fscache_withdraw_cache(&cache->cache); |
270 | } | 268 | } |
diff --git a/fs/cachefiles/interface.c b/fs/cachefiles/interface.c index 57e17fe6121a..e47a8d87852f 100644 --- a/fs/cachefiles/interface.c +++ b/fs/cachefiles/interface.c | |||
@@ -146,8 +146,7 @@ static int cachefiles_lookup_object(struct fscache_object *_object) | |||
146 | 146 | ||
147 | if (ret < 0 && ret != -ETIMEDOUT) { | 147 | if (ret < 0 && ret != -ETIMEDOUT) { |
148 | if (ret != -ENOBUFS) | 148 | if (ret != -ENOBUFS) |
149 | printk(KERN_WARNING | 149 | pr_warn("CacheFiles: Lookup failed error %d\n", ret); |
150 | "CacheFiles: Lookup failed error %d\n", ret); | ||
151 | fscache_object_lookup_error(&object->fscache); | 150 | fscache_object_lookup_error(&object->fscache); |
152 | } | 151 | } |
153 | 152 | ||
diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h index 5349473df1b1..5c7ec647e44c 100644 --- a/fs/cachefiles/internal.h +++ b/fs/cachefiles/internal.h | |||
@@ -245,7 +245,7 @@ extern int cachefiles_remove_object_xattr(struct cachefiles_cache *cache, | |||
245 | /* | 245 | /* |
246 | * error handling | 246 | * error handling |
247 | */ | 247 | */ |
248 | #define kerror(FMT, ...) printk(KERN_ERR "CacheFiles: "FMT"\n", ##__VA_ARGS__) | 248 | #define kerror(FMT, ...) pr_err("CacheFiles: "FMT"\n", ##__VA_ARGS__) |
249 | 249 | ||
250 | #define cachefiles_io_error(___cache, FMT, ...) \ | 250 | #define cachefiles_io_error(___cache, FMT, ...) \ |
251 | do { \ | 251 | do { \ |
@@ -310,8 +310,8 @@ do { \ | |||
310 | #define ASSERT(X) \ | 310 | #define ASSERT(X) \ |
311 | do { \ | 311 | do { \ |
312 | if (unlikely(!(X))) { \ | 312 | if (unlikely(!(X))) { \ |
313 | printk(KERN_ERR "\n"); \ | 313 | pr_err("\n"); \ |
314 | printk(KERN_ERR "CacheFiles: Assertion failed\n"); \ | 314 | pr_err("CacheFiles: Assertion failed\n"); \ |
315 | BUG(); \ | 315 | BUG(); \ |
316 | } \ | 316 | } \ |
317 | } while (0) | 317 | } while (0) |
@@ -319,9 +319,9 @@ do { \ | |||
319 | #define ASSERTCMP(X, OP, Y) \ | 319 | #define ASSERTCMP(X, OP, Y) \ |
320 | do { \ | 320 | do { \ |
321 | if (unlikely(!((X) OP (Y)))) { \ | 321 | if (unlikely(!((X) OP (Y)))) { \ |
322 | printk(KERN_ERR "\n"); \ | 322 | pr_err("\n"); \ |
323 | printk(KERN_ERR "CacheFiles: Assertion failed\n"); \ | 323 | pr_err("CacheFiles: Assertion failed\n"); \ |
324 | printk(KERN_ERR "%lx " #OP " %lx is false\n", \ | 324 | pr_err("%lx " #OP " %lx is false\n", \ |
325 | (unsigned long)(X), (unsigned long)(Y)); \ | 325 | (unsigned long)(X), (unsigned long)(Y)); \ |
326 | BUG(); \ | 326 | BUG(); \ |
327 | } \ | 327 | } \ |
@@ -330,8 +330,8 @@ do { \ | |||
330 | #define ASSERTIF(C, X) \ | 330 | #define ASSERTIF(C, X) \ |
331 | do { \ | 331 | do { \ |
332 | if (unlikely((C) && !(X))) { \ | 332 | if (unlikely((C) && !(X))) { \ |
333 | printk(KERN_ERR "\n"); \ | 333 | pr_err("\n"); \ |
334 | printk(KERN_ERR "CacheFiles: Assertion failed\n"); \ | 334 | pr_err("CacheFiles: Assertion failed\n"); \ |
335 | BUG(); \ | 335 | BUG(); \ |
336 | } \ | 336 | } \ |
337 | } while (0) | 337 | } while (0) |
@@ -339,9 +339,9 @@ do { \ | |||
339 | #define ASSERTIFCMP(C, X, OP, Y) \ | 339 | #define ASSERTIFCMP(C, X, OP, Y) \ |
340 | do { \ | 340 | do { \ |
341 | if (unlikely((C) && !((X) OP (Y)))) { \ | 341 | if (unlikely((C) && !((X) OP (Y)))) { \ |
342 | printk(KERN_ERR "\n"); \ | 342 | pr_err("\n"); \ |
343 | printk(KERN_ERR "CacheFiles: Assertion failed\n"); \ | 343 | pr_err("CacheFiles: Assertion failed\n"); \ |
344 | printk(KERN_ERR "%lx " #OP " %lx is false\n", \ | 344 | pr_err("%lx " #OP " %lx is false\n", \ |
345 | (unsigned long)(X), (unsigned long)(Y)); \ | 345 | (unsigned long)(X), (unsigned long)(Y)); \ |
346 | BUG(); \ | 346 | BUG(); \ |
347 | } \ | 347 | } \ |
diff --git a/fs/cachefiles/main.c b/fs/cachefiles/main.c index 4bfa8cf43bf5..d45c59c147ce 100644 --- a/fs/cachefiles/main.c +++ b/fs/cachefiles/main.c | |||
@@ -68,8 +68,7 @@ static int __init cachefiles_init(void) | |||
68 | SLAB_HWCACHE_ALIGN, | 68 | SLAB_HWCACHE_ALIGN, |
69 | cachefiles_object_init_once); | 69 | cachefiles_object_init_once); |
70 | if (!cachefiles_object_jar) { | 70 | if (!cachefiles_object_jar) { |
71 | printk(KERN_NOTICE | 71 | pr_notice("CacheFiles: Failed to allocate an object jar\n"); |
72 | "CacheFiles: Failed to allocate an object jar\n"); | ||
73 | goto error_object_jar; | 72 | goto error_object_jar; |
74 | } | 73 | } |
75 | 74 | ||
@@ -77,7 +76,7 @@ static int __init cachefiles_init(void) | |||
77 | if (ret < 0) | 76 | if (ret < 0) |
78 | goto error_proc; | 77 | goto error_proc; |
79 | 78 | ||
80 | printk(KERN_INFO "CacheFiles: Loaded\n"); | 79 | pr_info("CacheFiles: Loaded\n"); |
81 | return 0; | 80 | return 0; |
82 | 81 | ||
83 | error_proc: | 82 | error_proc: |
@@ -96,7 +95,7 @@ fs_initcall(cachefiles_init); | |||
96 | */ | 95 | */ |
97 | static void __exit cachefiles_exit(void) | 96 | static void __exit cachefiles_exit(void) |
98 | { | 97 | { |
99 | printk(KERN_INFO "CacheFiles: Unloading\n"); | 98 | pr_info("CacheFiles: Unloading\n"); |
100 | 99 | ||
101 | cachefiles_proc_cleanup(); | 100 | cachefiles_proc_cleanup(); |
102 | kmem_cache_destroy(cachefiles_object_jar); | 101 | kmem_cache_destroy(cachefiles_object_jar); |
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index c0a681705104..18e0d8ee3542 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c | |||
@@ -35,22 +35,21 @@ void __cachefiles_printk_object(struct cachefiles_object *object, | |||
35 | struct fscache_cookie *cookie; | 35 | struct fscache_cookie *cookie; |
36 | unsigned keylen, loop; | 36 | unsigned keylen, loop; |
37 | 37 | ||
38 | printk(KERN_ERR "%sobject: OBJ%x\n", | 38 | pr_err("%sobject: OBJ%x\n", prefix, object->fscache.debug_id); |
39 | prefix, object->fscache.debug_id); | 39 | pr_err("%sobjstate=%s fl=%lx wbusy=%x ev=%lx[%lx]\n", |
40 | printk(KERN_ERR "%sobjstate=%s fl=%lx wbusy=%x ev=%lx[%lx]\n", | ||
41 | prefix, object->fscache.state->name, | 40 | prefix, object->fscache.state->name, |
42 | object->fscache.flags, work_busy(&object->fscache.work), | 41 | object->fscache.flags, work_busy(&object->fscache.work), |
43 | object->fscache.events, object->fscache.event_mask); | 42 | object->fscache.events, object->fscache.event_mask); |
44 | printk(KERN_ERR "%sops=%u inp=%u exc=%u\n", | 43 | pr_err("%sops=%u inp=%u exc=%u\n", |
45 | prefix, object->fscache.n_ops, object->fscache.n_in_progress, | 44 | prefix, object->fscache.n_ops, object->fscache.n_in_progress, |
46 | object->fscache.n_exclusive); | 45 | object->fscache.n_exclusive); |
47 | printk(KERN_ERR "%sparent=%p\n", | 46 | pr_err("%sparent=%p\n", |
48 | prefix, object->fscache.parent); | 47 | prefix, object->fscache.parent); |
49 | 48 | ||
50 | spin_lock(&object->fscache.lock); | 49 | spin_lock(&object->fscache.lock); |
51 | cookie = object->fscache.cookie; | 50 | cookie = object->fscache.cookie; |
52 | if (cookie) { | 51 | if (cookie) { |
53 | printk(KERN_ERR "%scookie=%p [pr=%p nd=%p fl=%lx]\n", | 52 | pr_err("%scookie=%p [pr=%p nd=%p fl=%lx]\n", |
54 | prefix, | 53 | prefix, |
55 | object->fscache.cookie, | 54 | object->fscache.cookie, |
56 | object->fscache.cookie->parent, | 55 | object->fscache.cookie->parent, |
@@ -62,16 +61,16 @@ void __cachefiles_printk_object(struct cachefiles_object *object, | |||
62 | else | 61 | else |
63 | keylen = 0; | 62 | keylen = 0; |
64 | } else { | 63 | } else { |
65 | printk(KERN_ERR "%scookie=NULL\n", prefix); | 64 | pr_err("%scookie=NULL\n", prefix); |
66 | keylen = 0; | 65 | keylen = 0; |
67 | } | 66 | } |
68 | spin_unlock(&object->fscache.lock); | 67 | spin_unlock(&object->fscache.lock); |
69 | 68 | ||
70 | if (keylen) { | 69 | if (keylen) { |
71 | printk(KERN_ERR "%skey=[%u] '", prefix, keylen); | 70 | pr_err("%skey=[%u] '", prefix, keylen); |
72 | for (loop = 0; loop < keylen; loop++) | 71 | for (loop = 0; loop < keylen; loop++) |
73 | printk("%02x", keybuf[loop]); | 72 | pr_cont("%02x", keybuf[loop]); |
74 | printk("'\n"); | 73 | pr_cont("'\n"); |
75 | } | 74 | } |
76 | } | 75 | } |
77 | 76 | ||
@@ -131,13 +130,11 @@ found_dentry: | |||
131 | dentry); | 130 | dentry); |
132 | 131 | ||
133 | if (fscache_object_is_live(&object->fscache)) { | 132 | if (fscache_object_is_live(&object->fscache)) { |
134 | printk(KERN_ERR "\n"); | 133 | pr_err("\n"); |
135 | printk(KERN_ERR "CacheFiles: Error:" | 134 | pr_err("CacheFiles: Error: Can't preemptively bury live object\n"); |
136 | " Can't preemptively bury live object\n"); | ||
137 | cachefiles_printk_object(object, NULL); | 135 | cachefiles_printk_object(object, NULL); |
138 | } else if (test_and_set_bit(CACHEFILES_OBJECT_BURIED, &object->flags)) { | 136 | } else if (test_and_set_bit(CACHEFILES_OBJECT_BURIED, &object->flags)) { |
139 | printk(KERN_ERR "CacheFiles: Error:" | 137 | pr_err("CacheFiles: Error: Object already preemptively buried\n"); |
140 | " Object already preemptively buried\n"); | ||
141 | } | 138 | } |
142 | 139 | ||
143 | write_unlock(&cache->active_lock); | 140 | write_unlock(&cache->active_lock); |
@@ -160,7 +157,7 @@ try_again: | |||
160 | write_lock(&cache->active_lock); | 157 | write_lock(&cache->active_lock); |
161 | 158 | ||
162 | if (test_and_set_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags)) { | 159 | if (test_and_set_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags)) { |
163 | printk(KERN_ERR "CacheFiles: Error: Object already active\n"); | 160 | pr_err("CacheFiles: Error: Object already active\n"); |
164 | cachefiles_printk_object(object, NULL); | 161 | cachefiles_printk_object(object, NULL); |
165 | BUG(); | 162 | BUG(); |
166 | } | 163 | } |
@@ -193,9 +190,8 @@ try_again: | |||
193 | * need to wait for it to be destroyed */ | 190 | * need to wait for it to be destroyed */ |
194 | wait_for_old_object: | 191 | wait_for_old_object: |
195 | if (fscache_object_is_live(&object->fscache)) { | 192 | if (fscache_object_is_live(&object->fscache)) { |
196 | printk(KERN_ERR "\n"); | 193 | pr_err("\n"); |
197 | printk(KERN_ERR "CacheFiles: Error:" | 194 | pr_err("CacheFiles: Error: Unexpected object collision\n"); |
198 | " Unexpected object collision\n"); | ||
199 | cachefiles_printk_object(object, xobject); | 195 | cachefiles_printk_object(object, xobject); |
200 | BUG(); | 196 | BUG(); |
201 | } | 197 | } |
@@ -241,9 +237,8 @@ wait_for_old_object: | |||
241 | } | 237 | } |
242 | 238 | ||
243 | if (timeout <= 0) { | 239 | if (timeout <= 0) { |
244 | printk(KERN_ERR "\n"); | 240 | pr_err("\n"); |
245 | printk(KERN_ERR "CacheFiles: Error: Overlong" | 241 | pr_err("CacheFiles: Error: Overlong wait for old active object to go away\n"); |
246 | " wait for old active object to go away\n"); | ||
247 | cachefiles_printk_object(object, xobject); | 242 | cachefiles_printk_object(object, xobject); |
248 | goto requeue; | 243 | goto requeue; |
249 | } | 244 | } |
diff --git a/fs/cachefiles/security.c b/fs/cachefiles/security.c index 039b5011d83b..7a6b665f6b1a 100644 --- a/fs/cachefiles/security.c +++ b/fs/cachefiles/security.c | |||
@@ -34,9 +34,7 @@ int cachefiles_get_security_ID(struct cachefiles_cache *cache) | |||
34 | ret = set_security_override_from_ctx(new, cache->secctx); | 34 | ret = set_security_override_from_ctx(new, cache->secctx); |
35 | if (ret < 0) { | 35 | if (ret < 0) { |
36 | put_cred(new); | 36 | put_cred(new); |
37 | printk(KERN_ERR "CacheFiles:" | 37 | pr_err("CacheFiles: Security denies permission to nominate security context: error %d\n", |
38 | " Security denies permission to nominate" | ||
39 | " security context: error %d\n", | ||
40 | ret); | 38 | ret); |
41 | goto error; | 39 | goto error; |
42 | } | 40 | } |
@@ -59,16 +57,14 @@ static int cachefiles_check_cache_dir(struct cachefiles_cache *cache, | |||
59 | 57 | ||
60 | ret = security_inode_mkdir(root->d_inode, root, 0); | 58 | ret = security_inode_mkdir(root->d_inode, root, 0); |
61 | if (ret < 0) { | 59 | if (ret < 0) { |
62 | printk(KERN_ERR "CacheFiles:" | 60 | pr_err("CacheFiles: Security denies permission to make dirs: error %d", |
63 | " Security denies permission to make dirs: error %d", | ||
64 | ret); | 61 | ret); |
65 | return ret; | 62 | return ret; |
66 | } | 63 | } |
67 | 64 | ||
68 | ret = security_inode_create(root->d_inode, root, 0); | 65 | ret = security_inode_create(root->d_inode, root, 0); |
69 | if (ret < 0) | 66 | if (ret < 0) |
70 | printk(KERN_ERR "CacheFiles:" | 67 | pr_err("CacheFiles: Security denies permission to create files: error %d", |
71 | " Security denies permission to create files: error %d", | ||
72 | ret); | 68 | ret); |
73 | 69 | ||
74 | return ret; | 70 | return ret; |