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