+ // link far right's left pointer to new page
+
+ if( linkleft && set->latch->page_no > ROOT_page )
+ if( right2 ) {
+ if( temp->latch = lvl ? bt_pinlatch (mgr, right2, thread_no) : bt_pinleaf (mgr, right2, thread_no) )
+ temp->page = bt_mappage (mgr, temp->latch);
+ else
+ return 0;
+
+ bt_lockpage(BtLockLink, temp->latch, thread_no, __LINE__);
+ bt_putid (temp->page->left, right->latch->page_no);
+ bt_unlockpage(BtLockLink, temp->latch, thread_no, __LINE__);
+ bt_unpinlatch (temp->latch, thread_no, __LINE__);
+ } else { // page is rightmost
+ bt_mutexlock (mgr->lock);
+ bt_putid (mgr->pagezero->alloc->left, right->latch->page_no);
+ bt_releasemutex(mgr->lock);
+ }
+