aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/nodemgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/nodemgmt.c')
-rw-r--r--fs/jffs2/nodemgmt.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
index 8bedfd2ff689..01594a2256eb 100644
--- a/fs/jffs2/nodemgmt.c
+++ b/fs/jffs2/nodemgmt.c
@@ -684,19 +684,26 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
684 spin_lock(&c->erase_completion_lock); 684 spin_lock(&c->erase_completion_lock);
685 685
686 ic = jffs2_raw_ref_to_ic(ref); 686 ic = jffs2_raw_ref_to_ic(ref);
687 /* It seems we should never call jffs2_mark_node_obsolete() for
688 XATTR nodes.... yet. Make sure we notice if/when we change
689 that :) */
690 BUG_ON(ic->class != RAWNODE_CLASS_INODE_CACHE);
691 for (p = &ic->nodes; (*p) != ref; p = &((*p)->next_in_ino)) 687 for (p = &ic->nodes; (*p) != ref; p = &((*p)->next_in_ino))
692 ; 688 ;
693 689
694 *p = ref->next_in_ino; 690 *p = ref->next_in_ino;
695 ref->next_in_ino = NULL; 691 ref->next_in_ino = NULL;
696 692
697 if (ic->nodes == (void *)ic && ic->nlink == 0) 693 switch (ic->class) {
698 jffs2_del_ino_cache(c, ic); 694#ifdef CONFIG_JFFS2_FS_XATTR
699 695 case RAWNODE_CLASS_XATTR_DATUM:
696 jffs2_release_xattr_datum(c, (struct jffs2_xattr_datum *)ic);
697 break;
698 case RAWNODE_CLASS_XATTR_REF:
699 jffs2_release_xattr_ref(c, (struct jffs2_xattr_ref *)ic);
700 break;
701#endif
702 default:
703 if (ic->nodes == (void *)ic && ic->nlink == 0)
704 jffs2_del_ino_cache(c, ic);
705 break;
706 }
700 spin_unlock(&c->erase_completion_lock); 707 spin_unlock(&c->erase_completion_lock);
701 } 708 }
702 709