aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/write.c
diff options
context:
space:
mode:
authorEstelle Hammache <estelle.hammache@st.com>2005-01-28 13:53:05 -0500
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-05-23 06:16:06 -0400
commit9b88f47390efb72540b050628ebc04202d91c6ec (patch)
tree13d56b9a76a76b7dca5509cad63827570b3496b1 /fs/jffs2/write.c
parent6170b43401a3230756ff76287ee07db0d75eddde (diff)
[JFFS2] Code cleanup
Code beautification and block filing correction for optimization. Signed-off-by: Estelle Hammache <estelle.hammache@st.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2/write.c')
-rw-r--r--fs/jffs2/write.c44
1 files changed, 16 insertions, 28 deletions
diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c
index 32c1efaf6a0f..d6b4d55e70e4 100644
--- a/fs/jffs2/write.c
+++ b/fs/jffs2/write.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: write.c,v 1.88 2005/01/24 21:13:39 hammache Exp $ 10 * $Id: write.c,v 1.90 2005/01/28 18:53:01 hammache Exp $
11 * 11 *
12 */ 12 */
13 13
@@ -136,19 +136,13 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
136 raw->__totlen = PAD(sizeof(*ri)+datalen); 136 raw->__totlen = PAD(sizeof(*ri)+datalen);
137 raw->next_phys = NULL; 137 raw->next_phys = NULL;
138 138
139 if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(ri->version) < f->highest_version)) 139 if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(ri->version) < f->highest_version)) {
140 { 140 BUG_ON(!retried);
141 if (! retried) 141 D1(printk(KERN_DEBUG "jffs2_write_dnode : dnode_version %d, "
142 { 142 "highest version %d -> updating dnode\n",
143 BUG(); 143 je32_to_cpu(ri->version), f->highest_version));
144 } 144 ri->version = cpu_to_je32(++f->highest_version);
145 else 145 ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
146 {
147 D1(printk(KERN_DEBUG "jffs2_write_dnode : dnode_version %d, highest version %d -> updating dnode\n",
148 je32_to_cpu(ri->version), f->highest_version));
149 ri->version = cpu_to_je32(++f->highest_version);
150 ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
151 }
152 } 146 }
153 147
154 ret = jffs2_flash_writev(c, vecs, cnt, flash_ofs, &retlen, 148 ret = jffs2_flash_writev(c, vecs, cnt, flash_ofs, &retlen,
@@ -295,20 +289,14 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
295 raw->__totlen = PAD(sizeof(*rd)+namelen); 289 raw->__totlen = PAD(sizeof(*rd)+namelen);
296 raw->next_phys = NULL; 290 raw->next_phys = NULL;
297 291
298 if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(rd->version) < f->highest_version)) 292 if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(rd->version) < f->highest_version)) {
299 { 293 BUG_ON(!retried);
300 if (! retried) 294 D1(printk(KERN_DEBUG "jffs2_write_dirent : dirent_version %d, "
301 { 295 "highest version %d -> updating dirent\n",
302 BUG(); 296 je32_to_cpu(rd->version), f->highest_version));
303 } 297 rd->version = cpu_to_je32(++f->highest_version);
304 else 298 fd->version = je32_to_cpu(rd->version);
305 { 299 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
306 D1(printk(KERN_DEBUG "jffs2_write_dirent : dirent_version %d, highest version %d -> updating dirent\n",
307 je32_to_cpu(rd->version), f->highest_version));
308 rd->version = cpu_to_je32(++f->highest_version);
309 fd->version = je32_to_cpu(rd->version);
310 rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
311 }
312 } 300 }
313 301
314 ret = jffs2_flash_writev(c, vecs, 2, flash_ofs, &retlen, 302 ret = jffs2_flash_writev(c, vecs, 2, flash_ofs, &retlen,