#endif
for (b = pL->frag.listHead; b != NULL; b = b->next) {
- jNode = (struct jffs2_raw_inode *) get_node_mem(b->offset,
- pL->readbuf);
+ /*
+ * Copy just the node and not the data at this point,
+ * since we don't yet know if we need this data.
+ */
+ jNode = (struct jffs2_raw_inode *)get_fl_mem(b->offset,
+ sizeof(struct jffs2_raw_inode),
+ pL->readbuf);
if (inode == jNode->ino) {
#if 0
putLabeledWord("\r\n\r\nread_inode: totlen = ", jNode->totlen);
#endif
if(dest) {
- src = ((uchar *) jNode) + sizeof(struct jffs2_raw_inode);
+ /*
+ * Now that the inode has been checked,
+ * read the entire inode, including data.
+ */
+ put_fl_mem(jNode, pL->readbuf);
+ jNode = (struct jffs2_raw_inode *)
+ get_node_mem(b->offset, pL->readbuf);
+ src = ((uchar *)jNode) +
+ sizeof(struct jffs2_raw_inode);
/* ignore data behind latest known EOF */
if (jNode->offset > totalSize) {
put_fl_mem(jNode, pL->readbuf);
pL->readbuf);
if (pino == jDir->pino) {
u32 i_version = 0;
- struct jffs2_raw_inode ojNode;
struct jffs2_raw_inode *jNode, *i = NULL;
struct b_node *b2;
for (b2 = pL->frag.listHead; b2; b2 = b2->next) {
jNode = (struct jffs2_raw_inode *)
- get_fl_mem(b2->offset, sizeof(ojNode), &ojNode);
- if (jNode->ino == jDir->ino && jNode->version >= i_version) {
+ get_fl_mem(b2->offset, sizeof(*jNode),
+ NULL);
+ if (jNode->ino == jDir->ino &&
+ jNode->version >= i_version) {
i_version = jNode->version;
if (i)
put_fl_mem(i, NULL);
sizeof(*i),
NULL);
}
+ put_fl_mem(jNode, NULL);
}
dump_inode(pL, jDir, i);