| btree_format#(VOLSIZE, SIZE, MAXINO0; ADRT, ROOTADR, ISTORE, ISTORE0, GINVAL, GSTORE, GSTORE0, NL, MAXINO, OS, PSTATE, PSYNCED; RT, ERR) {if SIZE = LEB_SIZE then {RT := null; apersistence_format#(VOLSIZE, SIZE, MAXINO0; ; ROOTADR, ISTORE, ISTORE0, GINVAL, GSTORE, GSTORE0, NL, MAXINO, OS, PSTATE, PSYNCED, ERR); let N = ? in {apersistence_get_leb_size#(ROOTADR, ISTORE, ISTORE0, GINVAL, GSTORE, GSTORE0, NL, MAXINO, OS, PSTATE, PSYNCED; ; N); if ERR = ESUCCESS then let IND = indexnode(mkbrarray(BRANCH_SIZE), true, 0) in let SIZE = IND.flashsize in {if SIZE > N then {debug#("btree: initial index node to large"); ERR := ENOSPC}; if ERR = ESUCCESS then apersistence_allocate_ind#(ROOTADR, ISTORE0, GINVAL, GSTORE, GSTORE0, NL, MAXINO, OS, PSYNCED; ISTORE, PSTATE; ERR); if ERR = ESUCCESS then apersistence_add_ind# (IND, ROOTADR, ISTORE0, GINVAL, GSTORE, GSTORE0, NL, MAXINO, OS; ADRT, ISTORE, PSTATE, PSYNCED; ERR); if ERR = ESUCCESS then apersistence_set_iblock_refsize# (ADRT.lnum, SIZE, ROOTADR, ISTORE0, GINVAL, GSTORE, GSTORE0, NL, MAXINO, OS, PSTATE, PSYNCED; ISTORE); if ERR = ESUCCESS then apersistence_sync#(ROOTADR, ISTORE, ISTORE0, GINVAL, GSTORE, GSTORE0, NL, MAXINO, OS; PSTATE, PSYNCED; ERR); if ERR = ESUCCESS then let NS = ∅ in apersistence_commit# (ADRT, MAXINO0, PSYNCED; NS, ISTORE, GINVAL, GSTORE, ROOTADR, ISTORE0, GSTORE0, NL, MAXINO, OS; PSTATE, ERR)}}} else abort } |