From 9231b21a79e2281b6fa3bea9aabc9c2a19249e2a Mon Sep 17 00:00:00 2001 From: sageweil Date: Mon, 27 Aug 2007 16:25:51 +0000 Subject: [PATCH] hash_map instead of map git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1706 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/ebofs/nodes.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/trunk/ceph/ebofs/nodes.h b/trunk/ceph/ebofs/nodes.h index fcdffa657c257..fd008d2866149 100644 --- a/trunk/ceph/ebofs/nodes.h +++ b/trunk/ceph/ebofs/nodes.h @@ -20,7 +20,8 @@ #include "types.h" #include "BlockDevice.h" - +#include "include/xlist.h" +#include "include/bitmapper.h" /* @@ -71,7 +72,9 @@ class Node { int *nrecs; public: - Node(nodeid_t i, bufferptr& b, int s) : id(i), state(s), bptr(b) { + xlist::item xlist; + + Node(nodeid_t i, bufferptr& b, int s) : id(i), state(s), bptr(b), xlist(this) { nrecs = (int*)(bptr.c_str()); type = (int*)(bptr.c_str() + sizeof(*nrecs)); } @@ -126,7 +129,7 @@ class Node { class NodePool { protected: - map node_map; // open node map + hash_map node_map; // open node map public: vector region_loc; // region locations @@ -137,10 +140,10 @@ class NodePool { // on-disk block states int num_nodes; set free; + set clean; + set limbo; set dirty; set tx; - set clean; // aka used - set limbo; Mutex &ebofs_lock; Cond commit_cond; @@ -416,7 +419,7 @@ class NodePool { // write map flushing++; - write_usemap(dev,version & 1); + write_usemap(dev, version & 1); // dirty -> tx (write to disk) assert(tx.empty()); @@ -542,7 +545,7 @@ class NodePool { void release_all() { while (!node_map.empty()) { - map::iterator i = node_map.begin(); + hash_map::iterator i = node_map.begin(); debofs(2) << "ebofs.nodepool.release_all leftover " << i->first << " " << i->second << std::endl; release( i->second ); } -- 2.39.5