aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/erase.c
diff options
context:
space:
mode:
authorKaiGai Kohei <kaigai@ak.jp.nec.com>2006-06-10 21:35:15 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-06-27 11:16:26 -0400
commitc9f700f840bd481b3e01fcad1ba8da01794a6726 (patch)
tree786f4a6a3f3a2d619ae4230a62f95361fcd3245a /fs/jffs2/erase.c
parent6d4f8224d4ee065e0e3186cc554468d735e6015d (diff)
[JFFS2][XATTR] using 'delete marker' for xdatum/xref deletion
- When xdatum is removed, a new xdatum with 'delete marker' is written. (version==0xffffffff means 'delete marker') - When xref is removed, a new xref with 'delete marker' is written. (odd-numbered xseqno means 'delete marker') - delete_xattr_(datum/xref)_delay() are new deletion functions are added. We can only use them if we can detect the target obsolete xdatum/xref as a orphan or errir one. (e.g when inode deletion, or detecting crc error) [1/3] jffs2-xattr-v6-01-delete_marker.patch Signed-off-by: KaiGai Kohei <kaigai@ak.jp.nec.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/erase.c')
-rw-r--r--fs/jffs2/erase.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index 1862e8bc101d..1644e3408852 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -230,7 +230,6 @@ static inline void jffs2_remove_node_refs_from_ino_list(struct jffs2_sb_info *c,
230 at the end of the linked list. Stash it and continue 230 at the end of the linked list. Stash it and continue
231 from the beginning of the list */ 231 from the beginning of the list */
232 ic = (struct jffs2_inode_cache *)(*prev); 232 ic = (struct jffs2_inode_cache *)(*prev);
233 BUG_ON(ic->class != RAWNODE_CLASS_INODE_CACHE);
234 prev = &ic->nodes; 233 prev = &ic->nodes;
235 continue; 234 continue;
236 } 235 }
@@ -254,7 +253,8 @@ static inline void jffs2_remove_node_refs_from_ino_list(struct jffs2_sb_info *c,
254 253
255 /* PARANOIA */ 254 /* PARANOIA */
256 if (!ic) { 255 if (!ic) {
257 printk(KERN_WARNING "inode_cache not found in remove_node_refs()!!\n"); 256 JFFS2_WARNING("inode_cache/xattr_datum/xattr_ref"
257 " not found in remove_node_refs()!!\n");
258 return; 258 return;
259 } 259 }
260 260
@@ -279,8 +279,19 @@ static inline void jffs2_remove_node_refs_from_ino_list(struct jffs2_sb_info *c,
279 printk("\n"); 279 printk("\n");
280 }); 280 });
281 281
282 if (ic->nodes == (void *)ic && ic->nlink == 0) 282 switch (ic->class) {
283 jffs2_del_ino_cache(c, ic); 283#ifdef CONFIG_JFFS2_FS_XATTR
284 case RAWNODE_CLASS_XATTR_DATUM:
285 jffs2_release_xattr_datum(c, (struct jffs2_xattr_datum *)ic);
286 break;
287 case RAWNODE_CLASS_XATTR_REF:
288 jffs2_release_xattr_ref(c, (struct jffs2_xattr_ref *)ic);
289 break;
290#endif
291 default:
292 if (ic->nodes == (void *)ic && ic->nlink == 0)
293 jffs2_del_ino_cache(c, ic);
294 }
284} 295}
285 296
286void jffs2_free_jeb_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) 297void jffs2_free_jeb_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)