Lines Matching defs:this
11 * This code is derived from software contributed to The NetBSD Foundation
18 * notice, this list of conditions and the following disclaimer.
20 * notice, this list of conditions and the following disclaimer in the
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
324 struct chfs_tmp_dnode_info *this;
330 this = (struct chfs_tmp_dnode_info *)node;
331 while (this->tmpnode->overlapped) {
334 this->tmpnode->overlapped = 0;
338 this = (struct chfs_tmp_dnode_info *)node;
343 this = (struct chfs_tmp_dnode_info *)node;
344 if (this->tmpnode->node->ofs > end_ofs)
347 struct chfs_tmp_dnode *tmp_td = this->tmpnode;
350 /* This is a new version of an old node. */
356 chfs_remove_tmp_dnode_from_tdi(this, tmp_td);
358 chfs_add_tmp_dnode_to_tdi(this, newtd);
365 /* New node entirely overlaps 'this' */
371 /* ... and is good. Kill 'this' and any subsequent nodes which are also overlapped */
373 struct rb_node *next = rb_tree_iterate(&rii->tdi_root, this, RB_DIR_RIGHT);
382 chfs_remove_tmp_dnode_from_tdi(this, tmp_td);
384 if (!this->tmpnode) {
385 rb_tree_remove_node(&rii->tdi_root, this);
386 chfs_kill_tdi(chmp, this);
387 this = next_tdi;
397 /* New node entirely overlapped by 'this' */
399 dbg("this version: %llu\n",
401 dbg("this ofs: %llu, size: %u\n",
408 /* ... but 'this' was bad. Replace it... */
409 chfs_remove_tmp_dnode_from_tdi(this, tmp_td);
411 if (!this->tmpnode) {
412 rb_tree_remove_node(&rii->tdi_root, this);
413 chfs_kill_tdi(chmp, this);
439 this = (struct chfs_tmp_dnode_info *)node;
440 if (this->tmpnode->node->ofs + this->tmpnode->node->size > newtd->node->ofs) {
443 if (!this->tmpnode->overlapped)
448 this->tmpnode->overlapped = 0;
457 this = (struct chfs_tmp_dnode_info *)node;
458 while (this && this->tmpnode->node->ofs < end_ofs) {
459 this->tmpnode->overlapped = 1;
461 this = (struct chfs_tmp_dnode_info *)node;
494 struct chfs_node_frag *this, uint32_t lastend)
522 struct chfs_node_frag *this;
527 this = (struct chfs_node_frag *)rb_tree_find_node_leq(fragtree, &newfrag->ofs);
529 if (this) {
530 lastend = this->ofs + this->size;
538 if (this->node)
539 CHFS_MARK_REF_NORMAL(this->node->nref);
542 return no_overlapping_node(fragtree, newfrag, this, lastend);
545 if (newfrag->ofs > this->ofs) {
547 if (this->node)
548 CHFS_MARK_REF_NORMAL(this->node->nref);
550 if (this->ofs + this->size > newfrag->ofs + newfrag->size) {
551 /* Newfrag is inside of this. */
554 newfrag2 = new_fragment(this->node, newfrag->ofs + newfrag->size,
555 this->ofs + this->size - newfrag->ofs - newfrag->size);
559 this->size = newfrag->ofs - this->ofs;
566 /* Newfrag is bottom of this. */
567 this->size = newfrag->ofs - this->ofs;
572 rb_tree_remove_node(fragtree, this);
575 if (newfrag->ofs + newfrag->size >= this->ofs+this->size) {
576 chfs_obsolete_node_frag(chmp, this);
578 this->ofs += newfrag->size;
579 this->size -= newfrag->size;
581 this);
588 while ((this = frag_next(fragtree, newfrag)) && newfrag->ofs + newfrag->size >= this->ofs + this->size) {
589 rb_tree_remove_node(fragtree, this);
590 chfs_obsolete_node_frag(chmp, this);
593 if (!this || newfrag->ofs + newfrag->size == this->ofs)
596 this->size = (this->ofs + this->size) - (newfrag->ofs + newfrag->size);
597 this->ofs = newfrag->ofs + newfrag->size;
599 if (this->node)
600 CHFS_MARK_REF_NORMAL(this->node->nref);
615 struct chfs_node_frag *this, *next;
622 this = (struct chfs_node_frag *)RB_TREE_MIN(fragtree);
623 while (this) {
624 next = frag_next(fragtree, this);
625 if (this->node->nref == nref) {
626 rb_tree_remove_node(fragtree, this);
627 chfs_free_node_frag(this);
629 this = next;
641 struct chfs_node_frag *this, *next;
644 this = (struct chfs_node_frag *)RB_TREE_MIN(fragtree);
645 while (this) {
646 next = frag_next(fragtree, this);
647 rb_tree_remove_node(fragtree, this);
648 chfs_obsolete_node_frag(chmp, this);
649 this = next;
708 struct chfs_node_frag *this)
712 if (this->node) {
714 KASSERT(this->node->frags != 0);
715 this->node->frags--;
716 if (this->node->frags == 0) {
717 /* This is the last fragment. (There is no more.) */
718 KASSERT(!CHFS_REF_OBSOLETE(this->node->nref));
720 vc = chfs_nref_to_vc(this->node->nref);
721 dbg("[MARK] lnr: %u ofs: %u\n", this->node->nref->nref_lnr,
722 this->node->nref->nref_offset);
724 chfs_remove_and_obsolete(chmp, vc, this->node->nref, &vc->dnode);
727 chfs_free_full_dnode(this->node);
730 CHFS_MARK_REF_NORMAL(this->node->nref);
733 chfs_free_node_frag(this);
887 struct chfs_tmp_dnode_info *pen, *last, *this;
917 this = (struct chfs_tmp_dnode_info *)RB_TREE_MAX(&ver_tree);
920 while (this) {
924 vers_next = (struct chfs_tmp_dnode_info *)rb_tree_iterate(&ver_tree, this, RB_DIR_LEFT);
925 rb_tree_remove_node(&ver_tree, this);
927 struct chfs_tmp_dnode *tmp_td = this->tmpnode;
934 chfs_remove_tmp_dnode_from_tdi(this, tmp_td);
951 vers_next = (struct chfs_tmp_dnode_info *)rb_tree_iterate(&ver_tree, this, RB_DIR_LEFT);
956 chfs_remove_tmp_dnode_from_tdi(this, tmp_td);
960 chfs_free_tmp_dnode_info(this);
961 this = vers_next;
962 if (!this)
973 chfs_remove_tmp_dnode_from_tdi(this, tmp_td);
979 chfs_kill_tdi(chmp, this);
980 this = vers_next;