diff options
Diffstat (limited to 'fs/cachefiles/namei.c')
-rw-r--r-- | fs/cachefiles/namei.c | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index c0a681705104..5bf2b41e66d3 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("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("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("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("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("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 | } |
@@ -548,7 +543,7 @@ lookup_again: | |||
548 | next, next->d_inode, next->d_inode->i_ino); | 543 | next, next->d_inode, next->d_inode->i_ino); |
549 | 544 | ||
550 | } else if (!S_ISDIR(next->d_inode->i_mode)) { | 545 | } else if (!S_ISDIR(next->d_inode->i_mode)) { |
551 | kerror("inode %lu is not a directory", | 546 | pr_err("inode %lu is not a directory", |
552 | next->d_inode->i_ino); | 547 | next->d_inode->i_ino); |
553 | ret = -ENOBUFS; | 548 | ret = -ENOBUFS; |
554 | goto error; | 549 | goto error; |
@@ -579,7 +574,7 @@ lookup_again: | |||
579 | } else if (!S_ISDIR(next->d_inode->i_mode) && | 574 | } else if (!S_ISDIR(next->d_inode->i_mode) && |
580 | !S_ISREG(next->d_inode->i_mode) | 575 | !S_ISREG(next->d_inode->i_mode) |
581 | ) { | 576 | ) { |
582 | kerror("inode %lu is not a file or directory", | 577 | pr_err("inode %lu is not a file or directory", |
583 | next->d_inode->i_ino); | 578 | next->d_inode->i_ino); |
584 | ret = -ENOBUFS; | 579 | ret = -ENOBUFS; |
585 | goto error; | 580 | goto error; |
@@ -773,7 +768,7 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache, | |||
773 | ASSERT(subdir->d_inode); | 768 | ASSERT(subdir->d_inode); |
774 | 769 | ||
775 | if (!S_ISDIR(subdir->d_inode->i_mode)) { | 770 | if (!S_ISDIR(subdir->d_inode->i_mode)) { |
776 | kerror("%s is not a directory", dirname); | 771 | pr_err("%s is not a directory", dirname); |
777 | ret = -EIO; | 772 | ret = -EIO; |
778 | goto check_error; | 773 | goto check_error; |
779 | } | 774 | } |
@@ -800,13 +795,13 @@ check_error: | |||
800 | mkdir_error: | 795 | mkdir_error: |
801 | mutex_unlock(&dir->d_inode->i_mutex); | 796 | mutex_unlock(&dir->d_inode->i_mutex); |
802 | dput(subdir); | 797 | dput(subdir); |
803 | kerror("mkdir %s failed with error %d", dirname, ret); | 798 | pr_err("mkdir %s failed with error %d", dirname, ret); |
804 | return ERR_PTR(ret); | 799 | return ERR_PTR(ret); |
805 | 800 | ||
806 | lookup_error: | 801 | lookup_error: |
807 | mutex_unlock(&dir->d_inode->i_mutex); | 802 | mutex_unlock(&dir->d_inode->i_mutex); |
808 | ret = PTR_ERR(subdir); | 803 | ret = PTR_ERR(subdir); |
809 | kerror("Lookup %s failed with error %d", dirname, ret); | 804 | pr_err("Lookup %s failed with error %d", dirname, ret); |
810 | return ERR_PTR(ret); | 805 | return ERR_PTR(ret); |
811 | 806 | ||
812 | nomem_d_alloc: | 807 | nomem_d_alloc: |
@@ -896,7 +891,7 @@ lookup_error: | |||
896 | if (ret == -EIO) { | 891 | if (ret == -EIO) { |
897 | cachefiles_io_error(cache, "Lookup failed"); | 892 | cachefiles_io_error(cache, "Lookup failed"); |
898 | } else if (ret != -ENOMEM) { | 893 | } else if (ret != -ENOMEM) { |
899 | kerror("Internal error: %d", ret); | 894 | pr_err("Internal error: %d", ret); |
900 | ret = -EIO; | 895 | ret = -EIO; |
901 | } | 896 | } |
902 | 897 | ||
@@ -955,7 +950,7 @@ error: | |||
955 | } | 950 | } |
956 | 951 | ||
957 | if (ret != -ENOMEM) { | 952 | if (ret != -ENOMEM) { |
958 | kerror("Internal error: %d", ret); | 953 | pr_err("Internal error: %d", ret); |
959 | ret = -EIO; | 954 | ret = -EIO; |
960 | } | 955 | } |
961 | 956 | ||