diff options
author | Joe Perches <joe@perches.com> | 2012-02-15 18:56:43 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-26 19:39:24 -0400 |
commit | 9c261b33a9c417ccaf07f41796be278d09d02d49 (patch) | |
tree | 6cf47f47364647dfbba845c0fd3f05539072175a /fs/jffs2/file.c | |
parent | bf011f2ed53d587fdd8148c173c4f09ed77bdf1a (diff) |
jffs2: Convert most D1/D2 macros to jffs2_dbg
D1 and D2 macros are mostly uses to emit debugging messages.
Convert the logging uses of D1 & D2 to jffs2_dbg(level, fmt, ...)
to be a bit more consistent style with the rest of the kernel.
All jffs2_dbg output is now at KERN_DEBUG where some of
the previous uses were emitted at various KERN_<LEVEL>s.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2/file.c')
-rw-r--r-- | fs/jffs2/file.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 61e6723535b9..5ffc3562ae23 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c | |||
@@ -85,7 +85,8 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg) | |||
85 | unsigned char *pg_buf; | 85 | unsigned char *pg_buf; |
86 | int ret; | 86 | int ret; |
87 | 87 | ||
88 | D2(printk(KERN_DEBUG "jffs2_do_readpage_nolock(): ino #%lu, page at offset 0x%lx\n", inode->i_ino, pg->index << PAGE_CACHE_SHIFT)); | 88 | jffs2_dbg(2, "%s(): ino #%lu, page at offset 0x%lx\n", |
89 | __func__, inode->i_ino, pg->index << PAGE_CACHE_SHIFT); | ||
89 | 90 | ||
90 | BUG_ON(!PageLocked(pg)); | 91 | BUG_ON(!PageLocked(pg)); |
91 | 92 | ||
@@ -105,7 +106,7 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg) | |||
105 | flush_dcache_page(pg); | 106 | flush_dcache_page(pg); |
106 | kunmap(pg); | 107 | kunmap(pg); |
107 | 108 | ||
108 | D2(printk(KERN_DEBUG "readpage finished\n")); | 109 | jffs2_dbg(2, "readpage finished\n"); |
109 | return ret; | 110 | return ret; |
110 | } | 111 | } |
111 | 112 | ||
@@ -144,7 +145,7 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping, | |||
144 | return -ENOMEM; | 145 | return -ENOMEM; |
145 | *pagep = pg; | 146 | *pagep = pg; |
146 | 147 | ||
147 | D1(printk(KERN_DEBUG "jffs2_write_begin()\n")); | 148 | jffs2_dbg(1, "%s()\n", __func__); |
148 | 149 | ||
149 | if (pageofs > inode->i_size) { | 150 | if (pageofs > inode->i_size) { |
150 | /* Make new hole frag from old EOF to new page */ | 151 | /* Make new hole frag from old EOF to new page */ |
@@ -153,8 +154,8 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping, | |||
153 | struct jffs2_full_dnode *fn; | 154 | struct jffs2_full_dnode *fn; |
154 | uint32_t alloc_len; | 155 | uint32_t alloc_len; |
155 | 156 | ||
156 | D1(printk(KERN_DEBUG "Writing new hole frag 0x%x-0x%x between current EOF and new page\n", | 157 | jffs2_dbg(1, "Writing new hole frag 0x%x-0x%x between current EOF and new page\n", |
157 | (unsigned int)inode->i_size, pageofs)); | 158 | (unsigned int)inode->i_size, pageofs); |
158 | 159 | ||
159 | ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len, | 160 | ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len, |
160 | ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE); | 161 | ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE); |
@@ -198,7 +199,8 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping, | |||
198 | f->metadata = NULL; | 199 | f->metadata = NULL; |
199 | } | 200 | } |
200 | if (ret) { | 201 | if (ret) { |
201 | D1(printk(KERN_DEBUG "Eep. add_full_dnode_to_inode() failed in write_begin, returned %d\n", ret)); | 202 | jffs2_dbg(1, "Eep. add_full_dnode_to_inode() failed in write_begin, returned %d\n", |
203 | ret); | ||
202 | jffs2_mark_node_obsolete(c, fn->raw); | 204 | jffs2_mark_node_obsolete(c, fn->raw); |
203 | jffs2_free_full_dnode(fn); | 205 | jffs2_free_full_dnode(fn); |
204 | jffs2_complete_reservation(c); | 206 | jffs2_complete_reservation(c); |
@@ -222,7 +224,7 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping, | |||
222 | if (ret) | 224 | if (ret) |
223 | goto out_page; | 225 | goto out_page; |
224 | } | 226 | } |
225 | D1(printk(KERN_DEBUG "end write_begin(). pg->flags %lx\n", pg->flags)); | 227 | jffs2_dbg(1, "end write_begin(). pg->flags %lx\n", pg->flags); |
226 | return ret; | 228 | return ret; |
227 | 229 | ||
228 | out_page: | 230 | out_page: |
@@ -248,8 +250,9 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, | |||
248 | int ret = 0; | 250 | int ret = 0; |
249 | uint32_t writtenlen = 0; | 251 | uint32_t writtenlen = 0; |
250 | 252 | ||
251 | D1(printk(KERN_DEBUG "jffs2_write_end(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n", | 253 | jffs2_dbg(1, "%s(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n", |
252 | inode->i_ino, pg->index << PAGE_CACHE_SHIFT, start, end, pg->flags)); | 254 | __func__, inode->i_ino, pg->index << PAGE_CACHE_SHIFT, |
255 | start, end, pg->flags); | ||
253 | 256 | ||
254 | /* We need to avoid deadlock with page_cache_read() in | 257 | /* We need to avoid deadlock with page_cache_read() in |
255 | jffs2_garbage_collect_pass(). So the page must be | 258 | jffs2_garbage_collect_pass(). So the page must be |
@@ -268,7 +271,8 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, | |||
268 | ri = jffs2_alloc_raw_inode(); | 271 | ri = jffs2_alloc_raw_inode(); |
269 | 272 | ||
270 | if (!ri) { | 273 | if (!ri) { |
271 | D1(printk(KERN_DEBUG "jffs2_write_end(): Allocation of raw inode failed\n")); | 274 | jffs2_dbg(1, "%s(): Allocation of raw inode failed\n", |
275 | __func__); | ||
272 | unlock_page(pg); | 276 | unlock_page(pg); |
273 | page_cache_release(pg); | 277 | page_cache_release(pg); |
274 | return -ENOMEM; | 278 | return -ENOMEM; |
@@ -315,13 +319,14 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, | |||
315 | /* generic_file_write has written more to the page cache than we've | 319 | /* generic_file_write has written more to the page cache than we've |
316 | actually written to the medium. Mark the page !Uptodate so that | 320 | actually written to the medium. Mark the page !Uptodate so that |
317 | it gets reread */ | 321 | it gets reread */ |
318 | D1(printk(KERN_DEBUG "jffs2_write_end(): Not all bytes written. Marking page !uptodate\n")); | 322 | jffs2_dbg(1, "%s(): Not all bytes written. Marking page !uptodate\n", |
323 | __func__); | ||
319 | SetPageError(pg); | 324 | SetPageError(pg); |
320 | ClearPageUptodate(pg); | 325 | ClearPageUptodate(pg); |
321 | } | 326 | } |
322 | 327 | ||
323 | D1(printk(KERN_DEBUG "jffs2_write_end() returning %d\n", | 328 | jffs2_dbg(1, "%s() returning %d\n", |
324 | writtenlen > 0 ? writtenlen : ret)); | 329 | __func__, writtenlen > 0 ? writtenlen : ret); |
325 | unlock_page(pg); | 330 | unlock_page(pg); |
326 | page_cache_release(pg); | 331 | page_cache_release(pg); |
327 | return writtenlen > 0 ? writtenlen : ret; | 332 | return writtenlen > 0 ? writtenlen : ret; |