// note: this will fail in mount -> unmount -> mount type situations, bc
// prior state isn't fully cleaned up.
- dout(1) << "mount" << endl;
+ dout(1) << "mount " << dev.get_device_name() << endl;
ebofs_lock.Lock();
assert(!mounted);
commit_thread.create();
finisher_thread.create();
- dout(1) << "mount mounted" << endl;
+ dout(1) << "mount mounted " << dev.get_device_name() << endl;
mounted = true;
ebofs_lock.Unlock();
close_tables();
dev.close();
- dout(1) << "umount done" << endl;
+ dout(1) << "umount done on " << dev.get_device_name() << endl;
ebofs_lock.Unlock();
return 0;
}
assert(onode_map.count(oid) == 0);
onode_map[oid] = on;
- onode_lru.lru_insert_mid(on);
+ onode_lru.lru_insert_top(on);
assert(object_tab->lookup(oid) < 0);
object_tab->insert( oid, on->onode_loc ); // even tho i'm not placed yet
// yep, just wait.
Cond c;
waitfor_onode[oid].push_back(&c);
- dout(7) << "get_onode " << oid << " already loading, waiting" << endl;
+ dout(10) << "get_onode " << oid << " already loading, waiting" << endl;
c.Wait(ebofs_lock);
continue;
}
- dout(7) << "get_onode reading " << hex << oid << dec << " from " << onode_loc << endl;
+ dout(10) << "get_onode reading " << hex << oid << dec << " from " << onode_loc << endl;
assert(waitfor_onode.count(oid) == 0);
waitfor_onode[oid].clear(); // this should be empty initially.
// parse data block
Onode *on = new Onode(oid);
onode_map[oid] = on;
+ onode_lru.lru_insert_top(on);
struct ebofs_onode *eo = (struct ebofs_onode*)bl.c_str();
assert(eo->object_id == oid);
p += sizeof(len);
on->attr[key] = AttrVal(p, len);
p += len;
- dout(7) << "get_onode " << *on << " attr " << key << " len " << len << endl;
+ dout(10) << "get_onode " << *on << " attr " << key << " len " << len << endl;
}
// parse extents
for (int i=0; i<eo->num_extents; i++) {
Extent ex = *((Extent*)p);
on->extents.push_back(ex);
- dout(7) << "get_onode " << *on << " ex " << i << ": " << ex << endl;
+ dout(10) << "get_onode " << *on << " ex " << i << ": " << ex << endl;
n += ex.length;
p += sizeof(Extent);
}
object_tab->insert( on->object_id, on->onode_loc );
}
- dout(7) << "write_onode " << *on << " to " << on->onode_loc << endl;
+ dout(10) << "write_onode " << *on << " to " << on->onode_loc << endl;
struct ebofs_onode *eo = (struct ebofs_onode*)bl.c_str();
eo->onode_loc = on->onode_loc;
off += sizeof(int);
bl.copy_in(off, i->second.len, i->second.data);
off += i->second.len;
- dout(7) << "write_onode " << *on << " attr " << i->first << " len " << i->second.len << endl;
+ dout(10) << "write_onode " << *on << " attr " << i->first << " len " << i->second.len << endl;
}
// extents
for (unsigned i=0; i<on->extents.size(); i++) {
bl.copy_in(off, sizeof(Extent), (char*)&on->extents[i]);
off += sizeof(Extent);
- dout(7) << "write_onode " << *on << " ex " << i << ": " << on->extents[i] << endl;
+ dout(10) << "write_onode " << *on << " ex " << i << ": " << on->extents[i] << endl;
}
// write
assert(cnode_map.count(cid) == 0);
cnode_map[cid] = cn;
- cnode_lru.lru_insert_mid(cn);
+ cnode_lru.lru_insert_top(cn);
assert(collection_tab->lookup(cid) < 0);
collection_tab->insert( cid, cn->cnode_loc ); // even tho i'm not placed yet
continue;
}
- dout(7) << "get_cnode reading " << hex << cid << dec << " from " << cnode_loc << endl;
+ dout(10) << "get_cnode reading " << hex << cid << dec << " from " << cnode_loc << endl;
assert(waitfor_cnode.count(cid) == 0);
waitfor_cnode[cid].clear(); // this should be empty initially.
// parse data block
Cnode *cn = new Cnode(cid);
+
cnode_map[cid] = cn;
+ cnode_lru.lru_insert_top(cn);
struct ebofs_cnode *ec = (struct ebofs_cnode*)bl.c_str();
cn->cnode_loc = ec->cnode_loc;
p += sizeof(len);
cn->attr[key] = AttrVal(p, len);
p += len;
- dout(7) << "get_cnode " << *cn << " attr " << key << " len " << len << endl;
+ dout(10) << "get_cnode " << *cn << " attr " << key << " len " << len << endl;
}
// wake up other waiters
collection_tab->insert( cn->coll_id, cn->cnode_loc );
}
- dout(7) << "write_cnode " << *cn << " to " << cn->cnode_loc << endl;
+ dout(10) << "write_cnode " << *cn << " to " << cn->cnode_loc << endl;
struct ebofs_cnode ec;
ec.cnode_loc = cn->cnode_loc;
bl.copy_in(off, i->second.len, i->second.data);
off += i->second.len;
- dout(7) << "write_cnode " << *cn << " attr " << i->first << " len " << i->second.len << endl;
+ dout(10) << "write_cnode " << *cn << " attr " << i->first << " len " << i->second.len << endl;
}
// write