aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/write.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/write.c')
-rw-r--r--fs/jffs2/write.c113
1 files changed, 64 insertions, 49 deletions
diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c
index 30d175b6d290..b634de4c8101 100644
--- a/fs/jffs2/write.c
+++ b/fs/jffs2/write.c
@@ -9,6 +9,8 @@
9 * 9 *
10 */ 10 */
11 11
12#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13
12#include <linux/kernel.h> 14#include <linux/kernel.h>
13#include <linux/fs.h> 15#include <linux/fs.h>
14#include <linux/crc32.h> 16#include <linux/crc32.h>
@@ -36,7 +38,7 @@ int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
36 f->inocache->state = INO_STATE_PRESENT; 38 f->inocache->state = INO_STATE_PRESENT;
37 39
38 jffs2_add_ino_cache(c, f->inocache); 40 jffs2_add_ino_cache(c, f->inocache);
39 D1(printk(KERN_DEBUG "jffs2_do_new_inode(): Assigned ino# %d\n", f->inocache->ino)); 41 jffs2_dbg(1, "%s(): Assigned ino# %d\n", __func__, f->inocache->ino);
40 ri->ino = cpu_to_je32(f->inocache->ino); 42 ri->ino = cpu_to_je32(f->inocache->ino);
41 43
42 ri->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); 44 ri->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
@@ -68,7 +70,7 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
68 unsigned long cnt = 2; 70 unsigned long cnt = 2;
69 71
70 D1(if(je32_to_cpu(ri->hdr_crc) != crc32(0, ri, sizeof(struct jffs2_unknown_node)-4)) { 72 D1(if(je32_to_cpu(ri->hdr_crc) != crc32(0, ri, sizeof(struct jffs2_unknown_node)-4)) {
71 printk(KERN_CRIT "Eep. CRC not correct in jffs2_write_dnode()\n"); 73 pr_crit("Eep. CRC not correct in jffs2_write_dnode()\n");
72 BUG(); 74 BUG();
73 } 75 }
74 ); 76 );
@@ -78,7 +80,9 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
78 vecs[1].iov_len = datalen; 80 vecs[1].iov_len = datalen;
79 81
80 if (je32_to_cpu(ri->totlen) != sizeof(*ri) + datalen) { 82 if (je32_to_cpu(ri->totlen) != sizeof(*ri) + datalen) {
81 printk(KERN_WARNING "jffs2_write_dnode: ri->totlen (0x%08x) != sizeof(*ri) (0x%08zx) + datalen (0x%08x)\n", je32_to_cpu(ri->totlen), sizeof(*ri), datalen); 83 pr_warn("%s(): ri->totlen (0x%08x) != sizeof(*ri) (0x%08zx) + datalen (0x%08x)\n",
84 __func__, je32_to_cpu(ri->totlen),
85 sizeof(*ri), datalen);
82 } 86 }
83 87
84 fn = jffs2_alloc_full_dnode(); 88 fn = jffs2_alloc_full_dnode();
@@ -95,9 +99,9 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
95 99
96 if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(ri->version) < f->highest_version)) { 100 if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(ri->version) < f->highest_version)) {
97 BUG_ON(!retried); 101 BUG_ON(!retried);
98 D1(printk(KERN_DEBUG "jffs2_write_dnode : dnode_version %d, " 102 jffs2_dbg(1, "%s(): dnode_version %d, highest version %d -> updating dnode\n",
99 "highest version %d -> updating dnode\n", 103 __func__,
100 je32_to_cpu(ri->version), f->highest_version)); 104 je32_to_cpu(ri->version), f->highest_version);
101 ri->version = cpu_to_je32(++f->highest_version); 105 ri->version = cpu_to_je32(++f->highest_version);
102 ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8)); 106 ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
103 } 107 }
@@ -106,8 +110,8 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
106 (alloc_mode==ALLOC_GC)?0:f->inocache->ino); 110 (alloc_mode==ALLOC_GC)?0:f->inocache->ino);
107 111
108 if (ret || (retlen != sizeof(*ri) + datalen)) { 112 if (ret || (retlen != sizeof(*ri) + datalen)) {
109 printk(KERN_NOTICE "Write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n", 113 pr_notice("Write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n",
110 sizeof(*ri)+datalen, flash_ofs, ret, retlen); 114 sizeof(*ri) + datalen, flash_ofs, ret, retlen);
111 115
112 /* Mark the space as dirtied */ 116 /* Mark the space as dirtied */
113 if (retlen) { 117 if (retlen) {
@@ -118,7 +122,8 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
118 this node */ 122 this node */
119 jffs2_add_physical_node_ref(c, flash_ofs | REF_OBSOLETE, PAD(sizeof(*ri)+datalen), NULL); 123 jffs2_add_physical_node_ref(c, flash_ofs | REF_OBSOLETE, PAD(sizeof(*ri)+datalen), NULL);
120 } else { 124 } else {
121 printk(KERN_NOTICE "Not marking the space at 0x%08x as dirty because the flash driver returned retlen zero\n", flash_ofs); 125 pr_notice("Not marking the space at 0x%08x as dirty because the flash driver returned retlen zero\n",
126 flash_ofs);
122 } 127 }
123 if (!retried && alloc_mode != ALLOC_NORETRY) { 128 if (!retried && alloc_mode != ALLOC_NORETRY) {
124 /* Try to reallocate space and retry */ 129 /* Try to reallocate space and retry */
@@ -127,7 +132,7 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
127 132
128 retried = 1; 133 retried = 1;
129 134
130 D1(printk(KERN_DEBUG "Retrying failed write.\n")); 135 jffs2_dbg(1, "Retrying failed write.\n");
131 136
132 jffs2_dbg_acct_sanity_check(c,jeb); 137 jffs2_dbg_acct_sanity_check(c,jeb);
133 jffs2_dbg_acct_paranoia_check(c, jeb); 138 jffs2_dbg_acct_paranoia_check(c, jeb);
@@ -147,14 +152,16 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
147 152
148 if (!ret) { 153 if (!ret) {
149 flash_ofs = write_ofs(c); 154 flash_ofs = write_ofs(c);
150 D1(printk(KERN_DEBUG "Allocated space at 0x%08x to retry failed write.\n", flash_ofs)); 155 jffs2_dbg(1, "Allocated space at 0x%08x to retry failed write.\n",
156 flash_ofs);
151 157
152 jffs2_dbg_acct_sanity_check(c,jeb); 158 jffs2_dbg_acct_sanity_check(c,jeb);
153 jffs2_dbg_acct_paranoia_check(c, jeb); 159 jffs2_dbg_acct_paranoia_check(c, jeb);
154 160
155 goto retry; 161 goto retry;
156 } 162 }
157 D1(printk(KERN_DEBUG "Failed to allocate space to retry failed write: %d!\n", ret)); 163 jffs2_dbg(1, "Failed to allocate space to retry failed write: %d!\n",
164 ret);
158 } 165 }
159 /* Release the full_dnode which is now useless, and return */ 166 /* Release the full_dnode which is now useless, and return */
160 jffs2_free_full_dnode(fn); 167 jffs2_free_full_dnode(fn);
@@ -183,10 +190,10 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
183 fn->size = je32_to_cpu(ri->dsize); 190 fn->size = je32_to_cpu(ri->dsize);
184 fn->frags = 0; 191 fn->frags = 0;
185 192
186 D1(printk(KERN_DEBUG "jffs2_write_dnode wrote node at 0x%08x(%d) with dsize 0x%x, csize 0x%x, node_crc 0x%08x, data_crc 0x%08x, totlen 0x%08x\n", 193 jffs2_dbg(1, "jffs2_write_dnode wrote node at 0x%08x(%d) with dsize 0x%x, csize 0x%x, node_crc 0x%08x, data_crc 0x%08x, totlen 0x%08x\n",
187 flash_ofs & ~3, flash_ofs & 3, je32_to_cpu(ri->dsize), 194 flash_ofs & ~3, flash_ofs & 3, je32_to_cpu(ri->dsize),
188 je32_to_cpu(ri->csize), je32_to_cpu(ri->node_crc), 195 je32_to_cpu(ri->csize), je32_to_cpu(ri->node_crc),
189 je32_to_cpu(ri->data_crc), je32_to_cpu(ri->totlen))); 196 je32_to_cpu(ri->data_crc), je32_to_cpu(ri->totlen));
190 197
191 if (retried) { 198 if (retried) {
192 jffs2_dbg_acct_sanity_check(c,NULL); 199 jffs2_dbg_acct_sanity_check(c,NULL);
@@ -206,22 +213,23 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
206 int retried = 0; 213 int retried = 0;
207 int ret; 214 int ret;
208 215
209 D1(printk(KERN_DEBUG "jffs2_write_dirent(ino #%u, name at *0x%p \"%s\"->ino #%u, name_crc 0x%08x)\n", 216 jffs2_dbg(1, "%s(ino #%u, name at *0x%p \"%s\"->ino #%u, name_crc 0x%08x)\n",
217 __func__,
210 je32_to_cpu(rd->pino), name, name, je32_to_cpu(rd->ino), 218 je32_to_cpu(rd->pino), name, name, je32_to_cpu(rd->ino),
211 je32_to_cpu(rd->name_crc))); 219 je32_to_cpu(rd->name_crc));
212 220
213 D1(if(je32_to_cpu(rd->hdr_crc) != crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)) { 221 D1(if(je32_to_cpu(rd->hdr_crc) != crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)) {
214 printk(KERN_CRIT "Eep. CRC not correct in jffs2_write_dirent()\n"); 222 pr_crit("Eep. CRC not correct in jffs2_write_dirent()\n");
215 BUG(); 223 BUG();
216 }); 224 });
217 225
218 if (strnlen(name, namelen) != namelen) { 226 if (strnlen(name, namelen) != namelen) {
219 /* This should never happen, but seems to have done on at least one 227 /* This should never happen, but seems to have done on at least one
220 occasion: https://dev.laptop.org/ticket/4184 */ 228 occasion: https://dev.laptop.org/ticket/4184 */
221 printk(KERN_CRIT "Error in jffs2_write_dirent() -- name contains zero bytes!\n"); 229 pr_crit("Error in jffs2_write_dirent() -- name contains zero bytes!\n");
222 printk(KERN_CRIT "Directory inode #%u, name at *0x%p \"%s\"->ino #%u, name_crc 0x%08x\n", 230 pr_crit("Directory inode #%u, name at *0x%p \"%s\"->ino #%u, name_crc 0x%08x\n",
223 je32_to_cpu(rd->pino), name, name, je32_to_cpu(rd->ino), 231 je32_to_cpu(rd->pino), name, name, je32_to_cpu(rd->ino),
224 je32_to_cpu(rd->name_crc)); 232 je32_to_cpu(rd->name_crc));
225 WARN_ON(1); 233 WARN_ON(1);
226 return ERR_PTR(-EIO); 234 return ERR_PTR(-EIO);
227 } 235 }
@@ -249,9 +257,9 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
249 257
250 if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(rd->version) < f->highest_version)) { 258 if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(rd->version) < f->highest_version)) {
251 BUG_ON(!retried); 259 BUG_ON(!retried);
252 D1(printk(KERN_DEBUG "jffs2_write_dirent : dirent_version %d, " 260 jffs2_dbg(1, "%s(): dirent_version %d, highest version %d -> updating dirent\n",
253 "highest version %d -> updating dirent\n", 261 __func__,
254 je32_to_cpu(rd->version), f->highest_version)); 262 je32_to_cpu(rd->version), f->highest_version);
255 rd->version = cpu_to_je32(++f->highest_version); 263 rd->version = cpu_to_je32(++f->highest_version);
256 fd->version = je32_to_cpu(rd->version); 264 fd->version = je32_to_cpu(rd->version);
257 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); 265 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
@@ -260,13 +268,14 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
260 ret = jffs2_flash_writev(c, vecs, 2, flash_ofs, &retlen, 268 ret = jffs2_flash_writev(c, vecs, 2, flash_ofs, &retlen,
261 (alloc_mode==ALLOC_GC)?0:je32_to_cpu(rd->pino)); 269 (alloc_mode==ALLOC_GC)?0:je32_to_cpu(rd->pino));
262 if (ret || (retlen != sizeof(*rd) + namelen)) { 270 if (ret || (retlen != sizeof(*rd) + namelen)) {
263 printk(KERN_NOTICE "Write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n", 271 pr_notice("Write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n",
264 sizeof(*rd)+namelen, flash_ofs, ret, retlen); 272 sizeof(*rd) + namelen, flash_ofs, ret, retlen);
265 /* Mark the space as dirtied */ 273 /* Mark the space as dirtied */
266 if (retlen) { 274 if (retlen) {
267 jffs2_add_physical_node_ref(c, flash_ofs | REF_OBSOLETE, PAD(sizeof(*rd)+namelen), NULL); 275 jffs2_add_physical_node_ref(c, flash_ofs | REF_OBSOLETE, PAD(sizeof(*rd)+namelen), NULL);
268 } else { 276 } else {
269 printk(KERN_NOTICE "Not marking the space at 0x%08x as dirty because the flash driver returned retlen zero\n", flash_ofs); 277 pr_notice("Not marking the space at 0x%08x as dirty because the flash driver returned retlen zero\n",
278 flash_ofs);
270 } 279 }
271 if (!retried) { 280 if (!retried) {
272 /* Try to reallocate space and retry */ 281 /* Try to reallocate space and retry */
@@ -275,7 +284,7 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
275 284
276 retried = 1; 285 retried = 1;
277 286
278 D1(printk(KERN_DEBUG "Retrying failed write.\n")); 287 jffs2_dbg(1, "Retrying failed write.\n");
279 288
280 jffs2_dbg_acct_sanity_check(c,jeb); 289 jffs2_dbg_acct_sanity_check(c,jeb);
281 jffs2_dbg_acct_paranoia_check(c, jeb); 290 jffs2_dbg_acct_paranoia_check(c, jeb);
@@ -295,12 +304,14 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
295 304
296 if (!ret) { 305 if (!ret) {
297 flash_ofs = write_ofs(c); 306 flash_ofs = write_ofs(c);
298 D1(printk(KERN_DEBUG "Allocated space at 0x%08x to retry failed write.\n", flash_ofs)); 307 jffs2_dbg(1, "Allocated space at 0x%08x to retry failed write\n",
308 flash_ofs);
299 jffs2_dbg_acct_sanity_check(c,jeb); 309 jffs2_dbg_acct_sanity_check(c,jeb);
300 jffs2_dbg_acct_paranoia_check(c, jeb); 310 jffs2_dbg_acct_paranoia_check(c, jeb);
301 goto retry; 311 goto retry;
302 } 312 }
303 D1(printk(KERN_DEBUG "Failed to allocate space to retry failed write: %d!\n", ret)); 313 jffs2_dbg(1, "Failed to allocate space to retry failed write: %d!\n",
314 ret);
304 } 315 }
305 /* Release the full_dnode which is now useless, and return */ 316 /* Release the full_dnode which is now useless, and return */
306 jffs2_free_full_dirent(fd); 317 jffs2_free_full_dirent(fd);
@@ -333,8 +344,8 @@ int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
333 int ret = 0; 344 int ret = 0;
334 uint32_t writtenlen = 0; 345 uint32_t writtenlen = 0;
335 346
336 D1(printk(KERN_DEBUG "jffs2_write_inode_range(): Ino #%u, ofs 0x%x, len 0x%x\n", 347 jffs2_dbg(1, "%s(): Ino #%u, ofs 0x%x, len 0x%x\n",
337 f->inocache->ino, offset, writelen)); 348 __func__, f->inocache->ino, offset, writelen);
338 349
339 while(writelen) { 350 while(writelen) {
340 struct jffs2_full_dnode *fn; 351 struct jffs2_full_dnode *fn;
@@ -345,12 +356,13 @@ int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
345 int retried = 0; 356 int retried = 0;
346 357
347 retry: 358 retry:
348 D2(printk(KERN_DEBUG "jffs2_commit_write() loop: 0x%x to write to 0x%x\n", writelen, offset)); 359 jffs2_dbg(2, "jffs2_commit_write() loop: 0x%x to write to 0x%x\n",
360 writelen, offset);
349 361
350 ret = jffs2_reserve_space(c, sizeof(*ri) + JFFS2_MIN_DATA_LEN, 362 ret = jffs2_reserve_space(c, sizeof(*ri) + JFFS2_MIN_DATA_LEN,
351 &alloclen, ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE); 363 &alloclen, ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
352 if (ret) { 364 if (ret) {
353 D1(printk(KERN_DEBUG "jffs2_reserve_space returned %d\n", ret)); 365 jffs2_dbg(1, "jffs2_reserve_space returned %d\n", ret);
354 break; 366 break;
355 } 367 }
356 mutex_lock(&f->sem); 368 mutex_lock(&f->sem);
@@ -386,7 +398,7 @@ int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
386 if (!retried) { 398 if (!retried) {
387 /* Write error to be retried */ 399 /* Write error to be retried */
388 retried = 1; 400 retried = 1;
389 D1(printk(KERN_DEBUG "Retrying node write in jffs2_write_inode_range()\n")); 401 jffs2_dbg(1, "Retrying node write in jffs2_write_inode_range()\n");
390 goto retry; 402 goto retry;
391 } 403 }
392 break; 404 break;
@@ -399,7 +411,8 @@ int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
399 } 411 }
400 if (ret) { 412 if (ret) {
401 /* Eep */ 413 /* Eep */
402 D1(printk(KERN_DEBUG "Eep. add_full_dnode_to_inode() failed in commit_write, returned %d\n", ret)); 414 jffs2_dbg(1, "Eep. add_full_dnode_to_inode() failed in commit_write, returned %d\n",
415 ret);
403 jffs2_mark_node_obsolete(c, fn->raw); 416 jffs2_mark_node_obsolete(c, fn->raw);
404 jffs2_free_full_dnode(fn); 417 jffs2_free_full_dnode(fn);
405 418
@@ -410,11 +423,11 @@ int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
410 mutex_unlock(&f->sem); 423 mutex_unlock(&f->sem);
411 jffs2_complete_reservation(c); 424 jffs2_complete_reservation(c);
412 if (!datalen) { 425 if (!datalen) {
413 printk(KERN_WARNING "Eep. We didn't actually write any data in jffs2_write_inode_range()\n"); 426 pr_warn("Eep. We didn't actually write any data in jffs2_write_inode_range()\n");
414 ret = -EIO; 427 ret = -EIO;
415 break; 428 break;
416 } 429 }
417 D1(printk(KERN_DEBUG "increasing writtenlen by %d\n", datalen)); 430 jffs2_dbg(1, "increasing writtenlen by %d\n", datalen);
418 writtenlen += datalen; 431 writtenlen += datalen;
419 offset += datalen; 432 offset += datalen;
420 writelen -= datalen; 433 writelen -= datalen;
@@ -439,7 +452,7 @@ int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f,
439 */ 452 */
440 ret = jffs2_reserve_space(c, sizeof(*ri), &alloclen, ALLOC_NORMAL, 453 ret = jffs2_reserve_space(c, sizeof(*ri), &alloclen, ALLOC_NORMAL,
441 JFFS2_SUMMARY_INODE_SIZE); 454 JFFS2_SUMMARY_INODE_SIZE);
442 D1(printk(KERN_DEBUG "jffs2_do_create(): reserved 0x%x bytes\n", alloclen)); 455 jffs2_dbg(1, "%s(): reserved 0x%x bytes\n", __func__, alloclen);
443 if (ret) 456 if (ret)
444 return ret; 457 return ret;
445 458
@@ -450,11 +463,11 @@ int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f,
450 463
451 fn = jffs2_write_dnode(c, f, ri, NULL, 0, ALLOC_NORMAL); 464 fn = jffs2_write_dnode(c, f, ri, NULL, 0, ALLOC_NORMAL);
452 465
453 D1(printk(KERN_DEBUG "jffs2_do_create created file with mode 0x%x\n", 466 jffs2_dbg(1, "jffs2_do_create created file with mode 0x%x\n",
454 jemode_to_cpu(ri->mode))); 467 jemode_to_cpu(ri->mode));
455 468
456 if (IS_ERR(fn)) { 469 if (IS_ERR(fn)) {
457 D1(printk(KERN_DEBUG "jffs2_write_dnode() failed\n")); 470 jffs2_dbg(1, "jffs2_write_dnode() failed\n");
458 /* Eeek. Wave bye bye */ 471 /* Eeek. Wave bye bye */
459 mutex_unlock(&f->sem); 472 mutex_unlock(&f->sem);
460 jffs2_complete_reservation(c); 473 jffs2_complete_reservation(c);
@@ -480,7 +493,7 @@ int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f,
480 493
481 if (ret) { 494 if (ret) {
482 /* Eep. */ 495 /* Eep. */
483 D1(printk(KERN_DEBUG "jffs2_reserve_space() for dirent failed\n")); 496 jffs2_dbg(1, "jffs2_reserve_space() for dirent failed\n");
484 return ret; 497 return ret;
485 } 498 }
486 499
@@ -597,8 +610,8 @@ int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f,
597 !memcmp(fd->name, name, namelen) && 610 !memcmp(fd->name, name, namelen) &&
598 !fd->name[namelen]) { 611 !fd->name[namelen]) {
599 612
600 D1(printk(KERN_DEBUG "Marking old dirent node (ino #%u) @%08x obsolete\n", 613 jffs2_dbg(1, "Marking old dirent node (ino #%u) @%08x obsolete\n",
601 fd->ino, ref_offset(fd->raw))); 614 fd->ino, ref_offset(fd->raw));
602 jffs2_mark_node_obsolete(c, fd->raw); 615 jffs2_mark_node_obsolete(c, fd->raw);
603 /* We don't want to remove it from the list immediately, 616 /* We don't want to remove it from the list immediately,
604 because that screws up getdents()/seek() semantics even 617 because that screws up getdents()/seek() semantics even
@@ -627,11 +640,13 @@ int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f,
627 dead_f->dents = fd->next; 640 dead_f->dents = fd->next;
628 641
629 if (fd->ino) { 642 if (fd->ino) {
630 printk(KERN_WARNING "Deleting inode #%u with active dentry \"%s\"->ino #%u\n", 643 pr_warn("Deleting inode #%u with active dentry \"%s\"->ino #%u\n",
631 dead_f->inocache->ino, fd->name, fd->ino); 644 dead_f->inocache->ino,
645 fd->name, fd->ino);
632 } else { 646 } else {
633 D1(printk(KERN_DEBUG "Removing deletion dirent for \"%s\" from dir ino #%u\n", 647 jffs2_dbg(1, "Removing deletion dirent for \"%s\" from dir ino #%u\n",
634 fd->name, dead_f->inocache->ino)); 648 fd->name,
649 dead_f->inocache->ino);
635 } 650 }
636 if (fd->raw) 651 if (fd->raw)
637 jffs2_mark_node_obsolete(c, fd->raw); 652 jffs2_mark_node_obsolete(c, fd->raw);