Lines Matching defs:node
121 * Make a single attempt to progress GC. Move one node, and possibly
140 the node CRCs etc. */
310 jffs2_dbg(1, "Going to garbage collect node at 0x%08x\n",
314 /* Inode-less node. Clean marker, snapshot or something like that */
317 /* It's an unknown node with JFFS2_FEATURE_RWCOMPAT_COPY */
330 /* When 'ic' refers xattr_datum/xattr_ref, this node is GCed as xattr.
331 * We can decide whether this node is inode or xattr by ic->class. */
359 2. Inode is not in-core, node is REF_PRISTINE. We lock the
360 inocache to prevent a read_inode(), copy the node intact.
361 3. Inode is not in-core, node is not pristine. We must iget()
374 jffs2_dbg(1, "Ino #%u is absent but node not REF_PRISTINE. Reading.\n",
422 node intact, and we don't have to muck about with the fragtree etc.
471 pr_err("Error garbage collecting node at %08x!\n",
520 jffs2_dbg(1, "node to be GC'd was obsoleted in the meantime.\n");
533 /* FIXME. Read node and do lookup? */
535 if (frag->node && frag->node->raw == raw) {
536 fn = frag->node;
540 if (nrfrags == frag->node->frags)
549 frag->node->raw = f->inocache->nodes;
576 pr_warn("Raw node at 0x%08x wasn't in node lists for ino #%u\n",
595 union jffs2_node_union *node;
602 jffs2_dbg(1, "Going to GC REF_PRISTINE node at 0x%08x\n",
624 node = kmalloc(rawlen, GFP_KERNEL);
625 if (!node)
628 ret = jffs2_flash_read(c, ref_offset(raw), rawlen, &retlen, (char *)node);
634 crc = crc32(0, node, sizeof(struct jffs2_unknown_node)-4);
635 if (je32_to_cpu(node->u.hdr_crc) != crc) {
636 pr_warn("Header CRC failed on REF_PRISTINE node at 0x%08x: Read 0x%08x, calculated 0x%08x\n",
637 ref_offset(raw), je32_to_cpu(node->u.hdr_crc), crc);
641 switch(je16_to_cpu(node->u.nodetype)) {
643 crc = crc32(0, node, sizeof(node->i)-8);
644 if (je32_to_cpu(node->i.node_crc) != crc) {
645 pr_warn("Node CRC failed on REF_PRISTINE data node at 0x%08x: Read 0x%08x, calculated 0x%08x\n",
646 ref_offset(raw), je32_to_cpu(node->i.node_crc),
651 if (je32_to_cpu(node->i.dsize)) {
652 crc = crc32(0, node->i.data, je32_to_cpu(node->i.csize));
653 if (je32_to_cpu(node->i.data_crc) != crc) {
654 pr_warn("Data CRC failed on REF_PRISTINE data node at 0x%08x: Read 0x%08x, calculated 0x%08x\n",
656 je32_to_cpu(node->i.data_crc), crc);
663 crc = crc32(0, node, sizeof(node->d)-8);
664 if (je32_to_cpu(node->d.node_crc) != crc) {
665 pr_warn("Node CRC failed on REF_PRISTINE dirent node at 0x%08x: Read 0x%08x, calculated 0x%08x\n",
667 je32_to_cpu(node->d.node_crc), crc);
671 if (strnlen(node->d.name, node->d.nsize) != node->d.nsize) {
672 pr_warn("Name in dirent node at 0x%08x contains zeroes\n",
677 if (node->d.nsize) {
678 crc = crc32(0, node->d.name, node->d.nsize);
679 if (je32_to_cpu(node->d.name_crc) != crc) {
680 pr_warn("Name CRC failed on REF_PRISTINE dirent node at 0x%08x: Read 0x%08x, calculated 0x%08x\n",
682 je32_to_cpu(node->d.name_crc), crc);
690 pr_warn("Unknown node type for REF_PRISTINE node at 0x%08x: 0x%04x\n",
691 ref_offset(raw), je16_to_cpu(node->u.nodetype));
696 /* OK, all the CRCs are good; this node can just be copied as-is. */
700 ret = jffs2_flash_write(c, phys_ofs, rawlen, &retlen, (char *)node);
718 jffs2_dbg(1, "Retrying failed write of REF_PRISTINE node.\n");
747 jffs2_dbg(1, "WHEEE! GC REF_PRISTINE node at 0x%08x succeeded\n",
751 kfree(node);
772 /* For these, we don't actually need to read the old node */
919 /* Prevent the erase code from nicking the obsolete node refs while
944 /* This is an obsolete node belonging to the same directory, and it's of the right
948 pr_warn("%s(): Read error (%d) reading obsolete node at %08x\n",
954 pr_warn("%s(): Short read (%zd not %u) reading header from obsolete node at %08x\n",
975 /* OK. The name really does match. There really is still an older node on
993 we should update the metadata node with those times accordingly */
1023 jffs2_dbg(1, "Writing replacement hole node for ino #%u from offset 0x%x to 0x%x\n",
1035 pr_warn("Node read failed in jffs2_garbage_collect_hole. Ret %d, retlen %zd. Data will be lost by writing new hole node\n",
1040 pr_warn("%s(): Node at 0x%08x had node type 0x%04x instead of JFFS2_NODETYPE_INODE(0x%04x)\n",
1062 pr_warn("%s(): Node 0x%08x wasn't a hole node!\n",
1111 pr_warn("Error writing new hole node: %ld\n", PTR_ERR(new_fn));
1125 * We should only get here in the case where the node we are
1136 /* This is a partially-overlapped hole node. Mark it REF_NORMAL not REF_PRISTINE */
1143 if (frag->node == fn) {
1144 frag->node = new_fn;
1150 pr_warn("%s(): Old node still has frags!\n", __func__);
1154 pr_warn("%s(): New node has no frags!\n", __func__);
1217 if (!frag->node || !frag->node->raw) {
1227 struct jffs2_raw_node_ref *raw = frag->node->raw;
1259 /* Find last frag which is actually part of the node we're to GC. */
1273 if (!frag->node || !frag->node->raw) {
1283 struct jffs2_raw_node_ref *raw = frag->node->raw;