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