diff options
Diffstat (limited to 'fs/jffs2/write.c')
-rw-r--r-- | fs/jffs2/write.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c index ff2b00b604ec..4462541d11f8 100644 --- a/fs/jffs2/write.c +++ b/fs/jffs2/write.c | |||
@@ -103,8 +103,6 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2 | |||
103 | fn->raw = raw; | 103 | fn->raw = raw; |
104 | 104 | ||
105 | raw->flash_offset = flash_ofs; | 105 | raw->flash_offset = flash_ofs; |
106 | raw->__totlen = PAD(sizeof(*ri)+datalen); | ||
107 | raw->next_phys = NULL; | ||
108 | 106 | ||
109 | if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(ri->version) < f->highest_version)) { | 107 | if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(ri->version) < f->highest_version)) { |
110 | BUG_ON(!retried); | 108 | BUG_ON(!retried); |
@@ -133,7 +131,7 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2 | |||
133 | any node we write before the original intended end of | 131 | any node we write before the original intended end of |
134 | this node */ | 132 | this node */ |
135 | raw->flash_offset |= REF_OBSOLETE; | 133 | raw->flash_offset |= REF_OBSOLETE; |
136 | jffs2_add_physical_node_ref(c, raw); | 134 | jffs2_add_physical_node_ref(c, raw, PAD(sizeof(*ri)+datalen)); |
137 | jffs2_mark_node_obsolete(c, raw); | 135 | jffs2_mark_node_obsolete(c, raw); |
138 | } else { | 136 | } else { |
139 | printk(KERN_NOTICE "Not marking the space at 0x%08x as dirty because the flash driver returned retlen zero\n", raw->flash_offset); | 137 | printk(KERN_NOTICE "Not marking the space at 0x%08x as dirty because the flash driver returned retlen zero\n", raw->flash_offset); |
@@ -191,7 +189,7 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2 | |||
191 | } else { | 189 | } else { |
192 | raw->flash_offset |= REF_NORMAL; | 190 | raw->flash_offset |= REF_NORMAL; |
193 | } | 191 | } |
194 | jffs2_add_physical_node_ref(c, raw); | 192 | jffs2_add_physical_node_ref(c, raw, PAD(sizeof(*ri)+datalen)); |
195 | 193 | ||
196 | /* Link into per-inode list */ | 194 | /* Link into per-inode list */ |
197 | spin_lock(&c->erase_completion_lock); | 195 | spin_lock(&c->erase_completion_lock); |
@@ -259,8 +257,6 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff | |||
259 | fd->raw = raw; | 257 | fd->raw = raw; |
260 | 258 | ||
261 | raw->flash_offset = flash_ofs; | 259 | raw->flash_offset = flash_ofs; |
262 | raw->__totlen = PAD(sizeof(*rd)+namelen); | ||
263 | raw->next_phys = NULL; | ||
264 | 260 | ||
265 | if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(rd->version) < f->highest_version)) { | 261 | if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(rd->version) < f->highest_version)) { |
266 | BUG_ON(!retried); | 262 | BUG_ON(!retried); |
@@ -281,7 +277,7 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff | |||
281 | if (retlen) { | 277 | if (retlen) { |
282 | raw->next_in_ino = NULL; | 278 | raw->next_in_ino = NULL; |
283 | raw->flash_offset |= REF_OBSOLETE; | 279 | raw->flash_offset |= REF_OBSOLETE; |
284 | jffs2_add_physical_node_ref(c, raw); | 280 | jffs2_add_physical_node_ref(c, raw, PAD(sizeof(*rd)+namelen)); |
285 | jffs2_mark_node_obsolete(c, raw); | 281 | jffs2_mark_node_obsolete(c, raw); |
286 | } else { | 282 | } else { |
287 | printk(KERN_NOTICE "Not marking the space at 0x%08x as dirty because the flash driver returned retlen zero\n", raw->flash_offset); | 283 | printk(KERN_NOTICE "Not marking the space at 0x%08x as dirty because the flash driver returned retlen zero\n", raw->flash_offset); |
@@ -327,7 +323,7 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff | |||
327 | } | 323 | } |
328 | /* Mark the space used */ | 324 | /* Mark the space used */ |
329 | raw->flash_offset |= REF_PRISTINE; | 325 | raw->flash_offset |= REF_PRISTINE; |
330 | jffs2_add_physical_node_ref(c, raw); | 326 | jffs2_add_physical_node_ref(c, raw, PAD(sizeof(*rd)+namelen)); |
331 | 327 | ||
332 | spin_lock(&c->erase_completion_lock); | 328 | spin_lock(&c->erase_completion_lock); |
333 | raw->next_in_ino = f->inocache->nodes; | 329 | raw->next_in_ino = f->inocache->nodes; |