diff options
author | KaiGai Kohei <kaigai@ak.jp.nec.com> | 2006-06-10 21:35:15 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-06-27 11:16:26 -0400 |
commit | c9f700f840bd481b3e01fcad1ba8da01794a6726 (patch) | |
tree | 786f4a6a3f3a2d619ae4230a62f95361fcd3245a /fs/jffs2/nodemgmt.c | |
parent | 6d4f8224d4ee065e0e3186cc554468d735e6015d (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/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 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 | ||