diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-05-22 10:23:10 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-05-22 10:23:10 -0400 |
commit | fcb7578719529898aef9edce8e409e457a1c2d15 (patch) | |
tree | 58022b22d175b69e4b267f2f19ab26d93f7d4910 /fs/jffs2/nodelist.c | |
parent | a1b563d652b54647ffacb2d6edf7859d3e97a723 (diff) |
[JFFS2] Extend jffs2_link_node_ref() to link into per-inode list too.
Let's avoid the potential for forgetting to set ref->next_in_ino, by doing
it within jffs2_link_node_ref() instead.
This highlights the ugliness of what we're currently doing with
xattr_datum and xattr_ref structures -- we should find a nicer way of
dealing with that.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/nodelist.c')
-rw-r--r-- | fs/jffs2/nodelist.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c index 7d563f938b1c..d25d4919ca97 100644 --- a/fs/jffs2/nodelist.c +++ b/fs/jffs2/nodelist.c | |||
@@ -1048,7 +1048,8 @@ void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c) | |||
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | void jffs2_link_node_ref(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, | 1050 | void jffs2_link_node_ref(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, |
1051 | struct jffs2_raw_node_ref *ref, uint32_t len) | 1051 | struct jffs2_raw_node_ref *ref, uint32_t len, |
1052 | struct jffs2_inode_cache *ic) | ||
1052 | { | 1053 | { |
1053 | if (!jeb->first_node) | 1054 | if (!jeb->first_node) |
1054 | jeb->first_node = ref; | 1055 | jeb->first_node = ref; |
@@ -1065,6 +1066,13 @@ void jffs2_link_node_ref(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, | |||
1065 | } | 1066 | } |
1066 | jeb->last_node = ref; | 1067 | jeb->last_node = ref; |
1067 | 1068 | ||
1069 | if (ic) { | ||
1070 | ref->next_in_ino = ic->nodes; | ||
1071 | ic->nodes = ref; | ||
1072 | } else { | ||
1073 | ref->next_in_ino = NULL; | ||
1074 | } | ||
1075 | |||
1068 | switch(ref_flags(ref)) { | 1076 | switch(ref_flags(ref)) { |
1069 | case REF_UNCHECKED: | 1077 | case REF_UNCHECKED: |
1070 | c->unchecked_size += len; | 1078 | c->unchecked_size += len; |
@@ -1120,12 +1128,11 @@ int jffs2_scan_dirty_space(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb | |||
1120 | 1128 | ||
1121 | ref->flash_offset = jeb->offset + c->sector_size - jeb->free_size; | 1129 | ref->flash_offset = jeb->offset + c->sector_size - jeb->free_size; |
1122 | ref->flash_offset |= REF_OBSOLETE; | 1130 | ref->flash_offset |= REF_OBSOLETE; |
1123 | ref->next_in_ino = 0; | ||
1124 | #ifdef TEST_TOTLEN | 1131 | #ifdef TEST_TOTLEN |
1125 | ref->__totlen = size; | 1132 | ref->__totlen = size; |
1126 | #endif | 1133 | #endif |
1127 | 1134 | ||
1128 | jffs2_link_node_ref(c, jeb, ref, size); | 1135 | jffs2_link_node_ref(c, jeb, ref, size, NULL); |
1129 | } | 1136 | } |
1130 | 1137 | ||
1131 | return 0; | 1138 | return 0; |